From e3bf53ade4cd62455e242b3e2db2f1a6ffb0f789 Mon Sep 17 00:00:00 2001 From: "Matt Johnson (via Claude)" Date: Fri, 5 Jun 2026 20:19:13 +0000 Subject: [PATCH] feat(v0.6-4): gauge_sites + town_anchors curation tables + GUI CRUD Closes Section A.5 (gauge_sites) and A.12 (town_anchors) of the audit doc by lifting both Python-dict curation lists into editable SQLite tables. Operators can add/edit/disable rows from the dashboard without a deploy; runtime reads go through cached accessors that invalidate when the REST API mutates state. Schema: v8.sql adds gauge_sites(site_id PK, gauge_name, lat, lon, action_ft, flood_minor_ft, flood_moderate_ft, flood_major_ft, enabled, updated_at). v9.sql adds town_anchors(anchor_id AUTOINC PK, name UNIQUE, lat, lon, state, enabled, updated_at). SCHEMA_VERSION 7 -> 9. Seed (meshai/persistence/curation.py): _GAUGE_SITES_SEED carries the original 9 Idaho rows from IDAHO_CURATED_SITES verbatim. _TOWN_ANCHORS_SEED carries the 29 Idaho-and-neighbor towns from _TOWN_COORDS verbatim. seed_gauge_sites() / seed_town_anchors() INSERT OR IGNORE -- safe to re-run; never overwrites user edits. Handler integration: - meshai/central/idaho_gauge_sites.py: IDAHO_CURATED_SITES dict deleted. lookup_site() now calls meshai.persistence.curation.lookup_gauge_site() which reads the table. THRESHOLD_RANK, normalize_site_id, and compute_threshold_state remain in this module (CODE per Matt s rule). - meshai/central/nwis_handler.py drops IDAHO_CURATED_SITES from its import list; the table-backed lookup_site() is API-compatible. - meshai/central_normalizer.py: _TOWN_COORDS dict deleted. _compute_distance_bearing() now calls meshai.persistence.curation.lookup_town_anchor() with the same lowercased-name semantics it always used. REST API (meshai/dashboard/api/curation_routes.py): /api/gauge-sites GET list, GET one, POST add, PUT update, DELETE /api/town-anchors GET list, GET one, POST add, PUT update, DELETE Every mutation calls invalidate_curation_cache() so handler reads see the new state on the next call -- no container restart. Dashboard (dashboard-frontend/src/pages/): - GaugeSites.tsx: table view with Add row / Edit row inline / Delete confirm + per-row enabled toggle. 8 columns mirror the schema. - TownAnchors.tsx: same pattern, 5 columns. Name is lowercased on save to match the lookup key. - Left-nav entries "Gauge Sites" (Droplets icon) and "Town Anchors" (MapPin icon) added to Layout.tsx; routes added to App.tsx. Tests (tests/test_curation.py, 18 cases): - v8/v9 tables exist - Seed lands every row from both dicts - Seed idempotent; never overwrites user edits - lookup_gauge_site hits/miss, disabled rows are invisible - lookup_town_anchor case-insensitive - REST API: GET list, GET one, GET 404, POST add, PUT update, DELETE, POST missing-field 400; both gauge_sites + town_anchors - Accessor reflects API mutations after invalidate_curation_cache() tests/test_nwis_handler.py back-compat: IDAHO_CURATED_SITES dict alias points at _GAUGE_SITES_SEED so the existing assertion suite still passes. tests/test_adapter_config_foundation.py schema_meta v7 -> v9 bump. Test count: 797 -> 819 (+18 curation cases + 4 maintenance updates). --- dashboard-frontend/src/App.tsx | 4 + dashboard-frontend/src/components/Layout.tsx | 4 + dashboard-frontend/src/pages/GaugeSites.tsx | 198 +++++++++++++ dashboard-frontend/src/pages/TownAnchors.tsx | 153 ++++++++++ meshai/central/idaho_gauge_sites.py | 132 ++------- meshai/central/nwis_handler.py | 1 - meshai/central_normalizer.py | 41 +-- meshai/dashboard/api/curation_routes.py | 280 ++++++++++++++++++ meshai/dashboard/server.py | 2 + .../static/assets/index-B1y0CpOn.css | 1 - .../static/assets/index-Bj-HMHAO.css | 1 + .../{index-B7WUE5ni.js => index-Dc1UcqB9.js} | 272 ++++++++--------- meshai/dashboard/static/index.html | 4 +- meshai/persistence/curation.py | 241 +++++++++++++++ meshai/persistence/db.py | 8 +- meshai/persistence/migrations/v8.sql | 28 ++ meshai/persistence/migrations/v9.sql | 24 ++ tests/test_adapter_config_foundation.py | 4 +- tests/test_curation.py | 214 +++++++++++++ tests/test_nwis_handler.py | 4 +- 20 files changed, 1333 insertions(+), 283 deletions(-) create mode 100644 dashboard-frontend/src/pages/GaugeSites.tsx create mode 100644 dashboard-frontend/src/pages/TownAnchors.tsx create mode 100644 meshai/dashboard/api/curation_routes.py delete mode 100644 meshai/dashboard/static/assets/index-B1y0CpOn.css create mode 100644 meshai/dashboard/static/assets/index-Bj-HMHAO.css rename meshai/dashboard/static/assets/{index-B7WUE5ni.js => index-Dc1UcqB9.js} (51%) create mode 100644 meshai/persistence/curation.py create mode 100644 meshai/persistence/migrations/v8.sql create mode 100644 meshai/persistence/migrations/v9.sql create mode 100644 tests/test_curation.py diff --git a/dashboard-frontend/src/App.tsx b/dashboard-frontend/src/App.tsx index 33226b3..f66e17a 100644 --- a/dashboard-frontend/src/App.tsx +++ b/dashboard-frontend/src/App.tsx @@ -8,6 +8,8 @@ import Alerts from './pages/Alerts' import Notifications from './pages/Notifications' import Reference from './pages/Reference' import AdapterConfig from './pages/AdapterConfig' +import GaugeSites from './pages/GaugeSites' +import TownAnchors from './pages/TownAnchors' import { ToastProvider } from './components/ToastProvider' function App() { @@ -23,6 +25,8 @@ function App() { } /> } /> } /> + } /> + } /> diff --git a/dashboard-frontend/src/components/Layout.tsx b/dashboard-frontend/src/components/Layout.tsx index e966260..8708bcc 100644 --- a/dashboard-frontend/src/components/Layout.tsx +++ b/dashboard-frontend/src/components/Layout.tsx @@ -9,6 +9,8 @@ import { BellRing, BookOpen, Sliders, + Droplets, + MapPin, } from 'lucide-react' import { fetchStatus, type SystemStatus } from '@/lib/api' import { useWebSocket } from '@/hooks/useWebSocket' @@ -27,6 +29,8 @@ const navItems = [ { path: '/notifications', label: 'Notifications', icon: BellRing }, { path: '/reference', label: 'Reference', icon: BookOpen }, { path: '/adapter-config', label: 'Adapter Config', icon: Sliders }, + { path: '/gauge-sites', label: 'Gauge Sites', icon: Droplets }, + { path: '/town-anchors', label: 'Town Anchors', icon: MapPin }, ] function formatUptime(seconds: number): string { diff --git a/dashboard-frontend/src/pages/GaugeSites.tsx b/dashboard-frontend/src/pages/GaugeSites.tsx new file mode 100644 index 0000000..439f5f4 --- /dev/null +++ b/dashboard-frontend/src/pages/GaugeSites.tsx @@ -0,0 +1,198 @@ +// v0.6-4 GaugeSites table editor. +import { useEffect, useState, useCallback } from 'react' +import { Loader2, Plus, Trash2, Check, X, Droplets } from 'lucide-react' + +interface GaugeSite { + site_id: string + gauge_name: string + lat: number + lon: number + action_ft: number | null + flood_minor_ft: number | null + flood_moderate_ft: number | null + flood_major_ft: number | null + enabled: boolean + updated_at: number +} + +const EMPTY_DRAFT: GaugeSite = { + site_id: '', gauge_name: '', lat: 0, lon: 0, + action_ft: null, flood_minor_ft: null, flood_moderate_ft: null, flood_major_ft: null, + enabled: true, updated_at: 0, +} + +export default function GaugeSites() { + const [rows, setRows] = useState([]) + const [loading, setLoading] = useState(true) + const [error, setError] = useState(null) + const [editing, setEditing] = useState(null) + const [draft, setDraft] = useState(EMPTY_DRAFT) + const [adding, setAdding] = useState(false) + + const refresh = useCallback(async () => { + setLoading(true) + setError(null) + try { + const res = await fetch('/api/gauge-sites') + if (!res.ok) throw new Error(`GET: ${res.status}`) + setRows(await res.json()) + } catch (e) { + setError(String(e)) + } finally { + setLoading(false) + } + }, []) + + useEffect(() => { refresh() }, [refresh]) + + const beginEdit = (r: GaugeSite) => { setEditing(r.site_id); setDraft({ ...r }); setAdding(false) } + const beginAdd = () => { setAdding(true); setEditing(null); setDraft({ ...EMPTY_DRAFT }) } + const cancel = () => { setEditing(null); setAdding(false); setDraft(EMPTY_DRAFT) } + + const save = async () => { + try { + const url = adding ? '/api/gauge-sites' : `/api/gauge-sites/${editing}` + const method = adding ? 'POST' : 'PUT' + const res = await fetch(url, { + method, + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(draft), + }) + if (!res.ok) { + const b = await res.json().catch(() => ({})) + alert(`save failed: ${b.detail || res.statusText}`) + return + } + cancel() + refresh() + } catch (e) { + alert(String(e)) + } + } + + const remove = async (siteId: string) => { + if (!confirm(`Delete ${siteId}?`)) return + const res = await fetch(`/api/gauge-sites/${siteId}`, { method: 'DELETE' }) + if (!res.ok) { alert(`delete failed: ${res.status}`); return } + refresh() + } + + if (loading) return
Loading…
+ if (error) return
Load failed: {error}
+ + return ( +
+
+ +

Gauge Sites

+ {rows.length} sites + +
+

+ NWS-AHPS stream gauge thresholds curated for the nwis_handler. Disabled rows are + ignored at envelope time. Changes propagate to the handler on the next event. +

+ + {adding && } + +
+ + + + + + + + + + + + + + + + {rows.map(r => editing === r.site_id ? ( + + + + ) : ( + + + + + + + + + + + + ))} + +
Site IDNameLat,LonActionMinorModerateMajorOn
+ +
{r.site_id}{r.gauge_name}{r.lat.toFixed(3)},{r.lon.toFixed(3)}{r.action_ft ?? '-'}{r.flood_minor_ft ?? '-'}{r.flood_moderate_ft ?? '-'}{r.flood_major_ft ?? '-'}{r.enabled ? : } + + +
+
+
+ ) +} + + +function RowEditor({ draft, setDraft, onSave, onCancel, adding }: { + draft: GaugeSite, setDraft: (g: GaugeSite) => void, + onSave: () => void, onCancel: () => void, adding?: boolean, +}) { + const upd = (k: keyof GaugeSite, v: unknown) => setDraft({ ...draft, [k]: v }) + return ( +
+ + + + + + + + + +
+ + +
+
+ ) +} diff --git a/dashboard-frontend/src/pages/TownAnchors.tsx b/dashboard-frontend/src/pages/TownAnchors.tsx new file mode 100644 index 0000000..c18718e --- /dev/null +++ b/dashboard-frontend/src/pages/TownAnchors.tsx @@ -0,0 +1,153 @@ +// v0.6-4 TownAnchors table editor. +import { useEffect, useState, useCallback } from 'react' +import { Loader2, Plus, Trash2, Check, X, MapPin } from 'lucide-react' + +interface TownAnchor { + anchor_id: number + name: string + lat: number + lon: number + state: string | null + enabled: boolean + updated_at: number +} + +const EMPTY_DRAFT: TownAnchor = { + anchor_id: 0, name: '', lat: 0, lon: 0, state: 'ID', enabled: true, updated_at: 0, +} + +export default function TownAnchors() { + const [rows, setRows] = useState([]) + const [loading, setLoading] = useState(true) + const [error, setError] = useState(null) + const [editing, setEditing] = useState(null) + const [adding, setAdding] = useState(false) + const [draft, setDraft] = useState(EMPTY_DRAFT) + + const refresh = useCallback(async () => { + setLoading(true); setError(null) + try { + const res = await fetch('/api/town-anchors') + if (!res.ok) throw new Error(`GET: ${res.status}`) + setRows(await res.json()) + } catch (e) { setError(String(e)) } finally { setLoading(false) } + }, []) + useEffect(() => { refresh() }, [refresh]) + + const beginEdit = (r: TownAnchor) => { setEditing(r.anchor_id); setDraft({ ...r }); setAdding(false) } + const beginAdd = () => { setAdding(true); setEditing(null); setDraft({ ...EMPTY_DRAFT }) } + const cancel = () => { setEditing(null); setAdding(false); setDraft(EMPTY_DRAFT) } + + const save = async () => { + const url = adding ? '/api/town-anchors' : `/api/town-anchors/${editing}` + const method = adding ? 'POST' : 'PUT' + const res = await fetch(url, { + method, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(draft), + }) + if (!res.ok) { + const b = await res.json().catch(() => ({})) + alert(`save failed: ${b.detail || res.statusText}`); return + } + cancel(); refresh() + } + + const remove = async (id: number) => { + if (!confirm(`Delete anchor ${id}?`)) return + const res = await fetch(`/api/town-anchors/${id}`, { method: 'DELETE' }) + if (!res.ok) { alert(`delete failed: ${res.status}`); return } + refresh() + } + + if (loading) return
Loading…
+ if (error) return
Load failed: {error}
+ + return ( +
+
+ +

Town Anchors

+ {rows.length} towns + +
+

+ Lookup table for the "X mi <bearing> of <town>" anchor in wire-string rendering. + Disabled rows fall through to the generic anchor chain. +

+ + {adding && } + +
+ + + + + + + + + + + + + {rows.map(r => editing === r.anchor_id ? ( + + + + ) : ( + + + + + + + + + ))} + +
NameLatLonStateOn
{r.name}{r.lat.toFixed(4)}{r.lon.toFixed(4)}{r.state || '-'}{r.enabled ? : } + + +
+
+
+ ) +} + + +function RowEditor({ draft, setDraft, onSave, onCancel, adding }: { + draft: TownAnchor, setDraft: (t: TownAnchor) => void, + onSave: () => void, onCancel: () => void, adding?: boolean, +}) { + const upd = (k: keyof TownAnchor, v: unknown) => setDraft({ ...draft, [k]: v }) + return ( +
+ + + + + +
+ + +
+
+ ) +} diff --git a/meshai/central/idaho_gauge_sites.py b/meshai/central/idaho_gauge_sites.py index 27003b9..392cb8a 100644 --- a/meshai/central/idaho_gauge_sites.py +++ b/meshai/central/idaho_gauge_sites.py @@ -1,122 +1,50 @@ -"""v0.5.12 Idaho gauge-site curation (STARTER SUBSET). +"""v0.6-4 Idaho gauge-site lookups (now backed by gauge_sites table). -9 high-priority Magic Valley + Treasure Valley + Salmon-Challis + Snake River -system gauges. Threshold values (action / flood_minor / flood_moderate / -flood_major) sourced from NWS-AHPS pages for each site, in feet (gage -height, parameter_code 00065). +The IDAHO_CURATED_SITES Python dict was migrated to the gauge_sites SQLite +table in v8.sql. seed_gauge_sites() (called from init_db on first boot) +populates the table with the original 9 sites. The lookup helpers below +read from the table via meshai.persistence.curation. -**STARTER SUBSET** -- expand via NWS-AHPS curation in v0.6.x. If a site is -missing here, the handler ignores it (no broadcast). v0.6.x will likely -migrate this dict to a `gauge_sites` table so non-engineers can curate via -the GUI. - -Convention for site_id keys: - USGS-prefixed, zero-padded as USGS publishes them (e.g. 'USGS-13139510'). - The handler normalizes incoming envelope site IDs to this form before - lookup so both 'USGS-13139510' and '13139510' resolve. - -Threshold values that the gauge doesn't have (e.g. flood_major above the -top observed historic crest) are left as None -- the handler treats None as -'this threshold doesn't apply at this site' so a reading can never enter -that band. +Module exports retained for backward-compat with existing tests: + lookup_site, normalize_site_id, THRESHOLD_RANK, compute_threshold_state. +The IDAHO_CURATED_SITES name itself is gone -- new code should call +lookup_site() (DB-backed) or the curation accessor directly. """ from typing import Optional -# site_id -> {gauge_name, lat, lon, action_ft, flood_minor_ft, -# flood_moderate_ft, flood_major_ft} -IDAHO_CURATED_SITES: dict = { - "USGS-13139510": { - "gauge_name": "Big Lost River near Mackay", - "lat": 43.910, "lon": -113.620, - "action_ft": 5.5, "flood_minor_ft": 7.0, - "flood_moderate_ft": None, "flood_major_ft": None, - }, - "USGS-13186000": { - "gauge_name": "Snake River at Heise", - "lat": 43.612, "lon": -111.654, - "action_ft": 12.0, "flood_minor_ft": 14.0, - "flood_moderate_ft": 16.0, "flood_major_ft": None, - }, - "USGS-13037500": { - "gauge_name": "Snake River at Idaho Falls", - "lat": 43.500, "lon": -112.034, - "action_ft": 8.5, "flood_minor_ft": 10.0, - "flood_moderate_ft": None, "flood_major_ft": None, - }, - "USGS-13135500": { - "gauge_name": "Big Wood River near Hailey", - "lat": 43.533, "lon": -114.318, - "action_ft": 6.0, "flood_minor_ft": 7.5, - "flood_moderate_ft": None, "flood_major_ft": None, - }, - "USGS-13205000": { - "gauge_name": "Boise River near Boise", - "lat": 43.690, "lon": -116.200, - "action_ft": 8.0, "flood_minor_ft": 10.5, - "flood_moderate_ft": None, "flood_major_ft": None, - }, - "USGS-13247500": { - "gauge_name": "Payette River at Banks", - "lat": 44.080, "lon": -116.130, - "action_ft": 10.0, "flood_minor_ft": 12.0, - "flood_moderate_ft": None, "flood_major_ft": None, - }, - "USGS-13057000": { - "gauge_name": "Henrys Fork near Rexburg", - "lat": 43.831, "lon": -111.781, - "action_ft": 9.0, "flood_minor_ft": 10.5, - "flood_moderate_ft": None, "flood_major_ft": None, - }, - "USGS-13162225": { - "gauge_name": "Salmon Falls Creek near San Jacinto", - "lat": 42.180, "lon": -114.850, - "action_ft": 8.0, "flood_minor_ft": 10.0, - "flood_moderate_ft": None, "flood_major_ft": None, - }, - "USGS-13083000": { - "gauge_name": "Bear River near Border WY/ID", - "lat": 42.214, "lon": -111.045, - "action_ft": 6.0, "flood_minor_ft": 8.0, - "flood_moderate_ft": None, "flood_major_ft": None, - }, -} - - -def normalize_site_id(raw: Optional[str]) -> Optional[str]: - """Accept 'USGS-13139510', 'USGS:13139510', '13139510', etc. Return the - canonical 'USGS-' form so the curation dict lookups succeed.""" - if not raw: return None - s = str(raw).strip() - # Already canonical -- return as-is for the fast path. - if s in IDAHO_CURATED_SITES: return s - # Strip common prefix variants. - for prefix in ("USGS-", "USGS:", "USGS_", "usgs-", "usgs:", "usgs_"): - if s.startswith(prefix): s = s[len(prefix):]; break - canonical = f"USGS-{s}" - return canonical - - -def lookup_site(raw_site_id: str) -> Optional[dict]: - """Return the curated-site dict for a raw envelope site_id, or None when - the site is not in the curated subset.""" - sid = normalize_site_id(raw_site_id) - if sid is None: return None - return IDAHO_CURATED_SITES.get(sid) - - # Ordered list of threshold names from low to high. Used to compare # "is current threshold higher than prior" (upward crossing detection). THRESHOLD_RANK = ["normal", "action", "flood_minor", "flood_moderate", "flood_major"] +def normalize_site_id(raw: Optional[str]) -> Optional[str]: + """Accept 'USGS-13139510', 'USGS:13139510', '13139510', etc. Return the + canonical 'USGS-' form so the curation table lookups succeed.""" + if not raw: return None + s = str(raw).strip() + for prefix in ("USGS-", "USGS:", "USGS_", "usgs-", "usgs:", "usgs_"): + if s.startswith(prefix): s = s[len(prefix):]; break + return f"USGS-{s}" + + +def lookup_site(raw_site_id: str) -> Optional[dict]: + """Return the curated-site dict for a raw envelope site_id, or None when + the site is not in the curated subset (or is disabled). + + v0.6-4: reads from the gauge_sites SQLite table via the curation accessor.""" + sid = normalize_site_id(raw_site_id) + if sid is None: return None + from meshai.persistence.curation import lookup_gauge_site + return lookup_gauge_site(sid) + + def compute_threshold_state(value_ft: float, site_thresholds: dict) -> str: """Bucket a gage_height reading (ft) into a NWS-AHPS threshold state.""" a = site_thresholds.get("action_ft") mn = site_thresholds.get("flood_minor_ft") md = site_thresholds.get("flood_moderate_ft") mj = site_thresholds.get("flood_major_ft") - # Higher thresholds win first. if mj is not None and value_ft >= mj: return "flood_major" if md is not None and value_ft >= md: return "flood_moderate" if mn is not None and value_ft >= mn: return "flood_minor" diff --git a/meshai/central/nwis_handler.py b/meshai/central/nwis_handler.py index b1530ac..531257c 100644 --- a/meshai/central/nwis_handler.py +++ b/meshai/central/nwis_handler.py @@ -42,7 +42,6 @@ from datetime import datetime from typing import Any, Optional from meshai.central.idaho_gauge_sites import ( - IDAHO_CURATED_SITES, THRESHOLD_RANK, compute_threshold_state, lookup_site, diff --git a/meshai/central_normalizer.py b/meshai/central_normalizer.py index 1f79474..6e92d45 100644 --- a/meshai/central_normalizer.py +++ b/meshai/central_normalizer.py @@ -164,42 +164,8 @@ def _clean_description(raw: Optional[str]) -> Optional[str]: # ---------- distance / bearing -------------------------------------------- -# Small lookup of Idaho (+ a few neighbor) towns -> (lat, lon). Used to -# render "X mi of " when the reverse-geocoder picked a -# city we know. Built from the geocoder.city values seen across 60-sample -# probe + major Idaho cities the operator's mesh is most likely to care -# about. Misses fall through silently: distance_mi/bearing stay None. -_TOWN_COORDS: dict[str, tuple[float, float]] = { - "boise": (43.6150, -116.2023), - "meridian": (43.6121, -116.3915), - "nampa": (43.5407, -116.5635), - "caldwell": (43.6629, -116.6874), - "idaho falls": (43.4666, -112.0340), - "pocatello": (42.8713, -112.4455), - "twin falls": (42.5630, -114.4609), - "coeur d'alene": (47.6777, -116.7805), - "lewiston": (46.4165, -117.0177), - "moscow": (46.7324, -117.0002), - "sandpoint": (48.2766, -116.5535), - "post falls": (47.7180, -116.9516), - "hayden": (47.7660, -116.7866), - "rathdrum": (47.8121, -116.8950), - "plummer": (47.3344, -116.8856), - "kellogg": (47.5380, -116.1352), - "bonners ferry": (48.6914, -116.3181), - "rexburg": (43.8260, -111.7897), - "blackfoot": (43.1905, -112.3447), - "burley": (42.5360, -113.7928), - "jerome": (42.7252, -114.5187), - "mountain home": (43.1330, -115.6912), - "stanley": (44.2160, -114.9311), - "salmon": (45.1758, -113.8957), - "mccall": (44.9111, -116.0987), - "weiser": (44.2510, -116.9690), - "soda springs": (42.6543, -111.6047), - "preston": (42.0963, -111.8766), - "montpelier": (42.3232, -111.2980), -} +# v0.6-4: town_anchors moved to a GUI-editable SQLite table. Lookups go +# through meshai.persistence.curation.lookup_town_anchor() now. def _haversine_miles(lat1: float, lon1: float, lat2: float, lon2: float) -> float: @@ -230,7 +196,8 @@ def _compute_distance_bearing( if event_lat is None or event_lon is None or not town: return None, None key = str(town).strip().lower() - coords = _TOWN_COORDS.get(key) + from meshai.persistence.curation import lookup_town_anchor + coords = lookup_town_anchor(key) if coords is None: return None, None tlat, tlon = coords diff --git a/meshai/dashboard/api/curation_routes.py b/meshai/dashboard/api/curation_routes.py new file mode 100644 index 0000000..189dcd3 --- /dev/null +++ b/meshai/dashboard/api/curation_routes.py @@ -0,0 +1,280 @@ +"""v0.6-4 REST API for gauge_sites + town_anchors curation tables. + +Endpoints (mirrors the adapter_config CRUD shape): + + gauge_sites: + GET /api/gauge-sites list (enabled and disabled) + GET /api/gauge-sites/{site_id} single row + POST /api/gauge-sites add new row + PUT /api/gauge-sites/{site_id} partial update + DELETE /api/gauge-sites/{site_id} remove row + + town_anchors: + GET /api/town-anchors list + GET /api/town-anchors/{anchor_id} single + POST /api/town-anchors add new + PUT /api/town-anchors/{anchor_id} partial update + DELETE /api/town-anchors/{anchor_id} remove + +Every mutating call invalidates the in-process curation cache so +handler-side reads (lookup_gauge_site, lookup_town_anchor) see the new +state on the next call -- no container restart. +""" +from __future__ import annotations + +import logging +import time +from typing import Any, Optional + +from fastapi import APIRouter, HTTPException, Request + +from meshai.persistence.curation import invalidate_curation_cache + +logger = logging.getLogger(__name__) + + +router = APIRouter(tags=["curation"]) + + +def _get_conn(): + from meshai.persistence import get_db + return get_db() + + +def _gauge_row_to_dict(r) -> dict: + return { + "site_id": r["site_id"], + "gauge_name": r["gauge_name"], + "lat": r["lat"], + "lon": r["lon"], + "action_ft": r["action_ft"], + "flood_minor_ft": r["flood_minor_ft"], + "flood_moderate_ft": r["flood_moderate_ft"], + "flood_major_ft": r["flood_major_ft"], + "enabled": bool(r["enabled"]), + "updated_at": r["updated_at"], + } + + +def _town_row_to_dict(r) -> dict: + return { + "anchor_id": r["anchor_id"], + "name": r["name"], + "lat": r["lat"], + "lon": r["lon"], + "state": r["state"], + "enabled": bool(r["enabled"]), + "updated_at": r["updated_at"], + } + + +# ============================================================================ +# gauge_sites +# ============================================================================ + + +@router.get("/gauge-sites") +async def list_gauges(request: Request) -> list[dict]: + conn = _get_conn() + return [_gauge_row_to_dict(r) for r in conn.execute( + "SELECT * FROM gauge_sites ORDER BY site_id" + ).fetchall()] + + +@router.get("/gauge-sites/{site_id}") +async def get_gauge(site_id: str, request: Request) -> dict: + conn = _get_conn() + r = conn.execute( + "SELECT * FROM gauge_sites WHERE site_id=?", (site_id,) + ).fetchone() + if r is None: + raise HTTPException(404, f"gauge_sites: {site_id} not found") + return _gauge_row_to_dict(r) + + +@router.post("/gauge-sites") +async def add_gauge(request: Request) -> dict: + body = await request.json() + if not isinstance(body, dict): raise HTTPException(400, "body must be a JSON object") + required = ("site_id", "gauge_name", "lat", "lon") + for f in required: + if f not in body: + raise HTTPException(400, f"missing required field: {f}") + if not isinstance(body["site_id"], str) or not body["site_id"].strip(): + raise HTTPException(400, "site_id must be a non-empty string") + try: + lat = float(body["lat"]); lon = float(body["lon"]) + except (TypeError, ValueError): + raise HTTPException(400, "lat/lon must be numeric") + + conn = _get_conn() + try: + conn.execute( + "INSERT INTO gauge_sites(site_id, gauge_name, lat, lon, action_ft, " + "flood_minor_ft, flood_moderate_ft, flood_major_ft, enabled, updated_at) " + "VALUES (?,?,?,?,?,?,?,?,?,?)", + (body["site_id"].strip(), + str(body["gauge_name"]).strip(), + lat, lon, + body.get("action_ft"), + body.get("flood_minor_ft"), + body.get("flood_moderate_ft"), + body.get("flood_major_ft"), + 1 if body.get("enabled", True) else 0, + time.time()), + ) + except Exception as e: + raise HTTPException(400, f"insert failed: {e}") + invalidate_curation_cache() + return await get_gauge(body["site_id"].strip(), request) + + +@router.put("/gauge-sites/{site_id}") +async def update_gauge(site_id: str, request: Request) -> dict: + body = await request.json() + if not isinstance(body, dict): raise HTTPException(400, "body must be a JSON object") + + conn = _get_conn() + existing = conn.execute( + "SELECT * FROM gauge_sites WHERE site_id=?", (site_id,) + ).fetchone() + if existing is None: + raise HTTPException(404, f"gauge_sites: {site_id} not found") + + fields = [] + args: list[Any] = [] + for col, validator in ( + ("gauge_name", lambda v: str(v).strip()), + ("lat", float), ("lon", float), + ("action_ft", lambda v: float(v) if v is not None else None), + ("flood_minor_ft", lambda v: float(v) if v is not None else None), + ("flood_moderate_ft", lambda v: float(v) if v is not None else None), + ("flood_major_ft", lambda v: float(v) if v is not None else None), + ("enabled", lambda v: 1 if bool(v) else 0), + ): + if col in body: + try: args.append(validator(body[col])) + except (TypeError, ValueError): + raise HTTPException(400, f"invalid value for {col}: {body[col]!r}") + fields.append(f"{col}=?") + if not fields: + raise HTTPException(400, "no editable fields provided") + + fields.append("updated_at=?") + args.append(time.time()) + args.append(site_id) + conn.execute( + f"UPDATE gauge_sites SET {', '.join(fields)} WHERE site_id=?", + tuple(args), + ) + invalidate_curation_cache() + return await get_gauge(site_id, request) + + +@router.delete("/gauge-sites/{site_id}") +async def delete_gauge(site_id: str, request: Request) -> dict: + conn = _get_conn() + cur = conn.execute("DELETE FROM gauge_sites WHERE site_id=?", (site_id,)) + if cur.rowcount == 0: + raise HTTPException(404, f"gauge_sites: {site_id} not found") + invalidate_curation_cache() + return {"deleted": site_id} + + +# ============================================================================ +# town_anchors +# ============================================================================ + + +@router.get("/town-anchors") +async def list_towns(request: Request) -> list[dict]: + conn = _get_conn() + return [_town_row_to_dict(r) for r in conn.execute( + "SELECT * FROM town_anchors ORDER BY name" + ).fetchall()] + + +@router.get("/town-anchors/{anchor_id}") +async def get_town(anchor_id: int, request: Request) -> dict: + conn = _get_conn() + r = conn.execute( + "SELECT * FROM town_anchors WHERE anchor_id=?", (anchor_id,) + ).fetchone() + if r is None: + raise HTTPException(404, f"town_anchors: {anchor_id} not found") + return _town_row_to_dict(r) + + +@router.post("/town-anchors") +async def add_town(request: Request) -> dict: + body = await request.json() + if not isinstance(body, dict): raise HTTPException(400, "body must be a JSON object") + for f in ("name", "lat", "lon"): + if f not in body: raise HTTPException(400, f"missing required field: {f}") + name = str(body["name"]).strip().lower() + if not name: raise HTTPException(400, "name must be non-empty") + try: + lat = float(body["lat"]); lon = float(body["lon"]) + except (TypeError, ValueError): + raise HTTPException(400, "lat/lon must be numeric") + + conn = _get_conn() + try: + cur = conn.execute( + "INSERT INTO town_anchors(name, lat, lon, state, enabled, updated_at) " + "VALUES (?,?,?,?,?,?)", + (name, lat, lon, body.get("state"), + 1 if body.get("enabled", True) else 0, time.time()), + ) + except Exception as e: + raise HTTPException(400, f"insert failed: {e}") + invalidate_curation_cache() + return await get_town(cur.lastrowid, request) + + +@router.put("/town-anchors/{anchor_id}") +async def update_town(anchor_id: int, request: Request) -> dict: + body = await request.json() + if not isinstance(body, dict): raise HTTPException(400, "body must be a JSON object") + + conn = _get_conn() + existing = conn.execute( + "SELECT * FROM town_anchors WHERE anchor_id=?", (anchor_id,) + ).fetchone() + if existing is None: + raise HTTPException(404, f"town_anchors: {anchor_id} not found") + + fields = [] + args: list[Any] = [] + for col, validator in ( + ("name", lambda v: str(v).strip().lower()), + ("lat", float), ("lon", float), + ("state", lambda v: str(v).strip() if v else None), + ("enabled", lambda v: 1 if bool(v) else 0), + ): + if col in body: + try: args.append(validator(body[col])) + except (TypeError, ValueError): + raise HTTPException(400, f"invalid value for {col}: {body[col]!r}") + fields.append(f"{col}=?") + if not fields: + raise HTTPException(400, "no editable fields provided") + fields.append("updated_at=?") + args.append(time.time()) + args.append(anchor_id) + conn.execute( + f"UPDATE town_anchors SET {', '.join(fields)} WHERE anchor_id=?", + tuple(args), + ) + invalidate_curation_cache() + return await get_town(anchor_id, request) + + +@router.delete("/town-anchors/{anchor_id}") +async def delete_town(anchor_id: int, request: Request) -> dict: + conn = _get_conn() + cur = conn.execute("DELETE FROM town_anchors WHERE anchor_id=?", (anchor_id,)) + if cur.rowcount == 0: + raise HTTPException(404, f"town_anchors: {anchor_id} not found") + invalidate_curation_cache() + return {"deleted": anchor_id} diff --git a/meshai/dashboard/server.py b/meshai/dashboard/server.py index 0200d96..9359961 100644 --- a/meshai/dashboard/server.py +++ b/meshai/dashboard/server.py @@ -1,5 +1,6 @@ """FastAPI server for MeshAI dashboard.""" from meshai.dashboard.api.adapter_config_routes import router as adapter_config_router +from meshai.dashboard.api.curation_routes import router as curation_router import asyncio import logging @@ -57,6 +58,7 @@ def create_app() -> FastAPI: app.include_router(system_router, prefix="/api") app.include_router(adapter_config_router, prefix="/api") + app.include_router(curation_router, prefix="/api") app.include_router(config_router, prefix="/api") app.include_router(mesh_router, prefix="/api") app.include_router(env_router, prefix="/api") diff --git a/meshai/dashboard/static/assets/index-B1y0CpOn.css b/meshai/dashboard/static/assets/index-B1y0CpOn.css deleted file mode 100644 index 43a4420..0000000 --- a/meshai/dashboard/static/assets/index-B1y0CpOn.css +++ /dev/null @@ -1 +0,0 @@ -.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}*,: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:JetBrains Mono,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}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-0\.5{left:.125rem}.left-1{left:.25rem}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-4{top:1rem}.top-6{top:1.5rem}.top-full{top:100%}.z-0{z-index:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-m-6{margin:-1.5rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.-ml-2{margin-left:-.5rem}.-ml-4{margin-left:-1rem}.-mr-1{margin-right:-.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-\[40vh\]{height:40vh}.h-\[540px\]{height:540px}.h-\[calc\(100vh-8rem\)\]{height:calc(100vh - 8rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[85vh\]{max-height:85vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[220px\]{width:220px}.w-\[250px\]{width:250px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[280px\]{min-width:280px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-4{--tw-translate-x: 1rem;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-x-5{--tw-translate-x: 1.25rem;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))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.scroll-mt-6{scroll-margin-top:1.5rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.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-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.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-border>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(30 42 58 / var(--tw-divide-opacity, 1))}.divide-slate-700\/60>:not([hidden])~:not([hidden]){border-color:#33415599}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1e2a3a\]{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-\[\#2a3a4a\]{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.border-accent{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-amber-500\/50{border-color:#f59e0b80}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/50{border-color:#3b82f680}.border-border{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-border\/50{border-color:#1e2a3a80}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-green-500\/50{border-color:#22c55e80}.border-red-400\/30{border-color:#f871714d}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/50{border-color:#ef444480}.border-red-600\/30{border-color:#dc26264d}.border-red-700\/30{border-color:#b91c1c4d}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-500\/30{border-color:#eab3084d}.border-l-blue-500{--tw-border-opacity: 1;border-left-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.bg-\[\#0a0e17\]{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1219\]{--tw-bg-opacity: 1;background-color:rgb(13 18 25 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1420\]{--tw-bg-opacity: 1;background-color:rgb(13 20 32 / var(--tw-bg-opacity, 1))}.bg-\[\#1a2332\]{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]\/50{background-color:#1e2a3a80}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-accent\/10{background-color:#3b82f61a}.bg-accent\/20{background-color:#3b82f633}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / 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\/10{background-color:#f59e0b1a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-bg{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-bg-card{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-bg-card\/90{background-color:#111827e6}.bg-bg-hover{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-border{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/20{background-color:#22c55e33}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / 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\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-600\/20{background-color:#dc262633}.bg-red-700\/20{background-color:#b91c1c33}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-500\/20{background-color:#64748b33}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/20{background-color:#eab30833}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position)}.fill-slate-100{fill:#f1f5f9}.fill-slate-400{fill:#94a3b8}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.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-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}.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-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.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}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.text-accent{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.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-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / 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-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-200\/80{color:#fef08acc}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.accent-cyan-500{accent-color:#06b6d4}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.blur{--tw-blur: blur(8px);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)}.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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.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-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}body{background:#0a0e17;margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#0a0e17}::-webkit-scrollbar-thumb{background:#2d3a4d;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#3b4a5d}.font-mono{font-family:JetBrains Mono,monospace}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-slow{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slide-in{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}.animate-slide-in{animation:slide-in .3s ease-out}.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.last\:border-0:last-child{border-width:0px}.hover\:border-\[\#2a3a4a\]:hover{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#0a0e17\]:hover{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]:hover{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]\/50:hover{background-color:#1e2a3a80}.hover\:bg-\[\#2a3a4a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 58 74 / var(--tw-bg-opacity, 1))}.hover\:bg-accent\/10:hover{background-color:#3b82f61a}.hover\:bg-accent\/80:hover{background-color:#3b82f6cc}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-amber-600:hover{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.hover\:bg-bg-hover:hover{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-500\/10:hover{background-color:#3b82f61a}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-slate-500\/10:hover{background-color:#64748b1a}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-slate-700:disabled{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline-flex{display:inline-flex}}@media (min-width: 768px){.md\:flex{display:flex}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/meshai/dashboard/static/assets/index-Bj-HMHAO.css b/meshai/dashboard/static/assets/index-Bj-HMHAO.css new file mode 100644 index 0000000..a01dea7 --- /dev/null +++ b/meshai/dashboard/static/assets/index-Bj-HMHAO.css @@ -0,0 +1 @@ +.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}*,: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:JetBrains Mono,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}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-0\.5{left:.125rem}.left-1{left:.25rem}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-4{top:1rem}.top-6{top:1.5rem}.top-full{top:100%}.z-0{z-index:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-m-6{margin:-1.5rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.-ml-2{margin-left:-.5rem}.-ml-4{margin-left:-1rem}.-mr-1{margin-right:-.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-\[40vh\]{height:40vh}.h-\[540px\]{height:540px}.h-\[calc\(100vh-8rem\)\]{height:calc(100vh - 8rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[85vh\]{max-height:85vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[220px\]{width:220px}.w-\[250px\]{width:250px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[280px\]{min-width:280px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-4{--tw-translate-x: 1rem;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-x-5{--tw-translate-x: 1.25rem;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))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.scroll-mt-6{scroll-margin-top:1.5rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.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-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.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-border>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(30 42 58 / var(--tw-divide-opacity, 1))}.divide-slate-700\/60>:not([hidden])~:not([hidden]){border-color:#33415599}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1e2a3a\]{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-\[\#2a3a4a\]{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.border-accent{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-amber-500\/50{border-color:#f59e0b80}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/50{border-color:#3b82f680}.border-border{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-border\/50{border-color:#1e2a3a80}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-green-500\/50{border-color:#22c55e80}.border-red-400\/30{border-color:#f871714d}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/50{border-color:#ef444480}.border-red-600\/30{border-color:#dc26264d}.border-red-700\/30{border-color:#b91c1c4d}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-500\/30{border-color:#eab3084d}.border-l-blue-500{--tw-border-opacity: 1;border-left-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.bg-\[\#0a0e17\]{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1219\]{--tw-bg-opacity: 1;background-color:rgb(13 18 25 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1420\]{--tw-bg-opacity: 1;background-color:rgb(13 20 32 / var(--tw-bg-opacity, 1))}.bg-\[\#1a2332\]{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]\/50{background-color:#1e2a3a80}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-accent\/10{background-color:#3b82f61a}.bg-accent\/20{background-color:#3b82f633}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / 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\/10{background-color:#f59e0b1a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-bg{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-bg-card{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-bg-card\/90{background-color:#111827e6}.bg-bg-hover{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-border{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-cyan-500\/20{background-color:#06b6d433}.bg-cyan-700{--tw-bg-opacity: 1;background-color:rgb(14 116 144 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/20{background-color:#22c55e33}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / 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\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-600\/20{background-color:#dc262633}.bg-red-700\/20{background-color:#b91c1c33}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-500\/20{background-color:#64748b33}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/40{background-color:#0f172a66}.bg-slate-900\/50{background-color:#0f172a80}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/20{background-color:#eab30833}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position)}.fill-slate-100{fill:#f1f5f9}.fill-slate-400{fill:#94a3b8}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.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-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}.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-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.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}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.text-accent{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.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-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / 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-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-200\/80{color:#fef08acc}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.accent-cyan-500{accent-color:#06b6d4}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.blur{--tw-blur: blur(8px);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)}.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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.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-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}body{background:#0a0e17;margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#0a0e17}::-webkit-scrollbar-thumb{background:#2d3a4d;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#3b4a5d}.font-mono{font-family:JetBrains Mono,monospace}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-slow{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slide-in{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}.animate-slide-in{animation:slide-in .3s ease-out}.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.last\:border-0:last-child{border-width:0px}.hover\:border-\[\#2a3a4a\]:hover{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#0a0e17\]:hover{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]:hover{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]\/50:hover{background-color:#1e2a3a80}.hover\:bg-\[\#2a3a4a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 58 74 / var(--tw-bg-opacity, 1))}.hover\:bg-accent\/10:hover{background-color:#3b82f61a}.hover\:bg-accent\/80:hover{background-color:#3b82f6cc}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-amber-600:hover{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.hover\:bg-bg-hover:hover{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-500\/10:hover{background-color:#3b82f61a}.hover\:bg-cyan-600:hover{--tw-bg-opacity: 1;background-color:rgb(8 145 178 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-slate-500\/10:hover{background-color:#64748b1a}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-800\/50:hover{background-color:#1e293b80}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-cyan-300:hover{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-slate-700:disabled{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline-flex{display:inline-flex}}@media (min-width: 768px){.md\:flex{display:flex}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/meshai/dashboard/static/assets/index-B7WUE5ni.js b/meshai/dashboard/static/assets/index-Dc1UcqB9.js similarity index 51% rename from meshai/dashboard/static/assets/index-B7WUE5ni.js rename to meshai/dashboard/static/assets/index-Dc1UcqB9.js index 5ea3c27..c20af86 100644 --- a/meshai/dashboard/static/assets/index-B7WUE5ni.js +++ b/meshai/dashboard/static/assets/index-Dc1UcqB9.js @@ -1,4 +1,4 @@ -function boe(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var fg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var QU={exports:{}},lS={},e7={exports:{}},yt={};/** +function Coe(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var dg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a7={exports:{}},fS={},o7={exports:{}},yt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function boe(e,t){for(var r=0;r>>1,Y=j[V];if(0>>1;Vi(le,G))hei(Re,le)?(j[V]=Re,j[he]=G,V=he):(j[V]=le,j[ee]=G,V=ee);else if(hei(Re,G))j[V]=Re,j[he]=G,V=he;else break e}}return U}function i(j,U){var G=j.sortIndex-U.sortIndex;return G!==0?G:j.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,f=null,h=3,d=!1,v=!1,g=!1,m=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(j){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=j)n(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=r(u)}}function S(j){if(g=!1,b(j),!v)if(r(l)!==null)v=!0,$(T);else{var U=r(u);U!==null&&Z(S,U.startTime-j)}}function T(j,U){v=!1,g&&(g=!1,y(P),P=-1),d=!0;var G=h;try{for(b(U),f=r(l);f!==null&&(!(f.expirationTime>U)||j&&!E());){var V=f.callback;if(typeof V=="function"){f.callback=null,h=f.priorityLevel;var Y=V(f.expirationTime<=U);U=e.unstable_now(),typeof Y=="function"?f.callback=Y:f===r(l)&&n(l),b(U)}else n(l);f=r(l)}if(f!==null)var K=!0;else{var ee=r(u);ee!==null&&Z(S,ee.startTime-U),K=!1}return K}finally{f=null,h=G,d=!1}}var C=!1,A=null,P=-1,I=5,k=-1;function E(){return!(e.unstable_now()-kj||125V?(j.sortIndex=G,t(u,j),r(l)===null&&j===r(u)&&(g?(y(P),P=-1):g=!0,Z(S,G-V))):(j.sortIndex=Y,t(l,j),v||d||(v=!0,$(T))),j},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(j){var U=h;return function(){var G=h;h=U;try{return j.apply(this,arguments)}finally{h=G}}}})(h7);f7.exports=h7;var Woe=f7.exports;/** + */(function(e){function t(j,U){var G=j.length;j.push(U);e:for(;0>>1,Y=j[V];if(0>>1;Vi(le,G))hei(Re,le)?(j[V]=Re,j[he]=G,V=he):(j[V]=le,j[ee]=G,V=ee);else if(hei(Re,G))j[V]=Re,j[he]=G,V=he;else break e}}return U}function i(j,U){var G=j.sortIndex-U.sortIndex;return G!==0?G:j.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,f=null,h=3,d=!1,v=!1,g=!1,m=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(j){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=j)n(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=r(u)}}function S(j){if(g=!1,b(j),!v)if(r(l)!==null)v=!0,$(T);else{var U=r(u);U!==null&&Z(S,U.startTime-j)}}function T(j,U){v=!1,g&&(g=!1,x(P),P=-1),d=!0;var G=h;try{for(b(U),f=r(l);f!==null&&(!(f.expirationTime>U)||j&&!E());){var V=f.callback;if(typeof V=="function"){f.callback=null,h=f.priorityLevel;var Y=V(f.expirationTime<=U);U=e.unstable_now(),typeof Y=="function"?f.callback=Y:f===r(l)&&n(l),b(U)}else n(l);f=r(l)}if(f!==null)var K=!0;else{var ee=r(u);ee!==null&&Z(S,ee.startTime-U),K=!1}return K}finally{f=null,h=G,d=!1}}var C=!1,A=null,P=-1,I=5,k=-1;function E(){return!(e.unstable_now()-kj||125V?(j.sortIndex=G,t(u,j),r(l)===null&&j===r(u)&&(g?(x(P),P=-1):g=!0,Z(S,G-V))):(j.sortIndex=Y,t(l,j),v||d||(v=!0,$(T))),j},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(j){var U=h;return function(){var G=h;h=U;try{return j.apply(this,arguments)}finally{h=G}}}})(y7);m7.exports=y7;var Yoe=m7.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function boe(e,t){for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_P=Object.prototype.hasOwnProperty,Uoe=/^[: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]*$/,rB={},nB={};function Zoe(e){return _P.call(nB,e)?!0:_P.call(rB,e)?!1:Uoe.test(e)?nB[e]=!0:(rB[e]=!0,!1)}function Yoe(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Xoe(e,t,r,n){if(t===null||typeof t>"u"||Yoe(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xn(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mn[e]=new Xn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mn[t]=new Xn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mn[e]=new Xn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mn[e]=new Xn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){mn[e]=new Xn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mn[e]=new Xn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mn[e]=new Xn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mn[e]=new Xn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mn[e]=new Xn(e,5,!1,e.toLowerCase(),null,!1,!1)});var aE=/[\-:]([a-z])/g;function oE(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(aE,oE);mn[t]=new Xn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(aE,oE);mn[t]=new Xn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(aE,oE);mn[t]=new Xn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mn[e]=new Xn(e,1,!1,e.toLowerCase(),null,!1,!1)});mn.xlinkHref=new Xn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mn[e]=new Xn(e,1,!1,e.toLowerCase(),null,!0,!0)});function sE(e,t,r,n){var i=mn.hasOwnProperty(t)?mn[t]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),CP=Object.prototype.hasOwnProperty,qoe=/^[: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]*$/,o3={},s3={};function Koe(e){return CP.call(s3,e)?!0:CP.call(o3,e)?!1:qoe.test(e)?s3[e]=!0:(o3[e]=!0,!1)}function Joe(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Qoe(e,t,r,n){if(t===null||typeof t>"u"||Joe(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xn(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mn[e]=new Xn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mn[t]=new Xn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mn[e]=new Xn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mn[e]=new Xn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){mn[e]=new Xn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mn[e]=new Xn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mn[e]=new Xn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mn[e]=new Xn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mn[e]=new Xn(e,5,!1,e.toLowerCase(),null,!1,!1)});var cE=/[\-:]([a-z])/g;function fE(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(cE,fE);mn[t]=new Xn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(cE,fE);mn[t]=new Xn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(cE,fE);mn[t]=new Xn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mn[e]=new Xn(e,1,!1,e.toLowerCase(),null,!1,!1)});mn.xlinkHref=new Xn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mn[e]=new Xn(e,1,!1,e.toLowerCase(),null,!0,!0)});function hE(e,t,r,n){var i=mn.hasOwnProperty(t)?mn[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{VC=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?hg(e):""}function qoe(e){switch(e.tag){case 5:return hg(e.type);case 16:return hg("Lazy");case 13:return hg("Suspense");case 19:return hg("SuspenseList");case 0:case 2:case 15:return e=GC(e.type,!1),e;case 11:return e=GC(e.type.render,!1),e;case 1:return e=GC(e.type,!0),e;default:return""}}function TP(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Oh:return"Fragment";case Ih:return"Portal";case bP:return"Profiler";case lE:return"StrictMode";case wP:return"Suspense";case SP:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case p7:return(e.displayName||"Context")+".Consumer";case v7:return(e._context.displayName||"Context")+".Provider";case uE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case cE:return t=e.displayName||null,t!==null?t:TP(e.type)||"Memo";case gl:t=e._payload,e=e._init;try{return TP(e(t))}catch{}}return null}function Koe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return TP(t);case 8:return t===lE?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function tu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function m7(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Joe(e){var t=m7(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Y0(e){e._valueTracker||(e._valueTracker=Joe(e))}function y7(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=m7(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Tb(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function CP(e,t){var r=t.checked;return ur({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function aB(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=tu(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function x7(e,t){t=t.checked,t!=null&&sE(e,"checked",t,!1)}function AP(e,t){x7(e,t);var r=tu(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?MP(e,t.type,r):t.hasOwnProperty("defaultValue")&&MP(e,t.type,tu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function oB(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function MP(e,t,r){(t!=="number"||Tb(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var dg=Array.isArray;function ed(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=X0.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function lm(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Lg={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},Qoe=["Webkit","ms","Moz","O"];Object.keys(Lg).forEach(function(e){Qoe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Lg[t]=Lg[e]})});function S7(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Lg.hasOwnProperty(e)&&Lg[e]?(""+t).trim():t+"px"}function T7(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=S7(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var ese=ur({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 LP(e,t){if(t){if(ese[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ye(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ye(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ye(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ye(62))}}function IP(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var OP=null;function fE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var EP=null,td=null,rd=null;function uB(e){if(e=Zy(e)){if(typeof EP!="function")throw Error(ye(280));var t=e.stateNode;t&&(t=dS(t),EP(e.stateNode,e.type,t))}}function C7(e){td?rd?rd.push(e):rd=[e]:td=e}function A7(){if(td){var e=td,t=rd;if(rd=td=null,uB(e),t)for(e=0;e>>=0,e===0?32:31-(fse(e)/hse|0)|0}var q0=64,K0=4194304;function vg(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pb(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=vg(s):(a&=o,a!==0&&(n=vg(a)))}else o=r&~i,o!==0?n=vg(o):a!==0&&(n=vg(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Hy(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$a(t),e[t]=r}function gse(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Og),yB=" ",xB=!1;function U7(e,t){switch(e){case"keyup":return Wse.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Eh=!1;function Use(e,t){switch(e){case"compositionend":return Z7(t);case"keypress":return t.which!==32?null:(xB=!0,yB);case"textInput":return e=t.data,e===yB&&xB?null:e;default:return null}}function Zse(e,t){if(Eh)return e==="compositionend"||!xE&&U7(e,t)?(e=W7(),H_=gE=Tl=null,Eh=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=SB(r)}}function K7(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?K7(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function J7(){for(var e=window,t=Tb();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Tb(e.document)}return t}function _E(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rle(e){var t=J7(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&K7(r.ownerDocument.documentElement,r)){if(n!==null&&_E(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=TB(r,a);var o=TB(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Dh=null,zP=null,Dg=null,$P=!1;function CB(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;$P||Dh==null||Dh!==Tb(n)||(n=Dh,"selectionStart"in n&&_E(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Dg&&vm(Dg,n)||(Dg=n,n=Ib(zP,"onSelect"),0Rh||(e.current=UP[Rh],UP[Rh]=null,Rh--)}function Zt(e,t){Rh++,UP[Rh]=e.current,e.current=t}var ru={},Dn=gu(ru),ai=gu(!1),Qc=ru;function yd(e,t){var r=e.type.contextTypes;if(!r)return ru;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function oi(e){return e=e.childContextTypes,e!=null}function Eb(){Jt(ai),Jt(Dn)}function OB(e,t,r){if(Dn.current!==ru)throw Error(ye(168));Zt(Dn,t),Zt(ai,r)}function s9(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ye(108,Koe(e)||"Unknown",i));return ur({},r,n)}function Db(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ru,Qc=Dn.current,Zt(Dn,e),Zt(ai,ai.current),!0}function EB(e,t,r){var n=e.stateNode;if(!n)throw Error(ye(169));r?(e=s9(e,t,Qc),n.__reactInternalMemoizedMergedChildContext=e,Jt(ai),Jt(Dn),Zt(Dn,e)):Jt(ai),Zt(ai,r)}var fs=null,vS=!1,nA=!1;function l9(e){fs===null?fs=[e]:fs.push(e)}function vle(e){vS=!0,l9(e)}function mu(){if(!nA&&fs!==null){nA=!0;var e=0,t=Et;try{var r=fs;for(Et=1;e>=o,i-=o,ds=1<<32-$a(t)+i|r<P?(I=A,A=null):I=A.sibling;var k=h(y,A,b[P],S);if(k===null){A===null&&(A=I);break}e&&A&&k.alternate===null&&t(y,A),_=a(k,_,P),C===null?T=k:C.sibling=k,C=k,A=I}if(P===b.length)return r(y,A),Qt&&lc(y,P),T;if(A===null){for(;PP?(I=A,A=null):I=A.sibling;var E=h(y,A,k.value,S);if(E===null){A===null&&(A=I);break}e&&A&&E.alternate===null&&t(y,A),_=a(E,_,P),C===null?T=E:C.sibling=E,C=E,A=I}if(k.done)return r(y,A),Qt&&lc(y,P),T;if(A===null){for(;!k.done;P++,k=b.next())k=f(y,k.value,S),k!==null&&(_=a(k,_,P),C===null?T=k:C.sibling=k,C=k);return Qt&&lc(y,P),T}for(A=n(y,A);!k.done;P++,k=b.next())k=d(A,y,P,k.value,S),k!==null&&(e&&k.alternate!==null&&A.delete(k.key===null?P:k.key),_=a(k,_,P),C===null?T=k:C.sibling=k,C=k);return e&&A.forEach(function(D){return t(y,D)}),Qt&&lc(y,P),T}function m(y,_,b,S){if(typeof b=="object"&&b!==null&&b.type===Oh&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Z0:e:{for(var T=b.key,C=_;C!==null;){if(C.key===T){if(T=b.type,T===Oh){if(C.tag===7){r(y,C.sibling),_=i(C,b.props.children),_.return=y,y=_;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===gl&&jB(T)===C.type){r(y,C.sibling),_=i(C,b.props),_.ref=_p(y,C,b),_.return=y,y=_;break e}r(y,C);break}else t(y,C);C=C.sibling}b.type===Oh?(_=$c(b.props.children,y.mode,S,b.key),_.return=y,y=_):(S=Q_(b.type,b.key,b.props,null,y.mode,S),S.ref=_p(y,_,b),S.return=y,y=S)}return o(y);case Ih:e:{for(C=b.key;_!==null;){if(_.key===C)if(_.tag===4&&_.stateNode.containerInfo===b.containerInfo&&_.stateNode.implementation===b.implementation){r(y,_.sibling),_=i(_,b.children||[]),_.return=y,y=_;break e}else{r(y,_);break}else t(y,_);_=_.sibling}_=fA(b,y.mode,S),_.return=y,y=_}return o(y);case gl:return C=b._init,m(y,_,C(b._payload),S)}if(dg(b))return v(y,_,b,S);if(pp(b))return g(y,_,b,S);ix(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,_!==null&&_.tag===6?(r(y,_.sibling),_=i(_,b),_.return=y,y=_):(r(y,_),_=cA(b,y.mode,S),_.return=y,y=_),o(y)):r(y,_)}return m}var _d=h9(!0),d9=h9(!1),Rb=gu(null),Bb=null,$h=null,TE=null;function CE(){TE=$h=Bb=null}function AE(e){var t=Rb.current;Jt(Rb),e._currentValue=t}function XP(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function id(e,t){Bb=e,TE=$h=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ni=!0),e.firstContext=null)}function ca(e){var t=e._currentValue;if(TE!==e)if(e={context:e,memoizedValue:t,next:null},$h===null){if(Bb===null)throw Error(ye(308));$h=e,Bb.dependencies={lanes:0,firstContext:e}}else $h=$h.next=e;return t}var Cc=null;function ME(e){Cc===null?Cc=[e]:Cc.push(e)}function v9(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,ME(t)):(r.next=i.next,i.next=r),t.interleaved=r,Ds(e,n)}function Ds(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ml=!1;function PE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function p9(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ws(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $l(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,St&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ds(e,r)}return i=n.interleaved,i===null?(t.next=t,ME(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ds(e,r)}function Z_(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,dE(e,r)}}function RB(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function zb(e,t,r,n){var i=e.updateQueue;ml=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;o=0,c=u=l=null,s=a;do{var h=s.lane,d=s.eventTime;if((n&h)===h){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,g=s;switch(h=t,d=r,g.tag){case 1:if(v=g.payload,typeof v=="function"){f=v.call(d,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(d,f,h):v,h==null)break e;f=ur({},f,h);break e;case 2:ml=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else d={eventTime:d,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=f):c=c.next=d,o|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);rf|=o,e.lanes=o,e.memoizedState=f}}function BB(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=aA.transition;aA.transition={};try{e(!1),t()}finally{Et=r,aA.transition=n}}function O9(){return fa().memoizedState}function yle(e,t,r){var n=Vl(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},E9(e))D9(t,r);else if(r=v9(e,t,r,n),r!==null){var i=Gn();Fa(r,e,n,i),N9(r,t,n)}}function xle(e,t,r){var n=Vl(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(E9(e))D9(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,Ua(s,o)){var l=t.interleaved;l===null?(i.next=i,ME(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=v9(e,t,i,n),r!==null&&(i=Gn(),Fa(r,e,n,i),N9(r,t,n))}}function E9(e){var t=e.alternate;return e===or||t!==null&&t===or}function D9(e,t){Ng=Fb=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function N9(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,dE(e,r)}}var Vb={readContext:ca,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},_le={readContext:ca,useCallback:function(e,t){return po().memoizedState=[e,t===void 0?null:t],e},useContext:ca,useEffect:$B,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,X_(4194308,4,M9.bind(null,t,e),r)},useLayoutEffect:function(e,t){return X_(4194308,4,e,t)},useInsertionEffect:function(e,t){return X_(4,2,e,t)},useMemo:function(e,t){var r=po();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=po();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=yle.bind(null,or,e),[n.memoizedState,e]},useRef:function(e){var t=po();return e={current:e},t.memoizedState=e},useState:zB,useDebugValue:jE,useDeferredValue:function(e){return po().memoizedState=e},useTransition:function(){var e=zB(!1),t=e[0];return e=mle.bind(null,e[1]),po().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=or,i=po();if(Qt){if(r===void 0)throw Error(ye(407));r=r()}else{if(r=t(),nn===null)throw Error(ye(349));tf&30||x9(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,$B(b9.bind(null,n,a,e),[e]),n.flags|=2048,wm(9,_9.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=po(),t=nn.identifierPrefix;if(Qt){var r=vs,n=ds;r=(n&~(1<<32-$a(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=_m++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{HC=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?vg(e):""}function ese(e){switch(e.tag){case 5:return vg(e.type);case 16:return vg("Lazy");case 13:return vg("Suspense");case 19:return vg("SuspenseList");case 0:case 2:case 15:return e=UC(e.type,!1),e;case 11:return e=UC(e.type.render,!1),e;case 1:return e=UC(e.type,!0),e;default:return""}}function kP(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Oh:return"Fragment";case Ih:return"Portal";case AP:return"Profiler";case dE:return"StrictMode";case MP:return"Suspense";case PP:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b7:return(e.displayName||"Context")+".Consumer";case _7:return(e._context.displayName||"Context")+".Provider";case vE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pE:return t=e.displayName||null,t!==null?t:kP(e.type)||"Memo";case yl:t=e._payload,e=e._init;try{return kP(e(t))}catch{}}return null}function tse(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return kP(t);case 8:return t===dE?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function nu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function S7(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rse(e){var t=S7(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function K0(e){e._valueTracker||(e._valueTracker=rse(e))}function T7(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=S7(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Mb(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function LP(e,t){var r=t.checked;return ur({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function u3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=nu(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function C7(e,t){t=t.checked,t!=null&&hE(e,"checked",t,!1)}function IP(e,t){C7(e,t);var r=nu(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?OP(e,t.type,r):t.hasOwnProperty("defaultValue")&&OP(e,t.type,nu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function c3(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function OP(e,t,r){(t!=="number"||Mb(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var pg=Array.isArray;function ed(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=J0.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cm(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Og={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},nse=["Webkit","ms","Moz","O"];Object.keys(Og).forEach(function(e){nse.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Og[t]=Og[e]})});function k7(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Og.hasOwnProperty(e)&&Og[e]?(""+t).trim():t+"px"}function L7(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=k7(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var ise=ur({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 NP(e,t){if(t){if(ise[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ye(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ye(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ye(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ye(62))}}function jP(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var RP=null;function gE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var BP=null,td=null,rd=null;function d3(e){if(e=Xy(e)){if(typeof BP!="function")throw Error(ye(280));var t=e.stateNode;t&&(t=gS(t),BP(e.stateNode,e.type,t))}}function I7(e){td?rd?rd.push(e):rd=[e]:td=e}function O7(){if(td){var e=td,t=rd;if(rd=td=null,d3(e),t)for(e=0;e>>=0,e===0?32:31-(pse(e)/gse|0)|0}var Q0=64,ex=4194304;function gg(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ib(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=gg(s):(a&=o,a!==0&&(n=gg(a)))}else o=r&~i,o!==0?n=gg(o):a!==0&&(n=gg(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Zy(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fa(t),e[t]=r}function _se(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Dg),w3=" ",S3=!1;function J7(e,t){switch(e){case"keyup":return Yse.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Q7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Eh=!1;function qse(e,t){switch(e){case"compositionend":return Q7(t);case"keypress":return t.which!==32?null:(S3=!0,w3);case"textInput":return e=t.data,e===w3&&S3?null:e;default:return null}}function Kse(e,t){if(Eh)return e==="compositionend"||!TE&&J7(e,t)?(e=q7(),Y_=bE=Al=null,Eh=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=M3(r)}}function n9(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?n9(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function i9(){for(var e=window,t=Mb();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Mb(e.document)}return t}function CE(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ole(e){var t=i9(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&n9(r.ownerDocument.documentElement,r)){if(n!==null&&CE(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=P3(r,a);var o=P3(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Dh=null,WP=null,jg=null,HP=!1;function k3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;HP||Dh==null||Dh!==Mb(n)||(n=Dh,"selectionStart"in n&&CE(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),jg&&gm(jg,n)||(jg=n,n=Db(WP,"onSelect"),0Rh||(e.current=KP[Rh],KP[Rh]=null,Rh--)}function Zt(e,t){Rh++,KP[Rh]=e.current,e.current=t}var iu={},Dn=gu(iu),ai=gu(!1),Qc=iu;function yd(e,t){var r=e.type.contextTypes;if(!r)return iu;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function oi(e){return e=e.childContextTypes,e!=null}function jb(){Jt(ai),Jt(Dn)}function j3(e,t,r){if(Dn.current!==iu)throw Error(ye(168));Zt(Dn,t),Zt(ai,r)}function d9(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ye(108,tse(e)||"Unknown",i));return ur({},r,n)}function Rb(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||iu,Qc=Dn.current,Zt(Dn,e),Zt(ai,ai.current),!0}function R3(e,t,r){var n=e.stateNode;if(!n)throw Error(ye(169));r?(e=d9(e,t,Qc),n.__reactInternalMemoizedMergedChildContext=e,Jt(ai),Jt(Dn),Zt(Dn,e)):Jt(ai),Zt(ai,r)}var ds=null,mS=!1,oA=!1;function v9(e){ds===null?ds=[e]:ds.push(e)}function yle(e){mS=!0,v9(e)}function mu(){if(!oA&&ds!==null){oA=!0;var e=0,t=Et;try{var r=ds;for(Et=1;e>=o,i-=o,ps=1<<32-Fa(t)+i|r<P?(I=A,A=null):I=A.sibling;var k=h(x,A,b[P],S);if(k===null){A===null&&(A=I);break}e&&A&&k.alternate===null&&t(x,A),_=a(k,_,P),C===null?T=k:C.sibling=k,C=k,A=I}if(P===b.length)return r(x,A),Qt&&lc(x,P),T;if(A===null){for(;PP?(I=A,A=null):I=A.sibling;var E=h(x,A,k.value,S);if(E===null){A===null&&(A=I);break}e&&A&&E.alternate===null&&t(x,A),_=a(E,_,P),C===null?T=E:C.sibling=E,C=E,A=I}if(k.done)return r(x,A),Qt&&lc(x,P),T;if(A===null){for(;!k.done;P++,k=b.next())k=f(x,k.value,S),k!==null&&(_=a(k,_,P),C===null?T=k:C.sibling=k,C=k);return Qt&&lc(x,P),T}for(A=n(x,A);!k.done;P++,k=b.next())k=d(A,x,P,k.value,S),k!==null&&(e&&k.alternate!==null&&A.delete(k.key===null?P:k.key),_=a(k,_,P),C===null?T=k:C.sibling=k,C=k);return e&&A.forEach(function(D){return t(x,D)}),Qt&&lc(x,P),T}function m(x,_,b,S){if(typeof b=="object"&&b!==null&&b.type===Oh&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case q0:e:{for(var T=b.key,C=_;C!==null;){if(C.key===T){if(T=b.type,T===Oh){if(C.tag===7){r(x,C.sibling),_=i(C,b.props.children),_.return=x,x=_;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===yl&&$3(T)===C.type){r(x,C.sibling),_=i(C,b.props),_.ref=wp(x,C,b),_.return=x,x=_;break e}r(x,C);break}else t(x,C);C=C.sibling}b.type===Oh?(_=$c(b.props.children,x.mode,S,b.key),_.return=x,x=_):(S=rb(b.type,b.key,b.props,null,x.mode,S),S.ref=wp(x,_,b),S.return=x,x=S)}return o(x);case Ih:e:{for(C=b.key;_!==null;){if(_.key===C)if(_.tag===4&&_.stateNode.containerInfo===b.containerInfo&&_.stateNode.implementation===b.implementation){r(x,_.sibling),_=i(_,b.children||[]),_.return=x,x=_;break e}else{r(x,_);break}else t(x,_);_=_.sibling}_=vA(b,x.mode,S),_.return=x,x=_}return o(x);case yl:return C=b._init,m(x,_,C(b._payload),S)}if(pg(b))return v(x,_,b,S);if(mp(b))return g(x,_,b,S);sx(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,_!==null&&_.tag===6?(r(x,_.sibling),_=i(_,b),_.return=x,x=_):(r(x,_),_=dA(b,x.mode,S),_.return=x,x=_),o(x)):r(x,_)}return m}var _d=y9(!0),x9=y9(!1),$b=gu(null),Fb=null,$h=null,kE=null;function LE(){kE=$h=Fb=null}function IE(e){var t=$b.current;Jt($b),e._currentValue=t}function ek(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function id(e,t){Fb=e,kE=$h=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ni=!0),e.firstContext=null)}function ca(e){var t=e._currentValue;if(kE!==e)if(e={context:e,memoizedValue:t,next:null},$h===null){if(Fb===null)throw Error(ye(308));$h=e,Fb.dependencies={lanes:0,firstContext:e}}else $h=$h.next=e;return t}var Cc=null;function OE(e){Cc===null?Cc=[e]:Cc.push(e)}function _9(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,OE(t)):(r.next=i.next,i.next=r),t.interleaved=r,js(e,n)}function js(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var xl=!1;function EE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function b9(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ts(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vl(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,St&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,js(e,r)}return i=n.interleaved,i===null?(t.next=t,OE(n)):(t.next=i.next,i.next=t),n.interleaved=t,js(e,r)}function q_(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,yE(e,r)}}function F3(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Vb(e,t,r,n){var i=e.updateQueue;xl=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;o=0,c=u=l=null,s=a;do{var h=s.lane,d=s.eventTime;if((n&h)===h){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,g=s;switch(h=t,d=r,g.tag){case 1:if(v=g.payload,typeof v=="function"){f=v.call(d,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(d,f,h):v,h==null)break e;f=ur({},f,h);break e;case 2:xl=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else d={eventTime:d,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=f):c=c.next=d,o|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);rf|=o,e.lanes=o,e.memoizedState=f}}function V3(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=lA.transition;lA.transition={};try{e(!1),t()}finally{Et=r,lA.transition=n}}function B9(){return fa().memoizedState}function wle(e,t,r){var n=Wl(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},z9(e))$9(t,r);else if(r=_9(e,t,r,n),r!==null){var i=Gn();Va(r,e,n,i),F9(r,t,n)}}function Sle(e,t,r){var n=Wl(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(z9(e))$9(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,Za(s,o)){var l=t.interleaved;l===null?(i.next=i,OE(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=_9(e,t,i,n),r!==null&&(i=Gn(),Va(r,e,n,i),F9(r,t,n))}}function z9(e){var t=e.alternate;return e===or||t!==null&&t===or}function $9(e,t){Rg=Wb=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function F9(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,yE(e,r)}}var Hb={readContext:ca,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},Tle={readContext:ca,useCallback:function(e,t){return go().memoizedState=[e,t===void 0?null:t],e},useContext:ca,useEffect:W3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,J_(4194308,4,E9.bind(null,t,e),r)},useLayoutEffect:function(e,t){return J_(4194308,4,e,t)},useInsertionEffect:function(e,t){return J_(4,2,e,t)},useMemo:function(e,t){var r=go();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=go();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=wle.bind(null,or,e),[n.memoizedState,e]},useRef:function(e){var t=go();return e={current:e},t.memoizedState=e},useState:G3,useDebugValue:FE,useDeferredValue:function(e){return go().memoizedState=e},useTransition:function(){var e=G3(!1),t=e[0];return e=ble.bind(null,e[1]),go().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=or,i=go();if(Qt){if(r===void 0)throw Error(ye(407));r=r()}else{if(r=t(),nn===null)throw Error(ye(349));tf&30||C9(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,W3(M9.bind(null,n,a,e),[e]),n.flags|=2048,Tm(9,A9.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=go(),t=nn.identifierPrefix;if(Qt){var r=gs,n=ps;r=(n&~(1<<32-Fa(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=wm++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[mo]=t,e[mm]=n,H9(e,t,!1,!1),t.stateNode=e;e:{switch(o=IP(r,n),r){case"dialog":Xt("cancel",e),Xt("close",e),i=n;break;case"iframe":case"object":case"embed":Xt("load",e),i=n;break;case"video":case"audio":for(i=0;iSd&&(t.flags|=128,n=!0,bp(a,!1),t.lanes=4194304)}else{if(!n)if(e=$b(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),bp(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Qt)return Sn(t),null}else 2*wr()-a.renderingStartTime>Sd&&r!==1073741824&&(t.flags|=128,n=!0,bp(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=wr(),t.sibling=null,r=ar.current,Zt(ar,n?r&1|2:r&1),t):(Sn(t),null);case 22:case 23:return VE(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?mi&1073741824&&(Sn(t),t.subtreeFlags&6&&(t.flags|=8192)):Sn(t),null;case 24:return null;case 25:return null}throw Error(ye(156,t.tag))}function Ple(e,t){switch(wE(t),t.tag){case 1:return oi(t.type)&&Eb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bd(),Jt(ai),Jt(Dn),IE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return LE(t),null;case 13:if(Jt(ar),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ye(340));xd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jt(ar),null;case 4:return bd(),null;case 10:return AE(t.type._context),null;case 22:case 23:return VE(),null;case 24:return null;default:return null}}var ox=!1,kn=!1,kle=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Fh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){hr(e,t,n)}else r.current=null}function ik(e,t,r){try{r()}catch(n){hr(e,t,n)}}var KB=!1;function Lle(e,t){if(FP=kb,e=J7(),_E(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,c=0,f=e,h=null;t:for(;;){for(var d;f!==r||i!==0&&f.nodeType!==3||(s=o+i),f!==a||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===e)break t;if(h===r&&++u===i&&(s=o),h===a&&++c===n&&(l=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(VP={focusedElem:e,selectionRange:r},kb=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,m=v.memoizedState,y=t.stateNode,_=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:La(t.type,g),m);y.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ye(163))}}catch(S){hr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return v=KB,KB=!1,v}function jg(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&ik(t,r,a)}i=i.next}while(i!==n)}}function mS(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ak(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Y9(e){var t=e.alternate;t!==null&&(e.alternate=null,Y9(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[mo],delete t[mm],delete t[HP],delete t[hle],delete t[dle])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function X9(e){return e.tag===5||e.tag===3||e.tag===4}function JB(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||X9(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ok(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ob));else if(n!==4&&(e=e.child,e!==null))for(ok(e,t,r),e=e.sibling;e!==null;)ok(e,t,r),e=e.sibling}function sk(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(sk(e,t,r),e=e.sibling;e!==null;)sk(e,t,r),e=e.sibling}var cn=null,Oa=!1;function rl(e,t,r){for(r=r.child;r!==null;)q9(e,t,r),r=r.sibling}function q9(e,t,r){if(ko&&typeof ko.onCommitFiberUnmount=="function")try{ko.onCommitFiberUnmount(uS,r)}catch{}switch(r.tag){case 5:kn||Fh(r,t);case 6:var n=cn,i=Oa;cn=null,rl(e,t,r),cn=n,Oa=i,cn!==null&&(Oa?(e=cn,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):cn.removeChild(r.stateNode));break;case 18:cn!==null&&(Oa?(e=cn,r=r.stateNode,e.nodeType===8?rA(e.parentNode,r):e.nodeType===1&&rA(e,r),hm(e)):rA(cn,r.stateNode));break;case 4:n=cn,i=Oa,cn=r.stateNode.containerInfo,Oa=!0,rl(e,t,r),cn=n,Oa=i;break;case 0:case 11:case 14:case 15:if(!kn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&ik(r,t,o),i=i.next}while(i!==n)}rl(e,t,r);break;case 1:if(!kn&&(Fh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){hr(r,t,s)}rl(e,t,r);break;case 21:rl(e,t,r);break;case 22:r.mode&1?(kn=(n=kn)||r.memoizedState!==null,rl(e,t,r),kn=n):rl(e,t,r);break;default:rl(e,t,r)}}function QB(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new kle),t.forEach(function(n){var i=zle.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ta(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=wr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ole(n/1960))-n,10e?16:e,Cl===null)var n=!1;else{if(e=Cl,Cl=null,Hb=0,St&6)throw Error(ye(331));var i=St;for(St|=4,Ne=e.current;Ne!==null;){var a=Ne,o=a.child;if(Ne.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lwr()-$E?zc(e,0):zE|=r),si(e,t)}function iZ(e,t){t===0&&(e.mode&1?(t=K0,K0<<=1,!(K0&130023424)&&(K0=4194304)):t=1);var r=Gn();e=Ds(e,t),e!==null&&(Hy(e,t,r),si(e,r))}function Ble(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),iZ(e,r)}function zle(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ye(314))}n!==null&&n.delete(t),iZ(e,r)}var aZ;aZ=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ai.current)ni=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ni=!1,Ale(e,t,r);ni=!!(e.flags&131072)}else ni=!1,Qt&&t.flags&1048576&&u9(t,jb,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;q_(e,t),e=t.pendingProps;var i=yd(t,Dn.current);id(t,r),i=EE(null,t,n,e,i,r);var a=DE();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,oi(n)?(a=!0,Db(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,PE(t),i.updater=gS,t.stateNode=i,i._reactInternals=t,KP(t,n,e,r),t=ek(null,t,n,!0,a,r)):(t.tag=0,Qt&&a&&bE(t),Bn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(q_(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Fle(n),e=La(n,e),i){case 0:t=QP(null,t,n,e,r);break e;case 1:t=YB(null,t,n,e,r);break e;case 11:t=UB(null,t,n,e,r);break e;case 14:t=ZB(null,t,n,La(n.type,e),r);break e}throw Error(ye(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),QP(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),YB(e,t,n,i,r);case 3:e:{if(V9(t),e===null)throw Error(ye(387));n=t.pendingProps,a=t.memoizedState,i=a.element,p9(e,t),zb(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=wd(Error(ye(423)),t),t=XB(e,t,n,r,i);break e}else if(n!==i){i=wd(Error(ye(424)),t),t=XB(e,t,n,r,i);break e}else for(Ti=zl(t.stateNode.containerInfo.firstChild),ki=t,Qt=!0,Na=null,r=d9(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(xd(),n===i){t=Ns(e,t,r);break e}Bn(e,t,n,r)}t=t.child}return t;case 5:return g9(t),e===null&&YP(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,GP(n,i)?o=null:a!==null&&GP(n,a)&&(t.flags|=32),F9(e,t),Bn(e,t,o,r),t.child;case 6:return e===null&&YP(t),null;case 13:return G9(e,t,r);case 4:return kE(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=_d(t,null,n,r):Bn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),UB(e,t,n,i,r);case 7:return Bn(e,t,t.pendingProps,r),t.child;case 8:return Bn(e,t,t.pendingProps.children,r),t.child;case 12:return Bn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Zt(Rb,n._currentValue),n._currentValue=o,a!==null)if(Ua(a.value,o)){if(a.children===i.children&&!ai.current){t=Ns(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=ws(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),XP(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ye(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),XP(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Bn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,id(t,r),i=ca(i),n=n(i),t.flags|=1,Bn(e,t,n,r),t.child;case 14:return n=t.type,i=La(n,t.pendingProps),i=La(n.type,i),ZB(e,t,n,i,r);case 15:return z9(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),q_(e,t),t.tag=1,oi(n)?(e=!0,Db(t)):e=!1,id(t,r),j9(t,n,i),KP(t,n,i,r),ek(null,t,n,!0,e,r);case 19:return W9(e,t,r);case 22:return $9(e,t,r)}throw Error(ye(156,t.tag))};function oZ(e,t){return E7(e,t)}function $le(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ra(e,t,r,n){return new $le(e,t,r,n)}function WE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fle(e){if(typeof e=="function")return WE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===uE)return 11;if(e===cE)return 14}return 2}function Gl(e,t){var r=e.alternate;return r===null?(r=ra(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Q_(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")WE(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Oh:return $c(r.children,i,a,t);case lE:o=8,i|=8;break;case bP:return e=ra(12,r,t,i|2),e.elementType=bP,e.lanes=a,e;case wP:return e=ra(13,r,t,i),e.elementType=wP,e.lanes=a,e;case SP:return e=ra(19,r,t,i),e.elementType=SP,e.lanes=a,e;case g7:return xS(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case v7:o=10;break e;case p7:o=9;break e;case uE:o=11;break e;case cE:o=14;break e;case gl:o=16,n=null;break e}throw Error(ye(130,e==null?e:typeof e,""))}return t=ra(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function $c(e,t,r,n){return e=ra(7,e,n,t),e.lanes=r,e}function xS(e,t,r,n){return e=ra(22,e,n,t),e.elementType=g7,e.lanes=r,e.stateNode={isHidden:!1},e}function cA(e,t,r){return e=ra(6,e,null,t),e.lanes=r,e}function fA(e,t,r){return t=ra(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vle(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=HC(0),this.expirationTimes=HC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=HC(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function HE(e,t,r,n,i,a,o,s,l){return e=new Vle(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ra(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},PE(a),e}function Gle(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cZ)}catch(e){console.error(e)}}cZ(),c7.exports=Oi;var fZ=c7.exports,s3=fZ;xP.createRoot=s3.createRoot,xP.hydrateRoot=s3.hydrateRoot;/** +`+a.stack}return{value:e,source:t,stack:i,digest:null}}function fA(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function nk(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Mle=typeof WeakMap=="function"?WeakMap:Map;function G9(e,t,r){r=Ts(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Zb||(Zb=!0,dk=n),nk(e,t)},r}function W9(e,t,r){r=Ts(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){nk(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){nk(e,t),typeof n!="function"&&(Gl===null?Gl=new Set([this]):Gl.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Z3(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Mle;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Fle.bind(null,e,t,r),t.then(e,e))}function Y3(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function X3(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ts(-1,1),t.tag=2,Vl(r,t,1))),r.lanes|=1),e)}var Ple=Xs.ReactCurrentOwner,ni=!1;function Bn(e,t,r,n){t.child=e===null?x9(t,null,r,n):_d(t,e.child,r,n)}function q3(e,t,r,n,i){r=r.render;var a=t.ref;return id(t,i),n=BE(e,t,r,n,a,i),r=zE(),e!==null&&!ni?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Rs(e,t,i)):(Qt&&r&&AE(t),t.flags|=1,Bn(e,t,n,i),t.child)}function K3(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!XE(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,H9(e,t,a,n,i)):(e=rb(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:gm,r(o,n)&&e.ref===t.ref)return Rs(e,t,i)}return t.flags|=1,e=Hl(a,n),e.ref=t.ref,e.return=t,t.child=e}function H9(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(gm(a,n)&&e.ref===t.ref)if(ni=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(ni=!0);else return t.lanes=e.lanes,Rs(e,t,i)}return ik(e,t,r,n,i)}function U9(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zt(Vh,mi),mi|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Zt(Vh,mi),mi|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Zt(Vh,mi),mi|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Zt(Vh,mi),mi|=n;return Bn(e,t,i,r),t.child}function Z9(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ik(e,t,r,n,i){var a=oi(r)?Qc:Dn.current;return a=yd(t,a),id(t,i),r=BE(e,t,r,n,a,i),n=zE(),e!==null&&!ni?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Rs(e,t,i)):(Qt&&n&&AE(t),t.flags|=1,Bn(e,t,r,i),t.child)}function J3(e,t,r,n,i){if(oi(r)){var a=!0;Rb(t)}else a=!1;if(id(t,i),t.stateNode===null)Q_(e,t),V9(t,r,n),rk(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=ca(u):(u=oi(r)?Qc:Dn.current,u=yd(t,u));var c=r.getDerivedStateFromProps,f=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==n||l!==u)&&U3(t,o,n,u),xl=!1;var h=t.memoizedState;o.state=h,Vb(t,n,o,i),l=t.memoizedState,s!==n||h!==l||ai.current||xl?(typeof c=="function"&&(tk(t,r,c,n),l=t.memoizedState),(s=xl||H3(t,r,s,n,h,l,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=u,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,b9(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ia(t.type,s),o.props=u,f=t.pendingProps,h=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=ca(l):(l=oi(r)?Qc:Dn.current,l=yd(t,l));var d=r.getDerivedStateFromProps;(c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==f||h!==l)&&U3(t,o,n,l),xl=!1,h=t.memoizedState,o.state=h,Vb(t,n,o,i);var v=t.memoizedState;s!==f||h!==v||ai.current||xl?(typeof d=="function"&&(tk(t,r,d,n),v=t.memoizedState),(u=xl||H3(t,r,u,n,h,v,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),o.props=n,o.state=v,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return ak(e,t,r,n,a,i)}function ak(e,t,r,n,i,a){Z9(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&R3(t,r,!1),Rs(e,t,a);n=t.stateNode,Ple.current=t;var s=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=_d(t,e.child,null,a),t.child=_d(t,null,s,a)):Bn(e,t,s,a),t.memoizedState=n.state,i&&R3(t,r,!0),t.child}function Y9(e){var t=e.stateNode;t.pendingContext?j3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&j3(e,t.context,!1),DE(e,t.containerInfo)}function Q3(e,t,r,n,i){return xd(),PE(i),t.flags|=256,Bn(e,t,r,n),t.child}var ok={dehydrated:null,treeContext:null,retryLane:0};function sk(e){return{baseLanes:e,cachePool:null,transitions:null}}function X9(e,t,r){var n=t.pendingProps,i=ar.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Zt(ar,i&1),e===null)return QP(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=wS(o,n,0,null),e=$c(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=sk(r),t.memoizedState=ok,e):VE(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return kle(e,t,o,n,s,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=Hl(i,l),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=Hl(s,a):(a=$c(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?sk(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=ok,n}return a=e.child,e=a.sibling,n=Hl(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function VE(e,t){return t=wS({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function lx(e,t,r,n){return n!==null&&PE(n),_d(t,e.child,null,r),e=VE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kle(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=fA(Error(ye(422))),lx(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=wS({mode:"visible",children:n.children},i,0,null),a=$c(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&_d(t,e.child,null,o),t.child.memoizedState=sk(o),t.memoizedState=ok,a);if(!(t.mode&1))return lx(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(ye(419)),n=fA(a,n,void 0),lx(e,t,o,n)}if(s=(o&e.childLanes)!==0,ni||s){if(n=nn,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,js(e,i),Va(n,e,i,-1))}return YE(),n=fA(Error(ye(421))),lx(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Vle.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Ti=Fl(i.nextSibling),ki=t,Qt=!0,ja=null,e!==null&&(Ki[Ji++]=ps,Ki[Ji++]=gs,Ki[Ji++]=ef,ps=e.id,gs=e.overflow,ef=t),t=VE(t,n.children),t.flags|=4096,t)}function eB(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ek(e.return,t,r)}function hA(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function q9(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Bn(e,t,n.children,r),n=ar.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&eB(e,r,t);else if(e.tag===19)eB(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Zt(ar,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Gb(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),hA(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Gb(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}hA(t,!0,r,null,a);break;case"together":hA(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Q_(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Rs(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),rf|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ye(153));if(t.child!==null){for(e=t.child,r=Hl(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Hl(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Lle(e,t,r){switch(t.tag){case 3:Y9(t),xd();break;case 5:w9(t);break;case 1:oi(t.type)&&Rb(t);break;case 4:DE(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Zt($b,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Zt(ar,ar.current&1),t.flags|=128,null):r&t.child.childLanes?X9(e,t,r):(Zt(ar,ar.current&1),e=Rs(e,t,r),e!==null?e.sibling:null);Zt(ar,ar.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return q9(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Zt(ar,ar.current),n)break;return null;case 22:case 23:return t.lanes=0,U9(e,t,r)}return Rs(e,t,r)}var K9,lk,J9,Q9;K9=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};lk=function(){};J9=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Ac(Io.current);var a=null;switch(r){case"input":i=LP(e,i),n=LP(e,n),a=[];break;case"select":i=ur({},i,{value:void 0}),n=ur({},n,{value:void 0}),a=[];break;case"textarea":i=EP(e,i),n=EP(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Nb)}NP(r,n);var o;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(o in s)s.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(um.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var l=n[u];if(s=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(a||(a=[]),a.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(um.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Xt("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Q9=function(e,t,r,n){r!==n&&(t.flags|=4)};function Sp(e,t){if(!Qt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Sn(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Ile(e,t,r){var n=t.pendingProps;switch(ME(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sn(t),null;case 1:return oi(t.type)&&jb(),Sn(t),null;case 3:return n=t.stateNode,bd(),Jt(ai),Jt(Dn),jE(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ox(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ja!==null&&(gk(ja),ja=null))),lk(e,t),Sn(t),null;case 5:NE(t);var i=Ac(bm.current);if(r=t.type,e!==null&&t.stateNode!=null)J9(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ye(166));return Sn(t),null}if(e=Ac(Io.current),ox(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[yo]=t,n[xm]=a,e=(t.mode&1)!==0,r){case"dialog":Xt("cancel",n),Xt("close",n);break;case"iframe":case"object":case"embed":Xt("load",n);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[yo]=t,e[xm]=n,K9(e,t,!1,!1),t.stateNode=e;e:{switch(o=jP(r,n),r){case"dialog":Xt("cancel",e),Xt("close",e),i=n;break;case"iframe":case"object":case"embed":Xt("load",e),i=n;break;case"video":case"audio":for(i=0;iSd&&(t.flags|=128,n=!0,Sp(a,!1),t.lanes=4194304)}else{if(!n)if(e=Gb(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Sp(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Qt)return Sn(t),null}else 2*wr()-a.renderingStartTime>Sd&&r!==1073741824&&(t.flags|=128,n=!0,Sp(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=wr(),t.sibling=null,r=ar.current,Zt(ar,n?r&1|2:r&1),t):(Sn(t),null);case 22:case 23:return ZE(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?mi&1073741824&&(Sn(t),t.subtreeFlags&6&&(t.flags|=8192)):Sn(t),null;case 24:return null;case 25:return null}throw Error(ye(156,t.tag))}function Ole(e,t){switch(ME(t),t.tag){case 1:return oi(t.type)&&jb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bd(),Jt(ai),Jt(Dn),jE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return NE(t),null;case 13:if(Jt(ar),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ye(340));xd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jt(ar),null;case 4:return bd(),null;case 10:return IE(t.type._context),null;case 22:case 23:return ZE(),null;case 24:return null;default:return null}}var ux=!1,kn=!1,Ele=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Fh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){hr(e,t,n)}else r.current=null}function uk(e,t,r){try{r()}catch(n){hr(e,t,n)}}var tB=!1;function Dle(e,t){if(UP=Ob,e=i9(),CE(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,c=0,f=e,h=null;t:for(;;){for(var d;f!==r||i!==0&&f.nodeType!==3||(s=o+i),f!==a||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===e)break t;if(h===r&&++u===i&&(s=o),h===a&&++c===n&&(l=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ZP={focusedElem:e,selectionRange:r},Ob=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,m=v.memoizedState,x=t.stateNode,_=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ia(t.type,g),m);x.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ye(163))}}catch(S){hr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return v=tB,tB=!1,v}function Bg(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&uk(t,r,a)}i=i.next}while(i!==n)}}function _S(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ck(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function eZ(e){var t=e.alternate;t!==null&&(e.alternate=null,eZ(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yo],delete t[xm],delete t[qP],delete t[gle],delete t[mle])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function tZ(e){return e.tag===5||e.tag===3||e.tag===4}function rB(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tZ(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fk(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Nb));else if(n!==4&&(e=e.child,e!==null))for(fk(e,t,r),e=e.sibling;e!==null;)fk(e,t,r),e=e.sibling}function hk(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(hk(e,t,r),e=e.sibling;e!==null;)hk(e,t,r),e=e.sibling}var cn=null,Ea=!1;function il(e,t,r){for(r=r.child;r!==null;)rZ(e,t,r),r=r.sibling}function rZ(e,t,r){if(Lo&&typeof Lo.onCommitFiberUnmount=="function")try{Lo.onCommitFiberUnmount(hS,r)}catch{}switch(r.tag){case 5:kn||Fh(r,t);case 6:var n=cn,i=Ea;cn=null,il(e,t,r),cn=n,Ea=i,cn!==null&&(Ea?(e=cn,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):cn.removeChild(r.stateNode));break;case 18:cn!==null&&(Ea?(e=cn,r=r.stateNode,e.nodeType===8?aA(e.parentNode,r):e.nodeType===1&&aA(e,r),vm(e)):aA(cn,r.stateNode));break;case 4:n=cn,i=Ea,cn=r.stateNode.containerInfo,Ea=!0,il(e,t,r),cn=n,Ea=i;break;case 0:case 11:case 14:case 15:if(!kn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&uk(r,t,o),i=i.next}while(i!==n)}il(e,t,r);break;case 1:if(!kn&&(Fh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){hr(r,t,s)}il(e,t,r);break;case 21:il(e,t,r);break;case 22:r.mode&1?(kn=(n=kn)||r.memoizedState!==null,il(e,t,r),kn=n):il(e,t,r);break;default:il(e,t,r)}}function nB(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Ele),t.forEach(function(n){var i=Gle.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ta(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=wr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*jle(n/1960))-n,10e?16:e,Ml===null)var n=!1;else{if(e=Ml,Ml=null,Yb=0,St&6)throw Error(ye(331));var i=St;for(St|=4,Ne=e.current;Ne!==null;){var a=Ne,o=a.child;if(Ne.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lwr()-HE?zc(e,0):WE|=r),si(e,t)}function cZ(e,t){t===0&&(e.mode&1?(t=ex,ex<<=1,!(ex&130023424)&&(ex=4194304)):t=1);var r=Gn();e=js(e,t),e!==null&&(Zy(e,t,r),si(e,r))}function Vle(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),cZ(e,r)}function Gle(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ye(314))}n!==null&&n.delete(t),cZ(e,r)}var fZ;fZ=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ai.current)ni=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ni=!1,Lle(e,t,r);ni=!!(e.flags&131072)}else ni=!1,Qt&&t.flags&1048576&&p9(t,zb,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Q_(e,t),e=t.pendingProps;var i=yd(t,Dn.current);id(t,r),i=BE(null,t,n,e,i,r);var a=zE();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,oi(n)?(a=!0,Rb(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,EE(t),i.updater=xS,t.stateNode=i,i._reactInternals=t,rk(t,n,e,r),t=ak(null,t,n,!0,a,r)):(t.tag=0,Qt&&a&&AE(t),Bn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Q_(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Hle(n),e=Ia(n,e),i){case 0:t=ik(null,t,n,e,r);break e;case 1:t=J3(null,t,n,e,r);break e;case 11:t=q3(null,t,n,e,r);break e;case 14:t=K3(null,t,n,Ia(n.type,e),r);break e}throw Error(ye(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ia(n,i),ik(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ia(n,i),J3(e,t,n,i,r);case 3:e:{if(Y9(t),e===null)throw Error(ye(387));n=t.pendingProps,a=t.memoizedState,i=a.element,b9(e,t),Vb(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=wd(Error(ye(423)),t),t=Q3(e,t,n,r,i);break e}else if(n!==i){i=wd(Error(ye(424)),t),t=Q3(e,t,n,r,i);break e}else for(Ti=Fl(t.stateNode.containerInfo.firstChild),ki=t,Qt=!0,ja=null,r=x9(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(xd(),n===i){t=Rs(e,t,r);break e}Bn(e,t,n,r)}t=t.child}return t;case 5:return w9(t),e===null&&QP(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,YP(n,i)?o=null:a!==null&&YP(n,a)&&(t.flags|=32),Z9(e,t),Bn(e,t,o,r),t.child;case 6:return e===null&&QP(t),null;case 13:return X9(e,t,r);case 4:return DE(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=_d(t,null,n,r):Bn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ia(n,i),q3(e,t,n,i,r);case 7:return Bn(e,t,t.pendingProps,r),t.child;case 8:return Bn(e,t,t.pendingProps.children,r),t.child;case 12:return Bn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Zt($b,n._currentValue),n._currentValue=o,a!==null)if(Za(a.value,o)){if(a.children===i.children&&!ai.current){t=Rs(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Ts(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),ek(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ye(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),ek(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Bn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,id(t,r),i=ca(i),n=n(i),t.flags|=1,Bn(e,t,n,r),t.child;case 14:return n=t.type,i=Ia(n,t.pendingProps),i=Ia(n.type,i),K3(e,t,n,i,r);case 15:return H9(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ia(n,i),Q_(e,t),t.tag=1,oi(n)?(e=!0,Rb(t)):e=!1,id(t,r),V9(t,n,i),rk(t,n,i,r),ak(null,t,n,!0,e,r);case 19:return q9(e,t,r);case 22:return U9(e,t,r)}throw Error(ye(156,t.tag))};function hZ(e,t){return z7(e,t)}function Wle(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ra(e,t,r,n){return new Wle(e,t,r,n)}function XE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hle(e){if(typeof e=="function")return XE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vE)return 11;if(e===pE)return 14}return 2}function Hl(e,t){var r=e.alternate;return r===null?(r=ra(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function rb(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")XE(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Oh:return $c(r.children,i,a,t);case dE:o=8,i|=8;break;case AP:return e=ra(12,r,t,i|2),e.elementType=AP,e.lanes=a,e;case MP:return e=ra(13,r,t,i),e.elementType=MP,e.lanes=a,e;case PP:return e=ra(19,r,t,i),e.elementType=PP,e.lanes=a,e;case w7:return wS(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _7:o=10;break e;case b7:o=9;break e;case vE:o=11;break e;case pE:o=14;break e;case yl:o=16,n=null;break e}throw Error(ye(130,e==null?e:typeof e,""))}return t=ra(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function $c(e,t,r,n){return e=ra(7,e,n,t),e.lanes=r,e}function wS(e,t,r,n){return e=ra(22,e,n,t),e.elementType=w7,e.lanes=r,e.stateNode={isHidden:!1},e}function dA(e,t,r){return e=ra(6,e,null,t),e.lanes=r,e}function vA(e,t,r){return t=ra(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ule(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=YC(0),this.expirationTimes=YC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=YC(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function qE(e,t,r,n,i,a,o,s,l){return e=new Ule(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ra(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},EE(a),e}function Zle(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gZ)}catch(e){console.error(e)}}gZ(),g7.exports=Oi;var mZ=g7.exports,fB=mZ;TP.createRoot=fB.createRoot,TP.hydrateRoot=fB.hydrateRoot;/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Tm(){return Tm=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function XE(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Xle(){return Math.random().toString(36).substr(2,8)}function u3(e,t){return{usr:e.state,key:e.key,idx:t}}function hk(e,t,r,n){return r===void 0&&(r=null),Tm({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gv(t):t,{state:r,key:t&&t.key||n||Xle()})}function Yb(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function gv(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function qle(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Al.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(Tm({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function f(){s=Al.Pop;let m=c(),y=m==null?null:m-u;u=m,l&&l({action:s,location:g.location,delta:y})}function h(m,y){s=Al.Push;let _=hk(g.location,m,y);u=c()+1;let b=u3(_,u),S=g.createHref(_);try{o.pushState(b,"",S)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(S)}a&&l&&l({action:s,location:g.location,delta:1})}function d(m,y){s=Al.Replace;let _=hk(g.location,m,y);u=c();let b=u3(_,u),S=g.createHref(_);o.replaceState(b,"",S),a&&l&&l({action:s,location:g.location,delta:0})}function v(m){let y=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof m=="string"?m:Yb(m);return _=_.replace(/ $/,"%20"),Or(y,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,y)}let g={get action(){return s},get location(){return e(i,o)},listen(m){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(l3,f),l=m,()=>{i.removeEventListener(l3,f),l=null}},createHref(m){return t(i,m)},createURL:v,encodeLocation(m){let y=v(m);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:d,go(m){return o.go(m)}};return g}var c3;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(c3||(c3={}));function Kle(e,t,r){return r===void 0&&(r="/"),Jle(e,t,r)}function Jle(e,t,r,n){let i=typeof t=="string"?gv(t):t,a=qE(i.pathname||"/",r);if(a==null)return null;let o=hZ(e);Qle(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(Or(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Wl([n,l.relativePath]),c=r.concat(l);a.children&&a.children.length>0&&(Or(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),hZ(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:oue(u,a.index),routesMeta:c})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of dZ(a.path))i(a,o,l)}),t}function dZ(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=dZ(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Qle(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:sue(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const eue=/^:[\w-]+$/,tue=3,rue=2,nue=1,iue=10,aue=-2,f3=e=>e==="*";function oue(e,t){let r=e.split("/"),n=r.length;return r.some(f3)&&(n+=aue),t&&(n+=rue),r.filter(i=>!f3(i)).reduce((i,a)=>i+(eue.test(a)?tue:a===""?nue:iue),n)}function sue(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function lue(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:h,isOptional:d}=c;if(h==="*"){let g=s[f]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const v=s[f];return d&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function cue(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),XE(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function fue(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return XE(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function qE(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const hue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,due=e=>hue.test(e);function vue(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?gv(e):e,a;if(r)if(due(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),XE(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=h3(r.substring(1),"/"):a=h3(r,t)}else a=t;return{pathname:a,search:mue(n),hash:yue(i)}}function h3(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function hA(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function pue(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function vZ(e,t){let r=pue(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function pZ(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=gv(e):(i=Tm({},e),Or(!i.pathname||!i.pathname.includes("?"),hA("?","pathname","search",i)),Or(!i.pathname||!i.pathname.includes("#"),hA("#","pathname","hash",i)),Or(!i.search||!i.search.includes("#"),hA("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?t[f]:"/"}let l=vue(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Wl=e=>e.join("/").replace(/\/\/+/g,"/"),gue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),mue=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yue=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function xue(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gZ=["post","put","patch","delete"];new Set(gZ);const _ue=["get",...gZ];new Set(_ue);/** + */function Am(){return Am=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function eD(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Qle(){return Math.random().toString(36).substr(2,8)}function dB(e,t){return{usr:e.state,key:e.key,idx:t}}function mk(e,t,r,n){return r===void 0&&(r=null),Am({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gv(t):t,{state:r,key:t&&t.key||n||Qle()})}function Kb(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function gv(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function eue(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Pl.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(Am({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function f(){s=Pl.Pop;let m=c(),x=m==null?null:m-u;u=m,l&&l({action:s,location:g.location,delta:x})}function h(m,x){s=Pl.Push;let _=mk(g.location,m,x);u=c()+1;let b=dB(_,u),S=g.createHref(_);try{o.pushState(b,"",S)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(S)}a&&l&&l({action:s,location:g.location,delta:1})}function d(m,x){s=Pl.Replace;let _=mk(g.location,m,x);u=c();let b=dB(_,u),S=g.createHref(_);o.replaceState(b,"",S),a&&l&&l({action:s,location:g.location,delta:0})}function v(m){let x=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof m=="string"?m:Kb(m);return _=_.replace(/ $/,"%20"),Or(x,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,x)}let g={get action(){return s},get location(){return e(i,o)},listen(m){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(hB,f),l=m,()=>{i.removeEventListener(hB,f),l=null}},createHref(m){return t(i,m)},createURL:v,encodeLocation(m){let x=v(m);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:d,go(m){return o.go(m)}};return g}var vB;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(vB||(vB={}));function tue(e,t,r){return r===void 0&&(r="/"),rue(e,t,r)}function rue(e,t,r,n){let i=typeof t=="string"?gv(t):t,a=tD(i.pathname||"/",r);if(a==null)return null;let o=yZ(e);nue(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(Or(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Ul([n,l.relativePath]),c=r.concat(l);a.children&&a.children.length>0&&(Or(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),yZ(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:cue(u,a.index),routesMeta:c})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of xZ(a.path))i(a,o,l)}),t}function xZ(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=xZ(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function nue(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:fue(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const iue=/^:[\w-]+$/,aue=3,oue=2,sue=1,lue=10,uue=-2,pB=e=>e==="*";function cue(e,t){let r=e.split("/"),n=r.length;return r.some(pB)&&(n+=uue),t&&(n+=oue),r.filter(i=>!pB(i)).reduce((i,a)=>i+(iue.test(a)?aue:a===""?sue:lue),n)}function fue(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function hue(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:h,isOptional:d}=c;if(h==="*"){let g=s[f]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const v=s[f];return d&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function vue(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),eD(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function pue(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return eD(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function tD(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const gue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mue=e=>gue.test(e);function yue(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?gv(e):e,a;if(r)if(mue(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),eD(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=gB(r.substring(1),"/"):a=gB(r,t)}else a=t;return{pathname:a,search:bue(n),hash:wue(i)}}function gB(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function pA(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function xue(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _Z(e,t){let r=xue(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function bZ(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=gv(e):(i=Am({},e),Or(!i.pathname||!i.pathname.includes("?"),pA("?","pathname","search",i)),Or(!i.pathname||!i.pathname.includes("#"),pA("#","pathname","hash",i)),Or(!i.search||!i.search.includes("#"),pA("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?t[f]:"/"}let l=yue(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Ul=e=>e.join("/").replace(/\/\/+/g,"/"),_ue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bue=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wue=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Sue(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const wZ=["post","put","patch","delete"];new Set(wZ);const Tue=["get",...wZ];new Set(Tue);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Cm(){return Cm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),W.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let f=pZ(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Wl([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,a,e])}function _Z(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=W.useContext(wf),{matches:i}=W.useContext(Sf),{pathname:a}=mv(),o=JSON.stringify(vZ(i,n.v7_relativeSplatPath));return W.useMemo(()=>pZ(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function Tue(e,t){return Cue(e,t)}function Cue(e,t,r,n){Xy()||Or(!1);let{navigator:i}=W.useContext(wf),{matches:a}=W.useContext(Sf),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=mv(),c;if(t){var f;let m=typeof t=="string"?gv(t):t;l==="/"||(f=m.pathname)!=null&&f.startsWith(l)||Or(!1),c=m}else c=u;let h=c.pathname||"/",d=h;if(l!=="/"){let m=l.replace(/^\//,"").split("/");d="/"+h.replace(/^\//,"").split("/").slice(m.length).join("/")}let v=Kle(e,{pathname:d}),g=Lue(v&&v.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:Wl([l,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:Wl([l,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),a,r,n);return t&&g?W.createElement(TS.Provider,{value:{location:Cm({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Al.Pop}},g):g}function Aue(){let e=Due(),t=xue(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return W.createElement(W.Fragment,null,W.createElement("h2",null,"Unexpected Application Error!"),W.createElement("h3",{style:{fontStyle:"italic"}},t),r?W.createElement("pre",{style:i},r):null,null)}const Mue=W.createElement(Aue,null);class Pue extends W.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?W.createElement(Sf.Provider,{value:this.props.routeContext},W.createElement(mZ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function kue(e){let{routeContext:t,match:r,children:n}=e,i=W.useContext(KE);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),W.createElement(Sf.Provider,{value:t},n)}function Lue(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let c=o.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);c>=0||Or(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,f,h)=>{let d,v=!1,g=null,m=null;r&&(d=s&&f.route.id?s[f.route.id]:void 0,g=f.route.errorElement||Mue,l&&(u<0&&h===0?(jue("route-fallback"),v=!0,m=null):u===h&&(v=!0,m=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),_=()=>{let b;return d?b=g:v?b=m:f.route.Component?b=W.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=c,W.createElement(kue,{match:f,routeContext:{outlet:c,matches:y,isDataRoute:r!=null},children:b})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?W.createElement(Pue,{location:r.location,revalidation:r.revalidation,component:g,error:d,children:_(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):_()},null)}var bZ=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(bZ||{}),wZ=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wZ||{});function Iue(e){let t=W.useContext(KE);return t||Or(!1),t}function Oue(e){let t=W.useContext(bue);return t||Or(!1),t}function Eue(e){let t=W.useContext(Sf);return t||Or(!1),t}function SZ(e){let t=Eue(),r=t.matches[t.matches.length-1];return r.route.id||Or(!1),r.route.id}function Due(){var e;let t=W.useContext(mZ),r=Oue(),n=SZ();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Nue(){let{router:e}=Iue(bZ.UseNavigateStable),t=SZ(wZ.UseNavigateStable),r=W.useRef(!1);return yZ(()=>{r.current=!0}),W.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Cm({fromRouteId:t},a)))},[e,t])}const d3={};function jue(e,t,r){d3[e]||(d3[e]=!0)}function Rue(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function os(e){Or(!1)}function Bue(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Al.Pop,navigator:a,static:o=!1,future:s}=e;Xy()&&Or(!1);let l=t.replace(/^\/*/,"/"),u=W.useMemo(()=>({basename:l,navigator:a,static:o,future:Cm({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=gv(n));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:v="default"}=n,g=W.useMemo(()=>{let m=qE(c,l);return m==null?null:{location:{pathname:m,search:f,hash:h,state:d,key:v},navigationType:i}},[l,c,f,h,d,v,i]);return g==null?null:W.createElement(wf.Provider,{value:u},W.createElement(TS.Provider,{children:r,value:g}))}function zue(e){let{children:t,location:r}=e;return Tue(dk(t),r)}new Promise(()=>{});function dk(e,t){t===void 0&&(t=[]);let r=[];return W.Children.forEach(e,(n,i)=>{if(!W.isValidElement(n))return;let a=[...t,i];if(n.type===W.Fragment){r.push.apply(r,dk(n.props.children,a));return}n.type!==os&&Or(!1),!n.props.index||!n.props.children||Or(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=dk(n.props.children,a)),r.push(o)}),r}/** + */function Mm(){return Mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),W.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let f=bZ(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ul([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,a,e])}function AZ(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=W.useContext(wf),{matches:i}=W.useContext(Sf),{pathname:a}=mv(),o=JSON.stringify(_Z(i,n.v7_relativeSplatPath));return W.useMemo(()=>bZ(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function Pue(e,t){return kue(e,t)}function kue(e,t,r,n){Ky()||Or(!1);let{navigator:i}=W.useContext(wf),{matches:a}=W.useContext(Sf),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=mv(),c;if(t){var f;let m=typeof t=="string"?gv(t):t;l==="/"||(f=m.pathname)!=null&&f.startsWith(l)||Or(!1),c=m}else c=u;let h=c.pathname||"/",d=h;if(l!=="/"){let m=l.replace(/^\//,"").split("/");d="/"+h.replace(/^\//,"").split("/").slice(m.length).join("/")}let v=tue(e,{pathname:d}),g=Due(v&&v.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:Ul([l,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:Ul([l,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),a,r,n);return t&&g?W.createElement(MS.Provider,{value:{location:Mm({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Pl.Pop}},g):g}function Lue(){let e=Bue(),t=Sue(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return W.createElement(W.Fragment,null,W.createElement("h2",null,"Unexpected Application Error!"),W.createElement("h3",{style:{fontStyle:"italic"}},t),r?W.createElement("pre",{style:i},r):null,null)}const Iue=W.createElement(Lue,null);class Oue extends W.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?W.createElement(Sf.Provider,{value:this.props.routeContext},W.createElement(SZ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Eue(e){let{routeContext:t,match:r,children:n}=e,i=W.useContext(rD);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),W.createElement(Sf.Provider,{value:t},n)}function Due(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let c=o.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);c>=0||Or(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,f,h)=>{let d,v=!1,g=null,m=null;r&&(d=s&&f.route.id?s[f.route.id]:void 0,g=f.route.errorElement||Iue,l&&(u<0&&h===0?($ue("route-fallback"),v=!0,m=null):u===h&&(v=!0,m=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,h+1)),_=()=>{let b;return d?b=g:v?b=m:f.route.Component?b=W.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=c,W.createElement(Eue,{match:f,routeContext:{outlet:c,matches:x,isDataRoute:r!=null},children:b})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?W.createElement(Oue,{location:r.location,revalidation:r.revalidation,component:g,error:d,children:_(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):_()},null)}var MZ=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(MZ||{}),PZ=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(PZ||{});function Nue(e){let t=W.useContext(rD);return t||Or(!1),t}function jue(e){let t=W.useContext(Cue);return t||Or(!1),t}function Rue(e){let t=W.useContext(Sf);return t||Or(!1),t}function kZ(e){let t=Rue(),r=t.matches[t.matches.length-1];return r.route.id||Or(!1),r.route.id}function Bue(){var e;let t=W.useContext(SZ),r=jue(),n=kZ();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function zue(){let{router:e}=Nue(MZ.UseNavigateStable),t=kZ(PZ.UseNavigateStable),r=W.useRef(!1);return TZ(()=>{r.current=!0}),W.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Mm({fromRouteId:t},a)))},[e,t])}const mB={};function $ue(e,t,r){mB[e]||(mB[e]=!0)}function Fue(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ma(e){Or(!1)}function Vue(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Pl.Pop,navigator:a,static:o=!1,future:s}=e;Ky()&&Or(!1);let l=t.replace(/^\/*/,"/"),u=W.useMemo(()=>({basename:l,navigator:a,static:o,future:Mm({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=gv(n));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:v="default"}=n,g=W.useMemo(()=>{let m=tD(c,l);return m==null?null:{location:{pathname:m,search:f,hash:h,state:d,key:v},navigationType:i}},[l,c,f,h,d,v,i]);return g==null?null:W.createElement(wf.Provider,{value:u},W.createElement(MS.Provider,{children:r,value:g}))}function Gue(e){let{children:t,location:r}=e;return Pue(yk(t),r)}new Promise(()=>{});function yk(e,t){t===void 0&&(t=[]);let r=[];return W.Children.forEach(e,(n,i)=>{if(!W.isValidElement(n))return;let a=[...t,i];if(n.type===W.Fragment){r.push.apply(r,yk(n.props.children,a));return}n.type!==Ma&&Or(!1),!n.props.index||!n.props.children||Or(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=yk(n.props.children,a)),r.push(o)}),r}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. @@ -64,27 +64,27 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function vk(){return vk=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Fue(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Vue(e,t){return e.button===0&&(!t||t==="_self")&&!Fue(e)}const Gue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Wue="6";try{window.__reactRouterVersion=Wue}catch{}const Hue="startTransition",v3=Roe[Hue];function Uue(e){let{basename:t,children:r,future:n,window:i}=e,a=W.useRef();a.current==null&&(a.current=Yle({window:i,v5Compat:!0}));let o=a.current,[s,l]=W.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=W.useCallback(f=>{u&&v3?v3(()=>l(f)):l(f)},[l,u]);return W.useLayoutEffect(()=>o.listen(c),[o,c]),W.useEffect(()=>Rue(n),[n]),W.createElement(Bue,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const Zue=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xue=W.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:c,viewTransition:f}=t,h=$ue(t,Gue),{basename:d}=W.useContext(wf),v,g=!1;if(typeof u=="string"&&Yue.test(u)&&(v=u,Zue))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),T=qE(S.pathname,d);S.origin===b.origin&&T!=null?u=T+S.search+S.hash:g=!0}catch{}let m=wue(u,{relative:i}),y=que(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:f});function _(b){n&&n(b),b.defaultPrevented||y(b)}return W.createElement("a",vk({},h,{href:v||m,onClick:g||a?n:_,ref:r,target:l}))});var p3;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(p3||(p3={}));var g3;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(g3||(g3={}));function que(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=xZ(),u=mv(),c=_Z(e,{relative:o});return W.useCallback(f=>{if(Vue(f,r)){f.preventDefault();let h=n!==void 0?n:Yb(u)===Yb(c);l(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,c,n,i,r,e,a,o,s])}/** + */function xk(){return xk=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Hue(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Uue(e,t){return e.button===0&&(!t||t==="_self")&&!Hue(e)}const Zue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yue="6";try{window.__reactRouterVersion=Yue}catch{}const Xue="startTransition",yB=Foe[Xue];function que(e){let{basename:t,children:r,future:n,window:i}=e,a=W.useRef();a.current==null&&(a.current=Jle({window:i,v5Compat:!0}));let o=a.current,[s,l]=W.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=W.useCallback(f=>{u&&yB?yB(()=>l(f)):l(f)},[l,u]);return W.useLayoutEffect(()=>o.listen(c),[o,c]),W.useEffect(()=>Fue(n),[n]),W.createElement(Vue,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const Kue=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Jue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Que=W.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:c,viewTransition:f}=t,h=Wue(t,Zue),{basename:d}=W.useContext(wf),v,g=!1;if(typeof u=="string"&&Jue.test(u)&&(v=u,Kue))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),T=tD(S.pathname,d);S.origin===b.origin&&T!=null?u=T+S.search+S.hash:g=!0}catch{}let m=Aue(u,{relative:i}),x=ece(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:f});function _(b){n&&n(b),b.defaultPrevented||x(b)}return W.createElement("a",xk({},h,{href:v||m,onClick:g||a?n:_,ref:r,target:l}))});var xB;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(xB||(xB={}));var _B;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_B||(_B={}));function ece(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=CZ(),u=mv(),c=AZ(e,{relative:o});return W.useCallback(f=>{if(Uue(f,r)){f.preventDefault();let h=n!==void 0?n:Kb(u)===Kb(c);l(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,c,n,i,r,e,a,o,s])}/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kue=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),TZ=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** + */const tce=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LZ=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var Jue={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var rce={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Que=W.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>W.createElement("svg",{ref:l,...Jue,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:TZ("lucide",i),...s},[...o.map(([u,c])=>W.createElement(u,c)),...Array.isArray(a)?a:[a]]));/** + */const nce=W.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>W.createElement("svg",{ref:l,...rce,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:LZ("lucide",i),...s},[...o.map(([u,c])=>W.createElement(u,c)),...Array.isArray(a)?a:[a]]));/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ze=(e,t)=>{const r=W.forwardRef(({className:n,...i},a)=>W.createElement(Que,{ref:a,iconNode:t,className:TZ(`lucide-${Kue(e)}`,n),...i}));return r.displayName=`${e}`,r};/** + */const ze=(e,t)=>{const r=W.forwardRef(({className:n,...i},a)=>W.createElement(nce,{ref:a,iconNode:t,className:LZ(`lucide-${tce(e)}`,n),...i}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -94,47 +94,47 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dA=ze("Battery",[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/** + */const gA=ze("Battery",[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ece=ze("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/** + */const ice=ze("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Am=ze("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** + */const Pm=ze("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CZ=ze("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + */const IZ=ze("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tce=ze("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const ace=ze("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rce=ze("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + */const oce=ze("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nce=ze("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + */const sce=ze("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CS=ze("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** + */const PS=ze("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nu=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Bo=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -144,27 +144,27 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ice=ze("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const lce=ze("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iu=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const au=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ace=ze("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + */const uce=ze("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const au=ze("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const ou=ze("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JE=ze("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + */const nD=ze("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -174,42 +174,42 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oce=ze("CloudLightning",[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]]);/** + */const cce=ze("CloudLightning",[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ou=ze("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** + */const su=ze("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sce=ze("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + */const fce=ze("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AZ=ze("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** + */const OZ=ze("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lce=ze("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const hce=ze("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MZ=ze("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const EZ=ze("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uce=ze("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const dce=ze("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PZ=ze("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** + */const kS=ze("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -219,182 +219,182 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kZ=ze("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** + */const DZ=ze("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QE=ze("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const iD=ze("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eD=ze("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + */const aD=ze("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AS=ze("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** + */const LS=ze("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cce=ze("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const vce=ze("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MS=ze("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const IS=ze("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LZ=ze("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + */const NZ=ze("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IZ=ze("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** + */const jZ=ze("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OZ=ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const OS=ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fce=ze("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** + */const pce=ze("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PS=ze("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** + */const xv=ze("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hce=ze("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** + */const gce=ze("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EZ=ze("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + */const RZ=ze("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dce=ze("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const mce=ze("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kS=ze("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/** + */const ES=ze("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vce=ze("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + */const yce=ze("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LS=ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const _v=ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Za=ze("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/** + */const Ya=ze("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mm=ze("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const km=ze("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IS=ze("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + */const DS=ze("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OS=ze("Satellite",[["path",{d:"M13 7 9 3 5 7l4 4",key:"vyckw6"}],["path",{d:"m17 11 4 4-4 4-4-4",key:"rchckc"}],["path",{d:"m8 12 4 4 6-6-4-4Z",key:"1sshf7"}],["path",{d:"m16 8 3-3",key:"x428zp"}],["path",{d:"M9 21a6 6 0 0 0-6-6",key:"1iajcf"}]]);/** + */const NS=ze("Satellite",[["path",{d:"M13 7 9 3 5 7l4 4",key:"vyckw6"}],["path",{d:"m17 11 4 4-4 4-4-4",key:"rchckc"}],["path",{d:"m8 12 4 4 6-6-4-4Z",key:"1sshf7"}],["path",{d:"m16 8 3-3",key:"x428zp"}],["path",{d:"M9 21a6 6 0 0 0-6-6",key:"1iajcf"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tD=ze("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + */const oD=ze("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rD=ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const sD=ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const m3=ze("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + */const bB=ze("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DZ=ze("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const BZ=ze("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NZ=ze("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** + */const zZ=ze("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pce=ze("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/** + */const xce=ze("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jZ=ze("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + */const $Z=ze("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RZ=ze("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + */const FZ=ze("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nD=ze("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const Jy=ze("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const su=ze("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const lu=ze("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gce=ze("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + */const _ce=ze("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BZ=ze("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + */const VZ=ze("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ES=ze("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** + */const jS=ze("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lu=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + */const zo=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pm=ze("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);async function Di(e){const t=await fetch(e);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function y3(){return Di("/api/status")}async function mce(){return Di("/api/health")}async function yce(){return Di("/api/nodes")}async function xce(){return Di("/api/edges")}async function _ce(){return Di("/api/sources")}async function zZ(){return Di("/api/alerts/active")}async function x3(e=50,t=0,r,n){const i=new URLSearchParams;return i.set("limit",e.toString()),i.set("offset",t.toString()),r&&r!=="all"&&i.set("type",r),n&&n!=="all"&&i.set("severity",n),Di(`/api/alerts/history?${i.toString()}`)}async function bce(){return Di("/api/subscriptions")}async function $Z(){return Di("/api/env/status")}async function FZ(){return Di("/api/env/active")}async function wce(){return Di("/api/env/swpc")}async function Sce(){return Di("/api/env/ducting")}async function Tce(){return Di("/api/regions")}function iD(){const[e,t]=W.useState(!1),[r,n]=W.useState(null),[i,a]=W.useState(null),[o,s]=W.useState(null),l=W.useRef(null),u=W.useRef(null),c=W.useRef(1e3),f=W.useCallback(()=>{var v;if(((v=l.current)==null?void 0:v.readyState)===WebSocket.OPEN)return;const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/live`;try{const g=new WebSocket(d);l.current=g,g.onopen=()=>{t(!0),c.current=1e3},g.onmessage=y=>{try{const _=JSON.parse(y.data);switch(s(_),_.type){case"health_update":n(_.data);break;case"alert_fired":a(_.data);break}}catch(_){console.error("Failed to parse WebSocket message:",_)}},g.onclose=()=>{t(!1),l.current=null;const y=Math.min(c.current,3e4);u.current=window.setTimeout(()=>{c.current=Math.min(y*2,3e4),f()},y)},g.onerror=()=>{g.close()};const m=setInterval(()=>{g.readyState===WebSocket.OPEN&&g.send("ping")},3e4);g.addEventListener("close",()=>{clearInterval(m)})}catch(g){console.error("Failed to create WebSocket:",g)}},[]);return W.useEffect(()=>(f(),()=>{u.current&&clearTimeout(u.current),l.current&&l.current.close()}),[f]),{connected:e,lastHealth:r,lastAlert:i,lastMessage:o}}const VZ=W.createContext(null);function Cce(){const e=W.useContext(VZ);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function Ace(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:au,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:su,iconColor:"text-amber-500"};default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:MS,iconColor:"text-blue-500"}}}function Mce({toast:e,onDismiss:t,onNavigate:r}){const n=Ace(e.alert.severity),i=n.icon;return W.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),x.jsx("div",{className:`${n.bg} border ${n.border} rounded-lg shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:x.jsxs("div",{className:"flex items-start gap-3 p-4",children:[x.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),x.jsx(i,{size:18,className:n.iconColor}),x.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[x.jsx("div",{className:"text-sm font-medium text-slate-200 mb-0.5",children:e.alert.type.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}),x.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),x.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:x.jsx(lu,{size:16})})]})})}function Pce({children:e}){const[t,r]=W.useState([]),n=xZ(),i=W.useCallback(s=>{const l=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>[...u,{id:l,alert:s}])},[]),a=W.useCallback(s=>{r(l=>l.filter(u=>u.id!==s))},[]),o=W.useCallback(()=>{n("/alerts")},[n]);return x.jsxs(VZ.Provider,{value:{addToast:i},children:[e,x.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:t.map(s=>x.jsx("div",{className:"pointer-events-auto",children:x.jsx(Mce,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const GZ=[{path:"/",label:"Dashboard",icon:IZ},{path:"/mesh",label:"Mesh",icon:Za},{path:"/environment",label:"Environment",icon:ou},{path:"/config",label:"Config",icon:DZ},{path:"/alerts",label:"Alerts",icon:Am},{path:"/notifications",label:"Notifications",icon:ece},{path:"/reference",label:"Reference",icon:CZ},{path:"/adapter-config",label:"Adapter Config",icon:NZ}];function kce(e){const t=Math.floor(e/86400),r=Math.floor(e%86400/3600),n=Math.floor(e%3600/60);return t>0?`${t}d ${r}h`:r>0?`${r}h ${n}m`:`${n}m`}function Lce(e){const t=GZ.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function Ice({children:e}){var h;const t=mv(),{connected:r,lastAlert:n}=iD(),{addToast:i}=Cce(),[a,o]=W.useState(null),[s,l]=W.useState(null);W.useEffect(()=>{if(n){const d=`${n.type}-${n.message}-${n.timestamp}`;d!==s&&(l(d),i(n))}},[n,s,i]);const[u,c]=W.useState(new Date);W.useEffect(()=>{y3().then(o).catch(console.error);const d=setInterval(()=>{y3().then(o).catch(console.error)},3e4);return()=>clearInterval(d)},[]),W.useEffect(()=>{const d=setInterval(()=>c(new Date),1e3);return()=>clearInterval(d)},[]);const f=u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return x.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-slate-200",children:[x.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[x.jsx("div",{className:"p-5 border-b border-border",children:x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-blue-500 to-blue-700 flex items-center justify-center text-white font-bold text-xl",children:"M"}),x.jsxs("div",{children:[x.jsx("div",{className:"font-semibold text-lg",children:"MeshAI"}),x.jsxs("div",{className:"text-xs text-slate-500 font-mono",children:["v",(a==null?void 0:a.version)||"..."]})]})]})}),x.jsx("nav",{className:"flex-1 py-4",children:GZ.map(d=>{const v=t.pathname===d.path,g=d.icon;return x.jsxs(Xue,{to:d.path,className:`flex items-center gap-3 px-5 py-3 text-sm transition-colors relative ${v?"text-blue-400 bg-blue-500/10":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[v&&x.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500"}),x.jsx(g,{size:18}),d.label]},d.path)})}),x.jsxs("div",{className:"p-5 border-t border-border",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),x.jsx("span",{className:"text-xs text-slate-400",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),x.jsxs("div",{className:"text-xs text-slate-500 font-mono truncate",children:[(h=a==null?void 0:a.connection_type)==null?void 0:h.toUpperCase(),": ",a==null?void 0:a.connection_target]}),x.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Uptime: ",a?kce(a.uptime_seconds):"..."]})]})]}),x.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[x.jsx("h1",{className:"text-lg font-semibold",children:Lce(t.pathname)}),x.jsxs("div",{className:"flex items-center gap-6",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500 animate-pulse-slow":"bg-slate-500"}`}),x.jsx("span",{className:"text-xs text-slate-400",children:r?"Live":"Offline"})]}),x.jsxs("div",{className:"text-sm font-mono text-slate-400",children:[f," MT"]})]})]}),x.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:e})]})]})}function WZ(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var Lhe=khe,Ihe=NS;function Ohe(e,t){var r=this.__data__,n=Ihe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Ehe=Ohe,Dhe=ghe,Nhe=The,jhe=Mhe,Rhe=Lhe,Bhe=Ehe;function wv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t{var v;if(((v=l.current)==null?void 0:v.readyState)===WebSocket.OPEN)return;const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/live`;try{const g=new WebSocket(d);l.current=g,g.onopen=()=>{t(!0),c.current=1e3},g.onmessage=x=>{try{const _=JSON.parse(x.data);switch(s(_),_.type){case"health_update":n(_.data);break;case"alert_fired":a(_.data);break}}catch(_){console.error("Failed to parse WebSocket message:",_)}},g.onclose=()=>{t(!1),l.current=null;const x=Math.min(c.current,3e4);u.current=window.setTimeout(()=>{c.current=Math.min(x*2,3e4),f()},x)},g.onerror=()=>{g.close()};const m=setInterval(()=>{g.readyState===WebSocket.OPEN&&g.send("ping")},3e4);g.addEventListener("close",()=>{clearInterval(m)})}catch(g){console.error("Failed to create WebSocket:",g)}},[]);return W.useEffect(()=>(f(),()=>{u.current&&clearTimeout(u.current),l.current&&l.current.close()}),[f]),{connected:e,lastHealth:r,lastAlert:i,lastMessage:o}}const UZ=W.createContext(null);function kce(){const e=W.useContext(UZ);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function Lce(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:ou,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:lu,iconColor:"text-amber-500"};default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:IS,iconColor:"text-blue-500"}}}function Ice({toast:e,onDismiss:t,onNavigate:r}){const n=Lce(e.alert.severity),i=n.icon;return W.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),y.jsx("div",{className:`${n.bg} border ${n.border} rounded-lg shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:y.jsxs("div",{className:"flex items-start gap-3 p-4",children:[y.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),y.jsx(i,{size:18,className:n.iconColor}),y.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[y.jsx("div",{className:"text-sm font-medium text-slate-200 mb-0.5",children:e.alert.type.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}),y.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),y.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:y.jsx(zo,{size:16})})]})})}function Oce({children:e}){const[t,r]=W.useState([]),n=CZ(),i=W.useCallback(s=>{const l=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>[...u,{id:l,alert:s}])},[]),a=W.useCallback(s=>{r(l=>l.filter(u=>u.id!==s))},[]),o=W.useCallback(()=>{n("/alerts")},[n]);return y.jsxs(UZ.Provider,{value:{addToast:i},children:[e,y.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:t.map(s=>y.jsx("div",{className:"pointer-events-auto",children:y.jsx(Ice,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const ZZ=[{path:"/",label:"Dashboard",icon:jZ},{path:"/mesh",label:"Mesh",icon:Ya},{path:"/environment",label:"Environment",icon:su},{path:"/config",label:"Config",icon:BZ},{path:"/alerts",label:"Alerts",icon:Pm},{path:"/notifications",label:"Notifications",icon:ice},{path:"/reference",label:"Reference",icon:IZ},{path:"/adapter-config",label:"Adapter Config",icon:zZ},{path:"/gauge-sites",label:"Gauge Sites",icon:kS},{path:"/town-anchors",label:"Town Anchors",icon:xv}];function Ece(e){const t=Math.floor(e/86400),r=Math.floor(e%86400/3600),n=Math.floor(e%3600/60);return t>0?`${t}d ${r}h`:r>0?`${r}h ${n}m`:`${n}m`}function Dce(e){const t=ZZ.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function Nce({children:e}){var h;const t=mv(),{connected:r,lastAlert:n}=lD(),{addToast:i}=kce(),[a,o]=W.useState(null),[s,l]=W.useState(null);W.useEffect(()=>{if(n){const d=`${n.type}-${n.message}-${n.timestamp}`;d!==s&&(l(d),i(n))}},[n,s,i]);const[u,c]=W.useState(new Date);W.useEffect(()=>{wB().then(o).catch(console.error);const d=setInterval(()=>{wB().then(o).catch(console.error)},3e4);return()=>clearInterval(d)},[]),W.useEffect(()=>{const d=setInterval(()=>c(new Date),1e3);return()=>clearInterval(d)},[]);const f=u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return y.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-slate-200",children:[y.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[y.jsx("div",{className:"p-5 border-b border-border",children:y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-blue-500 to-blue-700 flex items-center justify-center text-white font-bold text-xl",children:"M"}),y.jsxs("div",{children:[y.jsx("div",{className:"font-semibold text-lg",children:"MeshAI"}),y.jsxs("div",{className:"text-xs text-slate-500 font-mono",children:["v",(a==null?void 0:a.version)||"..."]})]})]})}),y.jsx("nav",{className:"flex-1 py-4",children:ZZ.map(d=>{const v=t.pathname===d.path,g=d.icon;return y.jsxs(Que,{to:d.path,className:`flex items-center gap-3 px-5 py-3 text-sm transition-colors relative ${v?"text-blue-400 bg-blue-500/10":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[v&&y.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500"}),y.jsx(g,{size:18}),d.label]},d.path)})}),y.jsxs("div",{className:"p-5 border-t border-border",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[y.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),y.jsx("span",{className:"text-xs text-slate-400",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),y.jsxs("div",{className:"text-xs text-slate-500 font-mono truncate",children:[(h=a==null?void 0:a.connection_type)==null?void 0:h.toUpperCase(),": ",a==null?void 0:a.connection_target]}),y.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Uptime: ",a?Ece(a.uptime_seconds):"..."]})]})]}),y.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[y.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[y.jsx("h1",{className:"text-lg font-semibold",children:Dce(t.pathname)}),y.jsxs("div",{className:"flex items-center gap-6",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500 animate-pulse-slow":"bg-slate-500"}`}),y.jsx("span",{className:"text-xs text-slate-400",children:r?"Live":"Offline"})]}),y.jsxs("div",{className:"text-sm font-mono text-slate-400",children:[f," MT"]})]})]}),y.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:e})]})]})}function YZ(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var Dhe=Ehe,Nhe=BS;function jhe(e,t){var r=this.__data__,n=Nhe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Rhe=jhe,Bhe=_he,zhe=Phe,$he=Ihe,Fhe=Dhe,Vhe=Rhe;function Tv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Mc=function(t){return af(t)&&t.indexOf("%")===t.length-1},we=function(t){return ive(t)&&!Tv(t)},lve=function(t){return dt(t)},Vr=function(t){return we(t)||af(t)},uve=0,Cv=function(t){var r=++uve;return"".concat(t||"").concat(r)},of=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!we(t)&&!af(t))return n;var a;if(Mc(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Tv(a)&&(a=n),i&&a>r&&(a=r),a},Ah=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},cve=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mve(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 gk(e){"@babel/helpers - typeof";return gk=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},gk(e)}var I3={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"},Ss=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},O3=null,gA=null,gD=function e(t){if(t===O3&&Array.isArray(gA))return gA;var r=[];return W.Children.forEach(t,function(n){dt(n)||(Qde.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),gA=r,O3=t,r};function sa(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Ss(i)}):n=[Ss(t)],gD(e).forEach(function(i){var a=oa(i,"type.displayName")||oa(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function yi(e,t){var r=sa(e,t);return r&&r[0]}var E3=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!we(n)||n<=0||!we(i)||i<=0)},yve=["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"],xve=function(t){return t&&t.type&&af(t.type)&&yve.indexOf(t.type)>=0},nY=function(t){return t&&gk(t)==="object"&&"clipDot"in t},_ve=function(t,r,n,i){var a,o=(a=pA==null?void 0:pA[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!ft(t)&&(i&&o.includes(r)||dve.includes(r))||n&&pD.includes(r)},ct=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(W.isValidElement(t)&&(i=t.props),!_v(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;_ve((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},mk=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 D3(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cve(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 xk(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=Tve(e,Sve),c=i||{width:r,height:n,x:0,y:0},f=_t("recharts-surface",a);return Q.createElement("svg",yk({},ct(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),Q.createElement("title",null,s),Q.createElement("desc",null,l),t)}var Ave=["children","className"];function _k(){return _k=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 Pve(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 Yt=Q.forwardRef(function(e,t){var r=e.children,n=e.className,i=Mve(e,Ave),a=_t("recharts-layer",n);return Q.createElement("g",_k({className:a},ct(i,!0),{ref:t}),r)}),Fc=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:Ive(e,t,r)}var Eve=Ove,Dve="\\ud800-\\udfff",Nve="\\u0300-\\u036f",jve="\\ufe20-\\ufe2f",Rve="\\u20d0-\\u20ff",Bve=Nve+jve+Rve,zve="\\ufe0e\\ufe0f",$ve="\\u200d",Fve=RegExp("["+$ve+Dve+Bve+zve+"]");function Vve(e){return Fve.test(e)}var iY=Vve;function Gve(e){return e.split("")}var Wve=Gve,aY="\\ud800-\\udfff",Hve="\\u0300-\\u036f",Uve="\\ufe20-\\ufe2f",Zve="\\u20d0-\\u20ff",Yve=Hve+Uve+Zve,Xve="\\ufe0e\\ufe0f",qve="["+aY+"]",bk="["+Yve+"]",wk="\\ud83c[\\udffb-\\udfff]",Kve="(?:"+bk+"|"+wk+")",oY="[^"+aY+"]",sY="(?:\\ud83c[\\udde6-\\uddff]){2}",lY="[\\ud800-\\udbff][\\udc00-\\udfff]",Jve="\\u200d",uY=Kve+"?",cY="["+Xve+"]?",Qve="(?:"+Jve+"(?:"+[oY,sY,lY].join("|")+")"+cY+uY+")*",epe=cY+uY+Qve,tpe="(?:"+[oY+bk+"?",bk,sY,lY,qve].join("|")+")",rpe=RegExp(wk+"(?="+wk+")|"+tpe+epe,"g");function npe(e){return e.match(rpe)||[]}var ipe=npe,ape=Wve,ope=iY,spe=ipe;function lpe(e){return ope(e)?spe(e):ape(e)}var upe=lpe,cpe=Eve,fpe=iY,hpe=upe,dpe=KZ;function vpe(e){return function(t){t=dpe(t);var r=fpe(t)?hpe(t):void 0,n=r?r[0]:t.charAt(0),i=r?cpe(r,1).join(""):t.slice(1);return n[e]()+i}}var ppe=vpe,gpe=ppe,mpe=gpe("toUpperCase"),ype=mpe;const XS=$t(ype);function Ut(e){return function(){return e}}const fY=Math.cos,Jb=Math.sin,Ka=Math.sqrt,Qb=Math.PI,qS=2*Qb,Sk=Math.PI,Tk=2*Sk,cc=1e-6,xpe=Tk-cc;function hY(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hY;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;icc)if(!(Math.abs(f*l-u*c)>cc)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let d=n-o,v=i-s,g=l*l+u*u,m=d*d+v*v,y=Math.sqrt(g),_=Math.sqrt(h),b=a*Math.tan((Sk-Math.acos((g+h-m)/(2*y*_)))/2),S=b/_,T=b/y;Math.abs(S-1)>cc&&this._append`L${t+S*c},${r+S*f}`,this._append`A${a},${a},0,0,${+(f*d>c*v)},${this._x1=t+T*l},${this._y1=r+T*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,c=r+l,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>cc||Math.abs(this._y1-c)>cc)&&this._append`L${u},${c}`,n&&(h<0&&(h=h%Tk+Tk),h>xpe?this._append`A${n},${n},0,1,${f},${t-s},${r-l}A${n},${n},0,1,${f},${this._x1=u},${this._y1=c}`:h>cc&&this._append`A${n},${n},0,${+(h>=Sk)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function mD(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 bpe(t)}function yD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dY(e){this._context=e}dY.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 KS(e){return new dY(e)}function vY(e){return e[0]}function pY(e){return e[1]}function gY(e,t){var r=Ut(!0),n=null,i=KS,a=null,o=mD(s);e=typeof e=="function"?e:e===void 0?vY:Ut(e),t=typeof t=="function"?t:t===void 0?pY:Ut(t);function s(l){var u,c=(l=yD(l)).length,f,h=!1,d;for(n==null&&(a=i(d=o())),u=0;u<=c;++u)!(u=d;--v)s.point(b[v],S[v]);s.lineEnd(),s.areaEnd()}y&&(b[h]=+e(m,h,f),S[h]=+t(m,h,f),s.point(n?+n(m,h,f):b[h],r?+r(m,h,f):S[h]))}if(_)return s=null,_+""||null}function c(){return gY().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ut(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ut(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ut(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ut(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ut(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ut(+f),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Ut(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),u):a},u}class mY{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 wpe(e){return new mY(e,!0)}function Spe(e){return new mY(e,!1)}const xD={draw(e,t){const r=Ka(t/Qb);e.moveTo(r,0),e.arc(0,0,r,0,qS)}},Tpe={draw(e,t){const r=Ka(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()}},yY=Ka(1/3),Cpe=yY*2,Ape={draw(e,t){const r=Ka(t/Cpe),n=r*yY;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Mpe={draw(e,t){const r=Ka(t),n=-r/2;e.rect(n,n,r,r)}},Ppe=.8908130915292852,xY=Jb(Qb/10)/Jb(7*Qb/10),kpe=Jb(qS/10)*xY,Lpe=-fY(qS/10)*xY,Ipe={draw(e,t){const r=Ka(t*Ppe),n=kpe*r,i=Lpe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=qS*a/5,s=fY(o),l=Jb(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},mA=Ka(3),Ope={draw(e,t){const r=-Ka(t/(mA*3));e.moveTo(0,r*2),e.lineTo(-mA*r,-r),e.lineTo(mA*r,-r),e.closePath()}},$i=-.5,Fi=Ka(3)/2,Ck=1/Ka(12),Epe=(Ck/2+1)*3,Dpe={draw(e,t){const r=Ka(t/Epe),n=r/2,i=r*Ck,a=n,o=r*Ck+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo($i*n-Fi*i,Fi*n+$i*i),e.lineTo($i*a-Fi*o,Fi*a+$i*o),e.lineTo($i*s-Fi*l,Fi*s+$i*l),e.lineTo($i*n+Fi*i,$i*i-Fi*n),e.lineTo($i*a+Fi*o,$i*o-Fi*a),e.lineTo($i*s+Fi*l,$i*l-Fi*s),e.closePath()}};function Npe(e,t){let r=null,n=mD(i);e=typeof e=="function"?e:Ut(e||xD),t=typeof t=="function"?t:Ut(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Ut(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Ut(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function e1(){}function t1(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 _Y(e){this._context=e}_Y.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:t1(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:t1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jpe(e){return new _Y(e)}function bY(e){this._context=e}bY.prototype={areaStart:e1,areaEnd:e1,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:t1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rpe(e){return new bY(e)}function wY(e){this._context=e}wY.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:t1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bpe(e){return new wY(e)}function SY(e){this._context=e}SY.prototype={areaStart:e1,areaEnd:e1,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 zpe(e){return new SY(e)}function j3(e){return e<0?-1:1}function R3(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(j3(a)+j3(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function B3(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function yA(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function r1(e){this._context=e}r1.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:yA(this,this._t0,B3(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,yA(this,B3(this,r=R3(this,e,t)),r);break;default:yA(this,this._t0,r=R3(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function TY(e){this._context=new CY(e)}(TY.prototype=Object.create(r1.prototype)).point=function(e,t){r1.prototype.point.call(this,t,e)};function CY(e){this._context=e}CY.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function $pe(e){return new r1(e)}function Fpe(e){return new TY(e)}function AY(e){this._context=e}AY.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=z3(e),i=z3(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Gpe(e){return new JS(e,.5)}function Wpe(e){return new JS(e,0)}function Hpe(e){return new JS(e,1)}function Ad(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function Upe(e,t){return e[t]}function Zpe(e){const t=[];return t.key=e,t}function Ype(){var e=Ut([]),t=Ak,r=Ad,n=Upe;function i(a){var o=Array.from(e.apply(this,arguments),Zpe),s,l=o.length,u=-1,c;for(const f of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nge(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 MY={symbolCircle:xD,symbolCross:Tpe,symbolDiamond:Ape,symbolSquare:Mpe,symbolStar:Ipe,symbolTriangle:Ope,symbolWye:Dpe},ige=Math.PI/180,age=function(t){var r="symbol".concat(XS(t));return MY[r]||xD},oge=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*ige;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},sge=function(t,r){MY["symbol".concat(XS(t))]=r},_D=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=rge(t,Jpe),u=F3(F3({},l),{},{type:n,size:a,sizeType:s}),c=function(){var m=age(n),y=Npe().type(m).size(oge(a,s,n));return y()},f=u.className,h=u.cx,d=u.cy,v=ct(u,!0);return h===+h&&d===+d&&a===+a?Q.createElement("path",Mk({},v,{className:_t("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:c()})):null};_D.registerSymbol=sge;function Md(e){"@babel/helpers - typeof";return Md=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},Md(e)}function Pk(){return Pk=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},Mc=function(t){return af(t)&&t.indexOf("%")===t.length-1},we=function(t){return lve(t)&&!Av(t)},hve=function(t){return dt(t)},Vr=function(t){return we(t)||af(t)},dve=0,Mv=function(t){var r=++dve;return"".concat(t||"").concat(r)},of=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!we(t)&&!af(t))return n;var a;if(Mc(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Av(a)&&(a=n),i&&a>r&&(a=r),a},Ah=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},vve=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bve(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 bk(e){"@babel/helpers - typeof";return bk=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},bk(e)}var NB={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"},Cs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},jB=null,xA=null,_D=function e(t){if(t===jB&&Array.isArray(xA))return xA;var r=[];return W.Children.forEach(t,function(n){dt(n)||(nve.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),xA=r,jB=t,r};function sa(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Cs(i)}):n=[Cs(t)],_D(e).forEach(function(i){var a=oa(i,"type.displayName")||oa(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function yi(e,t){var r=sa(e,t);return r&&r[0]}var RB=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!we(n)||n<=0||!we(i)||i<=0)},wve=["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"],Sve=function(t){return t&&t.type&&af(t.type)&&wve.indexOf(t.type)>=0},sY=function(t){return t&&bk(t)==="object"&&"clipDot"in t},Tve=function(t,r,n,i){var a,o=(a=yA==null?void 0:yA[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!ft(t)&&(i&&o.includes(r)||mve.includes(r))||n&&xD.includes(r)},ct=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(W.isValidElement(t)&&(i=t.props),!wv(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;Tve((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},wk=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 BB(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kve(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 Tk(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=Pve(e,Mve),c=i||{width:r,height:n,x:0,y:0},f=_t("recharts-surface",a);return Q.createElement("svg",Sk({},ct(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),Q.createElement("title",null,s),Q.createElement("desc",null,l),t)}var Lve=["children","className"];function Ck(){return Ck=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 Ove(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 Yt=Q.forwardRef(function(e,t){var r=e.children,n=e.className,i=Ive(e,Lve),a=_t("recharts-layer",n);return Q.createElement("g",Ck({className:a},ct(i,!0),{ref:t}),r)}),Fc=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:Nve(e,t,r)}var Rve=jve,Bve="\\ud800-\\udfff",zve="\\u0300-\\u036f",$ve="\\ufe20-\\ufe2f",Fve="\\u20d0-\\u20ff",Vve=zve+$ve+Fve,Gve="\\ufe0e\\ufe0f",Wve="\\u200d",Hve=RegExp("["+Wve+Bve+Vve+Gve+"]");function Uve(e){return Hve.test(e)}var lY=Uve;function Zve(e){return e.split("")}var Yve=Zve,uY="\\ud800-\\udfff",Xve="\\u0300-\\u036f",qve="\\ufe20-\\ufe2f",Kve="\\u20d0-\\u20ff",Jve=Xve+qve+Kve,Qve="\\ufe0e\\ufe0f",epe="["+uY+"]",Ak="["+Jve+"]",Mk="\\ud83c[\\udffb-\\udfff]",tpe="(?:"+Ak+"|"+Mk+")",cY="[^"+uY+"]",fY="(?:\\ud83c[\\udde6-\\uddff]){2}",hY="[\\ud800-\\udbff][\\udc00-\\udfff]",rpe="\\u200d",dY=tpe+"?",vY="["+Qve+"]?",npe="(?:"+rpe+"(?:"+[cY,fY,hY].join("|")+")"+vY+dY+")*",ipe=vY+dY+npe,ape="(?:"+[cY+Ak+"?",Ak,fY,hY,epe].join("|")+")",ope=RegExp(Mk+"(?="+Mk+")|"+ape+ipe,"g");function spe(e){return e.match(ope)||[]}var lpe=spe,upe=Yve,cpe=lY,fpe=lpe;function hpe(e){return cpe(e)?fpe(e):upe(e)}var dpe=hpe,vpe=Rve,ppe=lY,gpe=dpe,mpe=tY;function ype(e){return function(t){t=mpe(t);var r=ppe(t)?gpe(t):void 0,n=r?r[0]:t.charAt(0),i=r?vpe(r,1).join(""):t.slice(1);return n[e]()+i}}var xpe=ype,_pe=xpe,bpe=_pe("toUpperCase"),wpe=bpe;const JS=$t(wpe);function Ut(e){return function(){return e}}const pY=Math.cos,t1=Math.sin,Ja=Math.sqrt,r1=Math.PI,QS=2*r1,Pk=Math.PI,kk=2*Pk,cc=1e-6,Spe=kk-cc;function gY(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return gY;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;icc)if(!(Math.abs(f*l-u*c)>cc)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let d=n-o,v=i-s,g=l*l+u*u,m=d*d+v*v,x=Math.sqrt(g),_=Math.sqrt(h),b=a*Math.tan((Pk-Math.acos((g+h-m)/(2*x*_)))/2),S=b/_,T=b/x;Math.abs(S-1)>cc&&this._append`L${t+S*c},${r+S*f}`,this._append`A${a},${a},0,0,${+(f*d>c*v)},${this._x1=t+T*l},${this._y1=r+T*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,c=r+l,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>cc||Math.abs(this._y1-c)>cc)&&this._append`L${u},${c}`,n&&(h<0&&(h=h%kk+kk),h>Spe?this._append`A${n},${n},0,1,${f},${t-s},${r-l}A${n},${n},0,1,${f},${this._x1=u},${this._y1=c}`:h>cc&&this._append`A${n},${n},0,${+(h>=Pk)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function bD(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 Cpe(t)}function wD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mY(e){this._context=e}mY.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 eT(e){return new mY(e)}function yY(e){return e[0]}function xY(e){return e[1]}function _Y(e,t){var r=Ut(!0),n=null,i=eT,a=null,o=bD(s);e=typeof e=="function"?e:e===void 0?yY:Ut(e),t=typeof t=="function"?t:t===void 0?xY:Ut(t);function s(l){var u,c=(l=wD(l)).length,f,h=!1,d;for(n==null&&(a=i(d=o())),u=0;u<=c;++u)!(u=d;--v)s.point(b[v],S[v]);s.lineEnd(),s.areaEnd()}x&&(b[h]=+e(m,h,f),S[h]=+t(m,h,f),s.point(n?+n(m,h,f):b[h],r?+r(m,h,f):S[h]))}if(_)return s=null,_+""||null}function c(){return _Y().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ut(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ut(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ut(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ut(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ut(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ut(+f),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Ut(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),u):a},u}class bY{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 Ape(e){return new bY(e,!0)}function Mpe(e){return new bY(e,!1)}const SD={draw(e,t){const r=Ja(t/r1);e.moveTo(r,0),e.arc(0,0,r,0,QS)}},Ppe={draw(e,t){const r=Ja(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()}},wY=Ja(1/3),kpe=wY*2,Lpe={draw(e,t){const r=Ja(t/kpe),n=r*wY;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Ipe={draw(e,t){const r=Ja(t),n=-r/2;e.rect(n,n,r,r)}},Ope=.8908130915292852,SY=t1(r1/10)/t1(7*r1/10),Epe=t1(QS/10)*SY,Dpe=-pY(QS/10)*SY,Npe={draw(e,t){const r=Ja(t*Ope),n=Epe*r,i=Dpe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=QS*a/5,s=pY(o),l=t1(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},_A=Ja(3),jpe={draw(e,t){const r=-Ja(t/(_A*3));e.moveTo(0,r*2),e.lineTo(-_A*r,-r),e.lineTo(_A*r,-r),e.closePath()}},$i=-.5,Fi=Ja(3)/2,Lk=1/Ja(12),Rpe=(Lk/2+1)*3,Bpe={draw(e,t){const r=Ja(t/Rpe),n=r/2,i=r*Lk,a=n,o=r*Lk+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo($i*n-Fi*i,Fi*n+$i*i),e.lineTo($i*a-Fi*o,Fi*a+$i*o),e.lineTo($i*s-Fi*l,Fi*s+$i*l),e.lineTo($i*n+Fi*i,$i*i-Fi*n),e.lineTo($i*a+Fi*o,$i*o-Fi*a),e.lineTo($i*s+Fi*l,$i*l-Fi*s),e.closePath()}};function zpe(e,t){let r=null,n=bD(i);e=typeof e=="function"?e:Ut(e||SD),t=typeof t=="function"?t:Ut(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Ut(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Ut(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function n1(){}function i1(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 TY(e){this._context=e}TY.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:i1(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:i1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $pe(e){return new TY(e)}function CY(e){this._context=e}CY.prototype={areaStart:n1,areaEnd:n1,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:i1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fpe(e){return new CY(e)}function AY(e){this._context=e}AY.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:i1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Vpe(e){return new AY(e)}function MY(e){this._context=e}MY.prototype={areaStart:n1,areaEnd:n1,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 Gpe(e){return new MY(e)}function $B(e){return e<0?-1:1}function FB(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return($B(a)+$B(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function VB(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function bA(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function a1(e){this._context=e}a1.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:bA(this,this._t0,VB(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,bA(this,VB(this,r=FB(this,e,t)),r);break;default:bA(this,this._t0,r=FB(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function PY(e){this._context=new kY(e)}(PY.prototype=Object.create(a1.prototype)).point=function(e,t){a1.prototype.point.call(this,t,e)};function kY(e){this._context=e}kY.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function Wpe(e){return new a1(e)}function Hpe(e){return new PY(e)}function LY(e){this._context=e}LY.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=GB(e),i=GB(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Zpe(e){return new tT(e,.5)}function Ype(e){return new tT(e,0)}function Xpe(e){return new tT(e,1)}function Ad(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function qpe(e,t){return e[t]}function Kpe(e){const t=[];return t.key=e,t}function Jpe(){var e=Ut([]),t=Ik,r=Ad,n=qpe;function i(a){var o=Array.from(e.apply(this,arguments),Kpe),s,l=o.length,u=-1,c;for(const f of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sge(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 IY={symbolCircle:SD,symbolCross:Ppe,symbolDiamond:Lpe,symbolSquare:Ipe,symbolStar:Npe,symbolTriangle:jpe,symbolWye:Bpe},lge=Math.PI/180,uge=function(t){var r="symbol".concat(JS(t));return IY[r]||SD},cge=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*lge;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},fge=function(t,r){IY["symbol".concat(JS(t))]=r},TD=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=oge(t,rge),u=HB(HB({},l),{},{type:n,size:a,sizeType:s}),c=function(){var m=uge(n),x=zpe().type(m).size(cge(a,s,n));return x()},f=u.className,h=u.cx,d=u.cy,v=ct(u,!0);return h===+h&&d===+d&&a===+a?Q.createElement("path",Ok({},v,{className:_t("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:c()})):null};TD.registerSymbol=fge;function Md(e){"@babel/helpers - typeof";return Md=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},Md(e)}function Ek(){return Ek=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var _=d.inactive?u:d.color;return Q.createElement("li",Pk({className:m,style:f,key:"legend-item-".concat(v)},Kb(n.props,d,v)),Q.createElement(xk,{width:o,height:o,viewBox:c,style:h},n.renderIcon(d)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},g?g(y,d,v):y))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(W.PureComponent);Lm(bD,"displayName","Legend");Lm(bD,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var mge=jS;function yge(){this.__data__=new mge,this.size=0}var xge=yge;function _ge(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var bge=_ge;function wge(e){return this.__data__.get(e)}var Sge=wge;function Tge(e){return this.__data__.has(e)}var Cge=Tge,Age=jS,Mge=lD,Pge=uD,kge=200;function Lge(e,t){var r=this.__data__;if(r instanceof Age){var n=r.__data__;if(!Mge||n.lengths))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var f=-1,h=!0,d=r&Jge?new Yge:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=rye}var CD=nye,iye=Ys,aye=CD,oye=Xs,sye="[object Arguments]",lye="[object Array]",uye="[object Boolean]",cye="[object Date]",fye="[object Error]",hye="[object Function]",dye="[object Map]",vye="[object Number]",pye="[object Object]",gye="[object RegExp]",mye="[object Set]",yye="[object String]",xye="[object WeakMap]",_ye="[object ArrayBuffer]",bye="[object DataView]",wye="[object Float32Array]",Sye="[object Float64Array]",Tye="[object Int8Array]",Cye="[object Int16Array]",Aye="[object Int32Array]",Mye="[object Uint8Array]",Pye="[object Uint8ClampedArray]",kye="[object Uint16Array]",Lye="[object Uint32Array]",qt={};qt[wye]=qt[Sye]=qt[Tye]=qt[Cye]=qt[Aye]=qt[Mye]=qt[Pye]=qt[kye]=qt[Lye]=!0;qt[sye]=qt[lye]=qt[_ye]=qt[uye]=qt[bye]=qt[cye]=qt[fye]=qt[hye]=qt[dye]=qt[vye]=qt[pye]=qt[gye]=qt[mye]=qt[yye]=qt[xye]=!1;function Iye(e){return oye(e)&&aye(e.length)&&!!qt[iye(e)]}var Oye=Iye;function Eye(e){return function(t){return e(t)}}var BY=Eye,o1={exports:{}};o1.exports;(function(e,t){var r=HZ,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(o1,o1.exports);var Dye=o1.exports,Nye=Oye,jye=BY,Y3=Dye,X3=Y3&&Y3.isTypedArray,Rye=X3?jye(X3):Nye,zY=Rye,Bye=Fme,zye=SD,$ye=ci,Fye=RY,Vye=TD,Gye=zY,Wye=Object.prototype,Hye=Wye.hasOwnProperty;function Uye(e,t){var r=$ye(e),n=!r&&zye(e),i=!r&&!n&&Fye(e),a=!r&&!n&&!i&&Gye(e),o=r||n||i||a,s=o?Bye(e.length,String):[],l=s.length;for(var u in e)(t||Hye.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Vye(u,l)))&&s.push(u);return s}var Zye=Uye,Yye=Object.prototype;function Xye(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Yye;return e===r}var qye=Xye;function Kye(e,t){return function(r){return e(t(r))}}var $Y=Kye,Jye=$Y,Qye=Jye(Object.keys,Object),e0e=Qye,t0e=qye,r0e=e0e,n0e=Object.prototype,i0e=n0e.hasOwnProperty;function a0e(e){if(!t0e(e))return r0e(e);var t=[];for(var r in Object(e))i0e.call(e,r)&&r!="constructor"&&t.push(r);return t}var o0e=a0e,s0e=oD,l0e=CD;function u0e(e){return e!=null&&l0e(e.length)&&!s0e(e)}var QS=u0e,c0e=Zye,f0e=o0e,h0e=QS;function d0e(e){return h0e(e)?c0e(e):f0e(e)}var AD=d0e,v0e=kme,p0e=zme,g0e=AD;function m0e(e){return v0e(e,g0e,p0e)}var y0e=m0e,q3=y0e,x0e=1,_0e=Object.prototype,b0e=_0e.hasOwnProperty;function w0e(e,t,r,n,i,a){var o=r&x0e,s=q3(e),l=s.length,u=q3(t),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in t:b0e.call(t,h)))return!1}var d=a.get(e),v=a.get(t);if(d&&v)return d==t&&v==e;var g=!0;a.set(e,t),a.set(t,e);for(var m=o;++f-1}var b_e=__e;function w_e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=R_e){var u=t?null:N_e(e);if(u)return j_e(u);o=!1,i=D_e,l=new I_e}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Q_e(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 ebe(e){return e.value}function tbe(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var r=J_e(t,W_e);return Q.createElement(bD,r)}var hz=1,sd=function(e){function t(){var r;H_e(this,t);for(var n=arguments.length,i=new Array(n),a=0;ahz||Math.abs(i.height-this.lastBoundingBox.height)>hz)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?es({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,c=i.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();f={left:((u||0)-d.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var v=this.getBBoxSnapshot();h={top:((c||0)-v.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return es(es({},f),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,c=i.payload,f=es(es({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Q.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){n.wrapperNode=d}},tbe(a,es(es({},this.props),{},{payload:UY(c,u,ebe)})))}}],[{key:"getWithHeight",value:function(n,i){var a=es(es({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&we(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(W.PureComponent);eT(sd,"displayName","Legend");eT(sd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var dz=qy,rbe=SD,nbe=ci,vz=dz?dz.isConcatSpreadable:void 0;function ibe(e){return nbe(e)||rbe(e)||!!(vz&&e&&e[vz])}var abe=ibe,obe=NY,sbe=abe;function XY(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=sbe),i||(i=[]);++a0&&r(s)?t>1?XY(s,t-1,r,n,i):obe(i,s):n||(i[i.length]=s)}return i}var qY=XY;function lbe(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var ube=lbe,cbe=ube,fbe=cbe(),hbe=fbe,dbe=hbe,vbe=AD;function pbe(e,t){return e&&dbe(e,t,vbe)}var KY=pbe,gbe=QS;function mbe(e,t){return function(r,n){if(r==null)return r;if(!gbe(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var Ibe=Lbe,wA=fD,Obe=hD,Ebe=kv,Dbe=JY,Nbe=Abe,jbe=BY,Rbe=Ibe,Bbe=Pv,zbe=ci;function $be(e,t,r){t.length?t=wA(t,function(a){return zbe(a)?function(o){return Obe(o,a.length===1?a[0]:a)}:a}):t=[Bbe];var n=-1;t=wA(t,jbe(Ebe));var i=Dbe(e,function(a,o,s){var l=wA(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Nbe(i,function(a,o){return Rbe(a,o,r)})}var Fbe=$be;function Vbe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Gbe=Vbe,Wbe=Gbe,gz=Math.max;function Hbe(e,t,r){return t=gz(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=gz(n.length-t,0),o=Array(a);++i0){if(++t>=t1e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var a1e=i1e,o1e=e1e,s1e=a1e,l1e=s1e(o1e),u1e=l1e,c1e=Pv,f1e=Ube,h1e=u1e;function d1e(e,t){return h1e(f1e(e,t,c1e),e+"")}var v1e=d1e,p1e=sD,g1e=QS,m1e=TD,y1e=xu;function x1e(e,t,r){if(!y1e(r))return!1;var n=typeof t;return(n=="number"?g1e(r)&&m1e(t,r.length):n=="string"&&t in r)?p1e(r[t],e):!1}var tT=x1e,_1e=qY,b1e=Fbe,w1e=v1e,yz=tT,S1e=w1e(function(e,t){if(e==null)return[];var r=t.length;return r>1&&yz(e,t[0],t[1])?t=[]:r>2&&yz(t[0],t[1],t[2])&&(t=[t[0]]),b1e(e,_1e(t,1),[])}),T1e=S1e;const kD=$t(T1e);function Im(e){"@babel/helpers - typeof";return Im=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},Im(e)}function jk(){return jk=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(Tp,"-left"),we(r)&&t&&we(t.x)&&r=t.y),"".concat(Tp,"-top"),we(n)&&t&&we(t.y)&&ng?Math.max(c,l[n]):Math.max(f,l[n])}function z1e(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 $1e(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,c,f;return o.height>0&&o.width>0&&r?(c=bz({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=bz({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=z1e({translateX:c,translateY:f,useTranslate3d:s})):u=R1e,{cssProperties:u,cssClasses:B1e({translateX:c,translateY:f,coordinate:r})}}function kd(e){"@babel/helpers - typeof";return kd=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},kd(e)}function wz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Sz(e){for(var t=1;tTz||Math.abs(n.height-this.state.lastBoundingBox.height)>Tz)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,c=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,v=i.position,g=i.reverseDirection,m=i.useTranslate3d,y=i.viewBox,_=i.wrapperStyle,b=$1e({allowEscapeViewBox:o,coordinate:c,offsetTopLeft:d,position:v,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:y}),S=b.cssClasses,T=b.cssProperties,C=Sz(Sz({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},_);return Q.createElement("div",{tabIndex:-1,className:S,style:C,ref:function(P){n.wrapperNode=P}},u)}}])}(W.PureComponent),q1e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Cf={isSsr:q1e()};function Ld(e){"@babel/helpers - typeof";return Ld=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},Ld(e)}function Cz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Az(e){for(var t=1;t0;return Q.createElement(X1e,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:c,hasPayload:C,offset:d,position:m,reverseDirection:y,useTranslate3d:_,viewBox:b,wrapperStyle:S},owe(u,Az(Az({},this.props),{},{payload:T})))}}])}(W.PureComponent);LD(ls,"displayName","Tooltip");LD(ls,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Cf.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 swe=Uo,lwe=function(){return swe.Date.now()},uwe=lwe,cwe=/\s/;function fwe(e){for(var t=e.length;t--&&cwe.test(e.charAt(t)););return t}var hwe=fwe,dwe=hwe,vwe=/^\s+/;function pwe(e){return e&&e.slice(0,dwe(e)+1).replace(vwe,"")}var gwe=pwe,mwe=gwe,Mz=xu,ywe=xv,Pz=NaN,xwe=/^[-+]0x[0-9a-f]+$/i,_we=/^0b[01]+$/i,bwe=/^0o[0-7]+$/i,wwe=parseInt;function Swe(e){if(typeof e=="number")return e;if(ywe(e))return Pz;if(Mz(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Mz(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=mwe(e);var r=_we.test(e);return r||bwe.test(e)?wwe(e.slice(2),r?2:8):xwe.test(e)?Pz:+e}var iX=Swe,Twe=xu,TA=uwe,kz=iX,Cwe="Expected a function",Awe=Math.max,Mwe=Math.min;function Pwe(e,t,r){var n,i,a,o,s,l,u=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Cwe);t=kz(t)||0,Twe(r)&&(c=!!r.leading,f="maxWait"in r,a=f?Awe(kz(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function d(C){var A=n,P=i;return n=i=void 0,u=C,o=e.apply(P,A),o}function v(C){return u=C,s=setTimeout(y,t),c?d(C):o}function g(C){var A=C-l,P=C-u,I=t-A;return f?Mwe(I,a-P):I}function m(C){var A=C-l,P=C-u;return l===void 0||A>=t||A<0||f&&P>=a}function y(){var C=TA();if(m(C))return _(C);s=setTimeout(y,g(C))}function _(C){return s=void 0,h&&n?d(C):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:_(TA())}function T(){var C=TA(),A=m(C);if(n=arguments,i=this,l=C,A){if(s===void 0)return v(l);if(f)return clearTimeout(s),s=setTimeout(y,t),d(l)}return s===void 0&&(s=setTimeout(y,t)),o}return T.cancel=b,T.flush=S,T}var kwe=Pwe,Lwe=kwe,Iwe=xu,Owe="Expected a function";function Ewe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Owe);return Iwe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Lwe(e,t,{leading:n,maxWait:t,trailing:i})}var Dwe=Ewe;const aX=$t(Dwe);function Em(e){"@babel/helpers - typeof";return Em=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},Em(e)}function Lz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hx(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(N=aX(N,g,{trailing:!0,leading:!1}));var z=new ResizeObserver(N),F=T.current.getBoundingClientRect(),$=F.width,Z=F.height;return E($,Z),z.observe(T.current),function(){z.disconnect()}},[E,g]);var D=W.useMemo(function(){var N=I.containerWidth,z=I.containerHeight;if(N<0||z<0)return null;Fc(Mc(o)||Mc(l),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(o,",").concat(o,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return Q.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Vi/8,"h").concat(Vi,"v").concat(Vi*3/4,"h").concat(-Vi,"z"),className:"recharts-legend-icon"});if(Q.isValidElement(n.legendIcon)){var u=hge({},n);return delete u.legendIcon,Q.cloneElement(n.legendIcon,u)}return Q.createElement(TD,{fill:l,cx:a,cy:a,size:Vi,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,s=i.layout,l=i.formatter,u=i.inactiveColor,c={x:0,y:0,width:Vi,height:Vi},f={display:s==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(d,v){var g=d.formatter||l,m=_t(Om(Om({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",d.inactive));if(d.type==="none")return null;var x=ft(d.value)?null:d.value;Fc(!ft(d.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var _=d.inactive?u:d.color;return Q.createElement("li",Ek({className:m,style:f,key:"legend-item-".concat(v)},e1(n.props,d,v)),Q.createElement(Tk,{width:o,height:o,viewBox:c,style:h},n.renderIcon(d)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},g?g(x,d,v):x))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(W.PureComponent);Om(CD,"displayName","Legend");Om(CD,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var bge=zS;function wge(){this.__data__=new bge,this.size=0}var Sge=wge;function Tge(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Cge=Tge;function Age(e){return this.__data__.get(e)}var Mge=Age;function Pge(e){return this.__data__.has(e)}var kge=Pge,Lge=zS,Ige=hD,Oge=dD,Ege=200;function Dge(e,t){var r=this.__data__;if(r instanceof Lge){var n=r.__data__;if(!Ige||n.lengths))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var f=-1,h=!0,d=r&rme?new Jge:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=oye}var kD=sye,lye=qs,uye=kD,cye=Ks,fye="[object Arguments]",hye="[object Array]",dye="[object Boolean]",vye="[object Date]",pye="[object Error]",gye="[object Function]",mye="[object Map]",yye="[object Number]",xye="[object Object]",_ye="[object RegExp]",bye="[object Set]",wye="[object String]",Sye="[object WeakMap]",Tye="[object ArrayBuffer]",Cye="[object DataView]",Aye="[object Float32Array]",Mye="[object Float64Array]",Pye="[object Int8Array]",kye="[object Int16Array]",Lye="[object Int32Array]",Iye="[object Uint8Array]",Oye="[object Uint8ClampedArray]",Eye="[object Uint16Array]",Dye="[object Uint32Array]",qt={};qt[Aye]=qt[Mye]=qt[Pye]=qt[kye]=qt[Lye]=qt[Iye]=qt[Oye]=qt[Eye]=qt[Dye]=!0;qt[fye]=qt[hye]=qt[Tye]=qt[dye]=qt[Cye]=qt[vye]=qt[pye]=qt[gye]=qt[mye]=qt[yye]=qt[xye]=qt[_ye]=qt[bye]=qt[wye]=qt[Sye]=!1;function Nye(e){return cye(e)&&uye(e.length)&&!!qt[lye(e)]}var jye=Nye;function Rye(e){return function(t){return e(t)}}var VY=Rye,u1={exports:{}};u1.exports;(function(e,t){var r=XZ,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(u1,u1.exports);var Bye=u1.exports,zye=jye,$ye=VY,JB=Bye,QB=JB&&JB.isTypedArray,Fye=QB?$ye(QB):zye,GY=Fye,Vye=Hme,Gye=MD,Wye=ci,Hye=FY,Uye=PD,Zye=GY,Yye=Object.prototype,Xye=Yye.hasOwnProperty;function qye(e,t){var r=Wye(e),n=!r&&Gye(e),i=!r&&!n&&Hye(e),a=!r&&!n&&!i&&Zye(e),o=r||n||i||a,s=o?Vye(e.length,String):[],l=s.length;for(var u in e)(t||Xye.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Uye(u,l)))&&s.push(u);return s}var Kye=qye,Jye=Object.prototype;function Qye(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Jye;return e===r}var e0e=Qye;function t0e(e,t){return function(r){return e(t(r))}}var WY=t0e,r0e=WY,n0e=r0e(Object.keys,Object),i0e=n0e,a0e=e0e,o0e=i0e,s0e=Object.prototype,l0e=s0e.hasOwnProperty;function u0e(e){if(!a0e(e))return o0e(e);var t=[];for(var r in Object(e))l0e.call(e,r)&&r!="constructor"&&t.push(r);return t}var c0e=u0e,f0e=cD,h0e=kD;function d0e(e){return e!=null&&h0e(e.length)&&!f0e(e)}var rT=d0e,v0e=Kye,p0e=c0e,g0e=rT;function m0e(e){return g0e(e)?v0e(e):p0e(e)}var LD=m0e,y0e=Eme,x0e=Gme,_0e=LD;function b0e(e){return y0e(e,_0e,x0e)}var w0e=b0e,ez=w0e,S0e=1,T0e=Object.prototype,C0e=T0e.hasOwnProperty;function A0e(e,t,r,n,i,a){var o=r&S0e,s=ez(e),l=s.length,u=ez(t),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in t:C0e.call(t,h)))return!1}var d=a.get(e),v=a.get(t);if(d&&v)return d==t&&v==e;var g=!0;a.set(e,t),a.set(t,e);for(var m=o;++f-1}var C_e=T_e;function A_e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=F_e){var u=t?null:z_e(e);if(u)return $_e(u);o=!1,i=B_e,l=new N_e}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nbe(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 ibe(e){return e.value}function abe(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var r=rbe(t,Y_e);return Q.createElement(CD,r)}var gz=1,sd=function(e){function t(){var r;X_e(this,t);for(var n=arguments.length,i=new Array(n),a=0;agz||Math.abs(i.height-this.lastBoundingBox.height)>gz)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ns({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,c=i.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();f={left:((u||0)-d.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var v=this.getBBoxSnapshot();h={top:((c||0)-v.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return ns(ns({},f),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,c=i.payload,f=ns(ns({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Q.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){n.wrapperNode=d}},abe(a,ns(ns({},this.props),{},{payload:qY(c,u,ibe)})))}}],[{key:"getWithHeight",value:function(n,i){var a=ns(ns({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&we(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(W.PureComponent);nT(sd,"displayName","Legend");nT(sd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var mz=Qy,obe=MD,sbe=ci,yz=mz?mz.isConcatSpreadable:void 0;function lbe(e){return sbe(e)||obe(e)||!!(yz&&e&&e[yz])}var ube=lbe,cbe=zY,fbe=ube;function QY(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=fbe),i||(i=[]);++a0&&r(s)?t>1?QY(s,t-1,r,n,i):cbe(i,s):n||(i[i.length]=s)}return i}var eX=QY;function hbe(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var dbe=hbe,vbe=dbe,pbe=vbe(),gbe=pbe,mbe=gbe,ybe=LD;function xbe(e,t){return e&&mbe(e,t,ybe)}var tX=xbe,_be=rT;function bbe(e,t){return function(r,n){if(r==null)return r;if(!_be(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var Nbe=Dbe,CA=pD,jbe=gD,Rbe=Iv,Bbe=rX,zbe=Lbe,$be=VY,Fbe=Nbe,Vbe=Lv,Gbe=ci;function Wbe(e,t,r){t.length?t=CA(t,function(a){return Gbe(a)?function(o){return jbe(o,a.length===1?a[0]:a)}:a}):t=[Vbe];var n=-1;t=CA(t,$be(Rbe));var i=Bbe(e,function(a,o,s){var l=CA(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return zbe(i,function(a,o){return Fbe(a,o,r)})}var Hbe=Wbe;function Ube(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Zbe=Ube,Ybe=Zbe,_z=Math.max;function Xbe(e,t,r){return t=_z(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=_z(n.length-t,0),o=Array(a);++i0){if(++t>=a1e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var u1e=l1e,c1e=i1e,f1e=u1e,h1e=f1e(c1e),d1e=h1e,v1e=Lv,p1e=qbe,g1e=d1e;function m1e(e,t){return g1e(p1e(e,t,v1e),e+"")}var y1e=m1e,x1e=fD,_1e=rT,b1e=PD,w1e=xu;function S1e(e,t,r){if(!w1e(r))return!1;var n=typeof t;return(n=="number"?_1e(r)&&b1e(t,r.length):n=="string"&&t in r)?x1e(r[t],e):!1}var iT=S1e,T1e=eX,C1e=Hbe,A1e=y1e,wz=iT,M1e=A1e(function(e,t){if(e==null)return[];var r=t.length;return r>1&&wz(e,t[0],t[1])?t=[]:r>2&&wz(t[0],t[1],t[2])&&(t=[t[0]]),C1e(e,T1e(t,1),[])}),P1e=M1e;const ED=$t(P1e);function Em(e){"@babel/helpers - typeof";return Em=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},Em(e)}function Fk(){return Fk=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(Ap,"-left"),we(r)&&t&&we(t.x)&&r=t.y),"".concat(Ap,"-top"),we(n)&&t&&we(t.y)&&ng?Math.max(c,l[n]):Math.max(f,l[n])}function G1e(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 W1e(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,c,f;return o.height>0&&o.width>0&&r?(c=Cz({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=Cz({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=G1e({translateX:c,translateY:f,useTranslate3d:s})):u=F1e,{cssProperties:u,cssClasses:V1e({translateX:c,translateY:f,coordinate:r})}}function kd(e){"@babel/helpers - typeof";return kd=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},kd(e)}function Az(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mz(e){for(var t=1;tPz||Math.abs(n.height-this.state.lastBoundingBox.height)>Pz)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,c=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,v=i.position,g=i.reverseDirection,m=i.useTranslate3d,x=i.viewBox,_=i.wrapperStyle,b=W1e({allowEscapeViewBox:o,coordinate:c,offsetTopLeft:d,position:v,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:x}),S=b.cssClasses,T=b.cssProperties,C=Mz(Mz({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},_);return Q.createElement("div",{tabIndex:-1,className:S,style:C,ref:function(P){n.wrapperNode=P}},u)}}])}(W.PureComponent),ewe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Cf={isSsr:ewe()};function Ld(e){"@babel/helpers - typeof";return Ld=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},Ld(e)}function kz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Lz(e){for(var t=1;t0;return Q.createElement(Q1e,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:c,hasPayload:C,offset:d,position:m,reverseDirection:x,useTranslate3d:_,viewBox:b,wrapperStyle:S},cwe(u,Lz(Lz({},this.props),{},{payload:T})))}}])}(W.PureComponent);DD(cs,"displayName","Tooltip");DD(cs,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Cf.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 fwe=Xo,hwe=function(){return fwe.Date.now()},dwe=hwe,vwe=/\s/;function pwe(e){for(var t=e.length;t--&&vwe.test(e.charAt(t)););return t}var gwe=pwe,mwe=gwe,ywe=/^\s+/;function xwe(e){return e&&e.slice(0,mwe(e)+1).replace(ywe,"")}var _we=xwe,bwe=_we,Iz=xu,wwe=bv,Oz=NaN,Swe=/^[-+]0x[0-9a-f]+$/i,Twe=/^0b[01]+$/i,Cwe=/^0o[0-7]+$/i,Awe=parseInt;function Mwe(e){if(typeof e=="number")return e;if(wwe(e))return Oz;if(Iz(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Iz(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=bwe(e);var r=Twe.test(e);return r||Cwe.test(e)?Awe(e.slice(2),r?2:8):Swe.test(e)?Oz:+e}var lX=Mwe,Pwe=xu,MA=dwe,Ez=lX,kwe="Expected a function",Lwe=Math.max,Iwe=Math.min;function Owe(e,t,r){var n,i,a,o,s,l,u=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(kwe);t=Ez(t)||0,Pwe(r)&&(c=!!r.leading,f="maxWait"in r,a=f?Lwe(Ez(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function d(C){var A=n,P=i;return n=i=void 0,u=C,o=e.apply(P,A),o}function v(C){return u=C,s=setTimeout(x,t),c?d(C):o}function g(C){var A=C-l,P=C-u,I=t-A;return f?Iwe(I,a-P):I}function m(C){var A=C-l,P=C-u;return l===void 0||A>=t||A<0||f&&P>=a}function x(){var C=MA();if(m(C))return _(C);s=setTimeout(x,g(C))}function _(C){return s=void 0,h&&n?d(C):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:_(MA())}function T(){var C=MA(),A=m(C);if(n=arguments,i=this,l=C,A){if(s===void 0)return v(l);if(f)return clearTimeout(s),s=setTimeout(x,t),d(l)}return s===void 0&&(s=setTimeout(x,t)),o}return T.cancel=b,T.flush=S,T}var Ewe=Owe,Dwe=Ewe,Nwe=xu,jwe="Expected a function";function Rwe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(jwe);return Nwe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Dwe(e,t,{leading:n,maxWait:t,trailing:i})}var Bwe=Rwe;const uX=$t(Bwe);function Nm(e){"@babel/helpers - typeof";return Nm=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},Nm(e)}function Dz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function px(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(N=uX(N,g,{trailing:!0,leading:!1}));var z=new ResizeObserver(N),F=T.current.getBoundingClientRect(),$=F.width,Z=F.height;return E($,Z),z.observe(T.current),function(){z.disconnect()}},[E,g]);var D=W.useMemo(function(){var N=I.containerWidth,z=I.containerHeight;if(N<0||z<0)return null;Fc(Mc(o)||Mc(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,l),Fc(!r||r>0,"The aspect(%s) must be greater than zero.",r);var F=Mc(o)?N:o,$=Mc(l)?z:l;r&&r>0&&(F?$=F/r:$&&(F=$*r),h&&$>h&&($=h)),Fc(F>0||$>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.`,F,$,o,l,c,f,r);var Z=!Array.isArray(d)&&Ss(d.type).endsWith("Chart");return Q.Children.map(d,function(j){return Q.isValidElement(j)?W.cloneElement(j,hx({width:F,height:$},Z?{style:hx({height:"100%",width:"100%",maxHeight:$,maxWidth:F},j.props.style)}:{})):j})},[r,d,l,h,f,c,I,o]);return Q.createElement("div",{id:m?"".concat(m):void 0,className:_t("recharts-responsive-container",y),style:hx(hx({},S),{},{width:o,height:l,minWidth:c,minHeight:f,maxHeight:h}),ref:T},D)}),sX=function(t){return null};sX.displayName="Cell";function Dm(e){"@babel/helpers - typeof";return Dm=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},Dm(e)}function Oz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $k(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Cf.isSsr)return{width:0,height:0};var n=Ywe(r),i=JSON.stringify({text:t,copyStyle:n});if(qf.widthCache[i])return qf.widthCache[i];try{var a=document.getElementById(Ez);a||(a=document.createElement("span"),a.setAttribute("id",Ez),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=$k($k({},Zwe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return qf.widthCache[i]=l,++qf.cacheCount>Uwe&&(qf.cacheCount=0,qf.widthCache={}),l}catch{return{width:0,height:0}}},Xwe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Nm(e){"@babel/helpers - typeof";return Nm=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},Nm(e)}function c1(e,t){return Qwe(e)||Jwe(e,t)||Kwe(e,t)||qwe()}function qwe(){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 Kwe(e,t){if(e){if(typeof e=="string")return Dz(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 Dz(e,t)}}function Dz(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 dSe(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 $z(e,t){return mSe(e)||gSe(e,t)||pSe(e,t)||vSe()}function vSe(){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 pSe(e,t){if(e){if(typeof e=="string")return Fz(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 Fz(e,t)}}function Fz(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 F.reduce(function($,Z){var j=Z.word,U=Z.width,G=$[$.length-1];if(G&&(i==null||a||G.width+U+nZ.width?$:Z})};if(!c)return d;for(var g="…",m=function(F){var $=f.slice(0,F),Z=fX({breakAll:u,style:l,children:$+g}).wordsWithComputedWidth,j=h(Z),U=j.length>o||v(j).width>Number(i);return[U,j]},y=0,_=f.length-1,b=0,S;y<=_&&b<=f.length-1;){var T=Math.floor((y+_)/2),C=T-1,A=m(C),P=$z(A,2),I=P[0],k=P[1],E=m(T),D=$z(E,1),N=D[0];if(!I&&!N&&(y=T+1),I&&N&&(_=T-1),!I&&N){S=k;break}b++}return S||d},Vz=function(t){var r=dt(t)?[]:t.toString().split(cX);return[{words:r}]},xSe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Cf.isSsr){var l,u,c=fX({breakAll:o,children:i,style:a});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;l=f,u=h}else return Vz(i);return ySe({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return Vz(i)},Gz="#808080",f1=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,f=c===void 0?!1:c,h=t.textAnchor,d=h===void 0?"start":h,v=t.verticalAnchor,g=v===void 0?"end":v,m=t.fill,y=m===void 0?Gz:m,_=zz(t,fSe),b=W.useMemo(function(){return xSe({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:f,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,f,_.style,_.width]),S=_.dx,T=_.dy,C=_.angle,A=_.className,P=_.breakAll,I=zz(_,hSe);if(!Vr(n)||!Vr(a))return null;var k=n+(we(S)?S:0),E=a+(we(T)?T:0),D;switch(g){case"start":D=CA("calc(".concat(u,")"));break;case"middle":D=CA("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:D=CA("calc(".concat(b.length-1," * -").concat(s,")"));break}var N=[];if(f){var z=b[0].width,F=_.width;N.push("scale(".concat((we(F)?F/z:1)/z,")"))}return C&&N.push("rotate(".concat(C,", ").concat(k,", ").concat(E,")")),N.length&&(I.transform=N.join(" ")),Q.createElement("text",Fk({},ct(I,!0),{x:k,y:E,className:_t("recharts-text",A),textAnchor:d,fill:y.includes("url")?Gz:y}),b.map(function($,Z){var j=$.words.join(P?"":" ");return Q.createElement("tspan",{x:k,dy:Z===0?D:s,key:"".concat(j,"-").concat(Z)},j)}))};function Hl(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function _Se(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ID(e){let t,r,n;e.length!==2?(t=Hl,r=(s,l)=>Hl(e(s),l),n=(s,l)=>e(s)-l):(t=e===Hl||e===_Se?e:bSe,r=e,n=e);function i(s,l,u=0,c=s.length){if(u>>1;r(s[f],l)<0?u=f+1:c=f}while(u>>1;r(s[f],l)<=0?u=f+1:c=f}while(uu&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function bSe(){return 0}function hX(e){return e===null?NaN:+e}function*wSe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const SSe=ID(Hl),Ky=SSe.right;ID(hX).center;class Wz extends Map{constructor(t,r=ASe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Hz(this,t))}has(t){return super.has(Hz(this,t))}set(t,r){return super.set(TSe(this,t),r)}delete(t){return super.delete(CSe(this,t))}}function Hz({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function TSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function CSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function ASe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function MSe(e=Hl){if(e===Hl)return dX;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 dX(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const PSe=Math.sqrt(50),kSe=Math.sqrt(10),LSe=Math.sqrt(2);function h1(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=PSe?10:a>=kSe?5:a>=LSe?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function Zz(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function vX(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?dX:MSe(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),d=Math.max(r,Math.floor(t-u*f/l+h)),v=Math.min(n,Math.floor(t+(l-u)*f/l+h));vX(e,t,d,v,i)}const a=e[t];let o=r,s=n;for(Cp(e,r,t),i(e[n],a)>0&&Cp(e,r,n);o0;)--s}i(e[r],a)===0?Cp(e,r,s):(++s,Cp(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Cp(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function ISe(e,t,r){if(e=Float64Array.from(wSe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Zz(e);if(t>=1)return Uz(e);var n,i=(n-1)*t,a=Math.floor(i),o=Uz(vX(e,a).subarray(0,a+1)),s=Zz(e.subarray(a+1));return o+(s-o)*(i-a)}}function OSe(e,t,r=hX){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function ESe(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?vx(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?vx(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=NSe.exec(e))?new ii(t[1],t[2],t[3],1):(t=jSe.exec(e))?new ii(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=RSe.exec(e))?vx(t[1],t[2],t[3],t[4]):(t=BSe.exec(e))?vx(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zSe.exec(e))?e4(t[1],t[2]/100,t[3]/100,1):(t=$Se.exec(e))?e4(t[1],t[2]/100,t[3]/100,t[4]):Yz.hasOwnProperty(e)?Kz(Yz[e]):e==="transparent"?new ii(NaN,NaN,NaN,0):null}function Kz(e){return new ii(e>>16&255,e>>8&255,e&255,1)}function vx(e,t,r,n){return n<=0&&(e=t=r=NaN),new ii(e,t,r,n)}function GSe(e){return e instanceof Jy||(e=zm(e)),e?(e=e.rgb(),new ii(e.r,e.g,e.b,e.opacity)):new ii}function Uk(e,t,r,n){return arguments.length===1?GSe(e):new ii(e,t,r,n??1)}function ii(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}ED(ii,Uk,gX(Jy,{brighter(e){return e=e==null?d1:Math.pow(d1,e),new ii(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rm:Math.pow(Rm,e),new ii(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ii(Vc(this.r),Vc(this.g),Vc(this.b),v1(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:Jz,formatHex:Jz,formatHex8:WSe,formatRgb:Qz,toString:Qz}));function Jz(){return`#${Pc(this.r)}${Pc(this.g)}${Pc(this.b)}`}function WSe(){return`#${Pc(this.r)}${Pc(this.g)}${Pc(this.b)}${Pc((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qz(){const e=v1(this.opacity);return`${e===1?"rgb(":"rgba("}${Vc(this.r)}, ${Vc(this.g)}, ${Vc(this.b)}${e===1?")":`, ${e})`}`}function v1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pc(e){return e=Vc(e),(e<16?"0":"")+e.toString(16)}function e4(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ja(e,t,r,n)}function mX(e){if(e instanceof ja)return new ja(e.h,e.s,e.l,e.opacity);if(e instanceof Jy||(e=zm(e)),!e)return new ja;if(e instanceof ja)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new ja(o,s,l,e.opacity)}function HSe(e,t,r,n){return arguments.length===1?mX(e):new ja(e,t,r,n??1)}function ja(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}ED(ja,HSe,gX(Jy,{brighter(e){return e=e==null?d1:Math.pow(d1,e),new ja(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rm:Math.pow(Rm,e),new ja(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new ii(AA(e>=240?e-240:e+120,i,n),AA(e,i,n),AA(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ja(t4(this.h),px(this.s),px(this.l),v1(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=v1(this.opacity);return`${e===1?"hsl(":"hsla("}${t4(this.h)}, ${px(this.s)*100}%, ${px(this.l)*100}%${e===1?")":`, ${e})`}`}}));function t4(e){return e=(e||0)%360,e<0?e+360:e}function px(e){return Math.max(0,Math.min(1,e||0))}function AA(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 DD=e=>()=>e;function USe(e,t){return function(r){return e+r*t}}function ZSe(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 YSe(e){return(e=+e)==1?yX:function(t,r){return r-t?ZSe(t,r,e):DD(isNaN(t)?r:t)}}function yX(e,t){var r=t-e;return r?USe(e,r):DD(isNaN(e)?t:e)}const r4=function e(t){var r=YSe(t);function n(i,a){var o=r((i=Uk(i)).r,(a=Uk(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=yX(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n}(1);function XSe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:p1(n,i)})),r=MA.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function oTe(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?sTe:oTe,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=s(e.map(n),t,r)))(n(o(h)))}return f.invert=function(h){return o(i((u||(u=s(t,e.map(n),p1)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,g1),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=ND,c()},f.clamp=function(h){return arguments.length?(o=h?!0:Vn,c()):o!==Vn},f.interpolate=function(h){return arguments.length?(r=h,c()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return n=h,i=d,c()}}function jD(){return rT()(Vn,Vn)}function lTe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function m1(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 Id(e){return e=m1(Math.abs(e)),e?e[1]:NaN}function uTe(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function cTe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var fTe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $m(e){if(!(t=fTe.exec(e)))throw new Error("invalid format: "+e);var t;return new RD({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]})}$m.prototype=RD.prototype;function RD(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+""}RD.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 hTe(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var y1;function dTe(e,t){var r=m1(e,t);if(!r)return y1=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(y1=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+m1(e,Math.max(0,t+a-1))[0]}function i4(e,t){var r=m1(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const a4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lTe,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)=>i4(e*100,t),r:i4,s:dTe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function o4(e){return e}var s4=Array.prototype.map,l4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vTe(e){var t=e.grouping===void 0||e.thousands===void 0?o4:uTe(s4.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?o4:cTe(s4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=$m(f);var d=f.fill,v=f.align,g=f.sign,m=f.symbol,y=f.zero,_=f.width,b=f.comma,S=f.precision,T=f.trim,C=f.type;C==="n"?(b=!0,C="g"):a4[C]||(S===void 0&&(S=12),T=!0,C="g"),(y||d==="0"&&v==="=")&&(y=!0,d="0",v="=");var A=(h&&h.prefix!==void 0?h.prefix:"")+(m==="$"?r:m==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),P=(m==="$"?n:/[%p]/.test(C)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),I=a4[C],k=/[defgprs%]/.test(C);S=S===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function E(D){var N=A,z=P,F,$,Z;if(C==="c")z=I(D)+z,D="";else{D=+D;var j=D<0||1/D<0;if(D=isNaN(D)?l:I(Math.abs(D),S),T&&(D=hTe(D)),j&&+D==0&&g!=="+"&&(j=!1),N=(j?g==="("?g:s:g==="-"||g==="("?"":g)+N,z=(C==="s"&&!isNaN(D)&&y1!==void 0?l4[8+y1/3]:"")+z+(j&&g==="("?")":""),k){for(F=-1,$=D.length;++F<$;)if(Z=D.charCodeAt(F),48>Z||Z>57){z=(Z===46?i+D.slice(F+1):D.slice(F))+z,D=D.slice(0,F);break}}}b&&!y&&(D=t(D,1/0));var U=N.length+D.length+z.length,G=U<_?new Array(_-U+1).join(d):"";switch(b&&y&&(D=t(G+D,G.length?_-z.length:1/0),G=""),v){case"<":D=N+D+z+G;break;case"=":D=N+G+D+z;break;case"^":D=G.slice(0,U=G.length>>1)+N+D+z+G.slice(U);break;default:D=G+N+D+z;break}return a(D)}return E.toString=function(){return f+""},E}function c(f,h){var d=Math.max(-8,Math.min(8,Math.floor(Id(h)/3)))*3,v=Math.pow(10,-d),g=u((f=$m(f),f.type="f",f),{suffix:l4[8+d/3]});return function(m){return g(v*m)}}return{format:u,formatPrefix:c}}var gx,BD,xX;pTe({thousands:",",grouping:[3],currency:["$",""]});function pTe(e){return gx=vTe(e),BD=gx.format,xX=gx.formatPrefix,gx}function gTe(e){return Math.max(0,-Id(Math.abs(e)))}function mTe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Id(t)/3)))*3-Id(Math.abs(e)))}function yTe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Id(t)-Id(e))+1}function _X(e,t,r,n){var i=Wk(e,t,r),a;switch(n=$m(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=mTe(i,o))&&(n.precision=a),xX(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=yTe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=gTe(i))&&(n.precision=a-(n.type==="%")*2);break}}return BD(n)}function _u(e){var t=e.domain;return e.ticks=function(r){var n=t();return Vk(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return _X(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,c=10;for(s0;){if(u=Gk(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function x1(){var e=jD();return e.copy=function(){return Qy(e,x1())},ya.apply(e,arguments),_u(e)}function bX(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,g1),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return bX(e).unknown(t)},e=arguments.length?Array.from(e,g1):[0,1],_u(r)}function wX(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function STe(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 f4(e){return(t,r)=>-e(-t,r)}function zD(e){const t=e(u4,c4),r=t.domain;let n=10,i,a;function o(){return i=STe(n),a=wTe(n),r()[0]<0?(i=f4(i),a=f4(a),e(xTe,_Te)):e(u4,c4),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],c=l[l.length-1];const f=c0){for(;h<=d;++h)for(v=1;vc)break;y.push(g)}}else for(;h<=d;++h)for(v=n-1;v>=1;--v)if(g=h>0?v/a(-h):v*a(h),!(gc)break;y.push(g)}y.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=$m(l)).precision==null&&(l.trim=!0),l=BD(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return c=>{let f=c/a(Math.round(i(c)));return f*nr(wX(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function SX(){const e=zD(rT()).domain([1,10]);return e.copy=()=>Qy(e,SX()).base(e.base()),ya.apply(e,arguments),e}function h4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function d4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function $D(e){var t=1,r=e(h4(t),d4(t));return r.constant=function(n){return arguments.length?e(h4(t=+n),d4(t)):t},_u(r)}function TX(){var e=$D(rT());return e.copy=function(){return Qy(e,TX()).constant(e.constant())},ya.apply(e,arguments)}function v4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function TTe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function CTe(e){return e<0?-e*e:e*e}function FD(e){var t=e(Vn,Vn),r=1;function n(){return r===1?e(Vn,Vn):r===.5?e(TTe,CTe):e(v4(r),v4(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},_u(t)}function VD(){var e=FD(rT());return e.copy=function(){return Qy(e,VD()).exponent(e.exponent())},ya.apply(e,arguments),e}function ATe(){return VD.apply(null,arguments).exponent(.5)}function p4(e){return Math.sign(e)*e*e}function MTe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function CX(){var e=jD(),t=[0,1],r=!1,n;function i(a){var o=MTe(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(p4(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,g1)).map(p4)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return CX(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ya.apply(i,arguments),_u(i)}function AX(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return MX().domain([e,t]).range(i).unknown(a)},ya.apply(_u(o),arguments)}function PX(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Ky(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return PX().domain(e).range(t).unknown(r)},ya.apply(i,arguments)}const PA=new Date,kA=new Date;function Zr(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uZr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(PA.setTime(+a),kA.setTime(+o),e(PA),e(kA),Math.floor(r(PA,kA))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const _1=Zr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);_1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):_1);_1.range;const ps=1e3,na=ps*60,gs=na*60,js=gs*24,GD=js*7,g4=js*30,LA=js*365,kc=Zr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ps)},(e,t)=>(t-e)/ps,e=>e.getUTCSeconds());kc.range;const WD=Zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ps)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getMinutes());WD.range;const HD=Zr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getUTCMinutes());HD.range;const UD=Zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ps-e.getMinutes()*na)},(e,t)=>{e.setTime(+e+t*gs)},(e,t)=>(t-e)/gs,e=>e.getHours());UD.range;const ZD=Zr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*gs)},(e,t)=>(t-e)/gs,e=>e.getUTCHours());ZD.range;const e0=Zr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*na)/js,e=>e.getDate()-1);e0.range;const nT=Zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/js,e=>e.getUTCDate()-1);nT.range;const kX=Zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/js,e=>Math.floor(e/js));kX.range;function Af(e){return Zr(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())*na)/GD)}const iT=Af(0),b1=Af(1),PTe=Af(2),kTe=Af(3),Od=Af(4),LTe=Af(5),ITe=Af(6);iT.range;b1.range;PTe.range;kTe.range;Od.range;LTe.range;ITe.range;function Mf(e){return Zr(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)/GD)}const aT=Mf(0),w1=Mf(1),OTe=Mf(2),ETe=Mf(3),Ed=Mf(4),DTe=Mf(5),NTe=Mf(6);aT.range;w1.range;OTe.range;ETe.range;Ed.range;DTe.range;NTe.range;const YD=Zr(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());YD.range;const XD=Zr(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());XD.range;const Rs=Zr(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());Rs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zr(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)});Rs.range;const Bs=Zr(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());Bs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zr(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)});Bs.range;function LX(e,t,r,n,i,a){const o=[[kc,1,ps],[kc,5,5*ps],[kc,15,15*ps],[kc,30,30*ps],[a,1,na],[a,5,5*na],[a,15,15*na],[a,30,30*na],[i,1,gs],[i,3,3*gs],[i,6,6*gs],[i,12,12*gs],[n,1,js],[n,2,2*js],[r,1,GD],[t,1,g4],[t,3,3*g4],[e,1,LA]];function s(u,c,f){const h=cm).right(o,h);if(d===o.length)return e.every(Wk(u/LA,c/LA,f));if(d===0)return _1.every(Math.max(Wk(u,c,f),1));const[v,g]=o[h/o[d-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(Se=OA(Ap(te.y,0,1)),Ge=Se.getUTCDay(),Se=Ge>4||Ge===0?w1.ceil(Se):w1(Se),Se=nT.offset(Se,(te.V-1)*7),te.y=Se.getUTCFullYear(),te.m=Se.getUTCMonth(),te.d=Se.getUTCDate()+(te.w+6)%7):(Se=IA(Ap(te.y,0,1)),Ge=Se.getDay(),Se=Ge>4||Ge===0?b1.ceil(Se):b1(Se),Se=e0.offset(Se,(te.V-1)*7),te.y=Se.getFullYear(),te.m=Se.getMonth(),te.d=Se.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),Ge="Z"in te?OA(Ap(te.y,0,1)).getUTCDay():IA(Ap(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(Ge+5)%7:te.w+te.U*7-(Ge+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,OA(te)):IA(te)}}function P(ne,fe,ue,te){for(var Ve=0,Se=fe.length,Ge=ue.length,Ye,vt;Ve=Ge)return-1;if(Ye=fe.charCodeAt(Ve++),Ye===37){if(Ye=fe.charAt(Ve++),vt=T[Ye in m4?fe.charAt(Ve++):Ye],!vt||(te=vt(ne,ue,te))<0)return-1}else if(Ye!=ue.charCodeAt(te++))return-1}return te}function I(ne,fe,ue){var te=u.exec(fe.slice(ue));return te?(ne.p=c.get(te[0].toLowerCase()),ue+te[0].length):-1}function k(ne,fe,ue){var te=d.exec(fe.slice(ue));return te?(ne.w=v.get(te[0].toLowerCase()),ue+te[0].length):-1}function E(ne,fe,ue){var te=f.exec(fe.slice(ue));return te?(ne.w=h.get(te[0].toLowerCase()),ue+te[0].length):-1}function D(ne,fe,ue){var te=y.exec(fe.slice(ue));return te?(ne.m=_.get(te[0].toLowerCase()),ue+te[0].length):-1}function N(ne,fe,ue){var te=g.exec(fe.slice(ue));return te?(ne.m=m.get(te[0].toLowerCase()),ue+te[0].length):-1}function z(ne,fe,ue){return P(ne,t,fe,ue)}function F(ne,fe,ue){return P(ne,r,fe,ue)}function $(ne,fe,ue){return P(ne,n,fe,ue)}function Z(ne){return o[ne.getDay()]}function j(ne){return a[ne.getDay()]}function U(ne){return l[ne.getMonth()]}function G(ne){return s[ne.getMonth()]}function V(ne){return i[+(ne.getHours()>=12)]}function Y(ne){return 1+~~(ne.getMonth()/3)}function K(ne){return o[ne.getUTCDay()]}function ee(ne){return a[ne.getUTCDay()]}function le(ne){return l[ne.getUTCMonth()]}function he(ne){return s[ne.getUTCMonth()]}function Re(ne){return i[+(ne.getUTCHours()>=12)]}function ge(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var fe=C(ne+="",b);return fe.toString=function(){return ne},fe},parse:function(ne){var fe=A(ne+="",!1);return fe.toString=function(){return ne},fe},utcFormat:function(ne){var fe=C(ne+="",S);return fe.toString=function(){return ne},fe},utcParse:function(ne){var fe=A(ne+="",!0);return fe.toString=function(){return ne},fe}}}var m4={"-":"",_:" ",0:"0"},sn=/^\s*\d+/,FTe=/^%/,VTe=/[\\^$*+?|[\]().{}]/g;function At(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function WTe(e,t,r){var n=sn.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function HTe(e,t,r){var n=sn.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function UTe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function ZTe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function YTe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function y4(e,t,r){var n=sn.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function x4(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function XTe(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 qTe(e,t,r){var n=sn.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function KTe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function _4(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function JTe(e,t,r){var n=sn.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function b4(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function QTe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function eCe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function tCe(e,t,r){var n=sn.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function rCe(e,t,r){var n=sn.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function nCe(e,t,r){var n=FTe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function iCe(e,t,r){var n=sn.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function aCe(e,t,r){var n=sn.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function w4(e,t){return At(e.getDate(),t,2)}function oCe(e,t){return At(e.getHours(),t,2)}function sCe(e,t){return At(e.getHours()%12||12,t,2)}function lCe(e,t){return At(1+e0.count(Rs(e),e),t,3)}function IX(e,t){return At(e.getMilliseconds(),t,3)}function uCe(e,t){return IX(e,t)+"000"}function cCe(e,t){return At(e.getMonth()+1,t,2)}function fCe(e,t){return At(e.getMinutes(),t,2)}function hCe(e,t){return At(e.getSeconds(),t,2)}function dCe(e){var t=e.getDay();return t===0?7:t}function vCe(e,t){return At(iT.count(Rs(e)-1,e),t,2)}function OX(e){var t=e.getDay();return t>=4||t===0?Od(e):Od.ceil(e)}function pCe(e,t){return e=OX(e),At(Od.count(Rs(e),e)+(Rs(e).getDay()===4),t,2)}function gCe(e){return e.getDay()}function mCe(e,t){return At(b1.count(Rs(e)-1,e),t,2)}function yCe(e,t){return At(e.getFullYear()%100,t,2)}function xCe(e,t){return e=OX(e),At(e.getFullYear()%100,t,2)}function _Ce(e,t){return At(e.getFullYear()%1e4,t,4)}function bCe(e,t){var r=e.getDay();return e=r>=4||r===0?Od(e):Od.ceil(e),At(e.getFullYear()%1e4,t,4)}function wCe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+At(t/60|0,"0",2)+At(t%60,"0",2)}function S4(e,t){return At(e.getUTCDate(),t,2)}function SCe(e,t){return At(e.getUTCHours(),t,2)}function TCe(e,t){return At(e.getUTCHours()%12||12,t,2)}function CCe(e,t){return At(1+nT.count(Bs(e),e),t,3)}function EX(e,t){return At(e.getUTCMilliseconds(),t,3)}function ACe(e,t){return EX(e,t)+"000"}function MCe(e,t){return At(e.getUTCMonth()+1,t,2)}function PCe(e,t){return At(e.getUTCMinutes(),t,2)}function kCe(e,t){return At(e.getUTCSeconds(),t,2)}function LCe(e){var t=e.getUTCDay();return t===0?7:t}function ICe(e,t){return At(aT.count(Bs(e)-1,e),t,2)}function DX(e){var t=e.getUTCDay();return t>=4||t===0?Ed(e):Ed.ceil(e)}function OCe(e,t){return e=DX(e),At(Ed.count(Bs(e),e)+(Bs(e).getUTCDay()===4),t,2)}function ECe(e){return e.getUTCDay()}function DCe(e,t){return At(w1.count(Bs(e)-1,e),t,2)}function NCe(e,t){return At(e.getUTCFullYear()%100,t,2)}function jCe(e,t){return e=DX(e),At(e.getUTCFullYear()%100,t,2)}function RCe(e,t){return At(e.getUTCFullYear()%1e4,t,4)}function BCe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ed(e):Ed.ceil(e),At(e.getUTCFullYear()%1e4,t,4)}function zCe(){return"+0000"}function T4(){return"%"}function C4(e){return+e}function A4(e){return Math.floor(+e/1e3)}var Kf,NX,jX;$Ce({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 $Ce(e){return Kf=$Te(e),NX=Kf.format,Kf.parse,jX=Kf.utcFormat,Kf.utcParse,Kf}function FCe(e){return new Date(e)}function VCe(e){return e instanceof Date?+e:+new Date(+e)}function qD(e,t,r,n,i,a,o,s,l,u){var c=jD(),f=c.invert,h=c.domain,d=u(".%L"),v=u(":%S"),g=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),_=u("%b %d"),b=u("%B"),S=u("%Y");function T(C){return(l(C)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>ISe(e,a/n))},r.copy=function(){return $X(t).domain(e)},qs.apply(r,arguments)}function sT(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Vn,c,f=!1,h;function d(g){return isNaN(g=+g)?h:(g=.5+((g=+c(g))-a)*(n*gt}var qCe=XCe,KCe=WX,JCe=qCe,QCe=Pv;function eAe(e){return e&&e.length?KCe(e,QCe,JCe):void 0}var tAe=eAe;const Ml=$t(tAe);function rAe(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Kt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return Ts(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return Vt(Ts(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return Er(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(bi))throw Error(ha+"NaN");if(r.s<1)throw Error(ha+(r.s?"NaN":"-Infinity"));return r.eq(bi)?new n(0):(tr=!1,t=Ts(Fm(r,a),Fm(e,a),a),tr=!0,Vt(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?YX(t,e):UX(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ha+"NaN");return r.s?(tr=!1,t=Ts(r,e,0,1).times(e),tr=!0,r.minus(t)):Vt(new n(r),i)};je.naturalExponential=je.exp=function(){return ZX(this)};je.naturalLogarithm=je.ln=function(){return Fm(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?UX(t,e):YX(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Gc+e);if(t=Er(i)+1,n=i.d.length-1,r=n*Kt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ha+"NaN")}for(e=Er(s),tr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=bo(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ov((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Ts(s,a,o+2)).times(.5),bo(a.d).slice(0,o)===(t=bo(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Vt(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return tr=!0,Vt(n,r)};je.times=je.mul=function(e){var t,r,n,i,a,o,s,l,u,c=this,f=c.constructor,h=c.d,d=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,r=c.e+e.e,l=h.length,u=d.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+d[n]*h[i-n-1]+t,a[i--]=s%Qr|0,t=s/Qr|0;a[i]=(a[i]+t)%Qr|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,tr?Vt(e,f.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Ro(e,0,Iv),t===void 0?t=n.rounding:Ro(t,0,8),Vt(r,e+Er(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=sf(n,!0):(Ro(e,0,Iv),t===void 0?t=i.rounding:Ro(t,0,8),n=Vt(new i(n),e+1,t),r=sf(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?sf(i):(Ro(e,0,Iv),t===void 0?t=a.rounding:Ro(t,0,8),n=Vt(new a(i),e+Er(i)+1,t),r=sf(n.abs(),!1,e+Er(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return Vt(new t(e),Er(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(bi);if(s=new l(s),!s.s){if(e.s<1)throw Error(ha+"Infinity");return s}if(s.eq(bi))return s;if(n=l.precision,e.eq(bi))return Vt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=c<0?-c:c)<=HX){for(i=new l(bi),t=Math.ceil(n/Kt+4),tr=!1;r%2&&(i=i.times(s),k4(i.d,t)),r=Ov(r/2),r!==0;)s=s.times(s),k4(s.d,t);return tr=!0,e.s<0?new l(bi).div(i):Vt(i,n)}}else if(a<0)throw Error(ha+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,tr=!1,i=e.times(Fm(s,n+u)),tr=!0,i=ZX(i),i.s=a,i};je.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Er(i),n=sf(i,r<=a.toExpNeg||r>=a.toExpPos)):(Ro(e,1,Iv),t===void 0?t=a.rounding:Ro(t,0,8),i=Vt(new a(i),e,t),r=Er(i),n=sf(i,e<=r||r<=a.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Ro(e,1,Iv),t===void 0?t=n.rounding:Ro(t,0,8)),Vt(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Er(e),r=e.constructor;return sf(e,t<=r.toExpNeg||t>=r.toExpPos)};function UX(e,t){var r,n,i,a,o,s,l,u,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),tr?Vt(t,f):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(f/Kt),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/Qr|0,l[a]%=Qr;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,tr?Vt(t,f):t}function Ro(e,t,r){if(e!==~~e||er)throw Error(Gc+e)}function bo(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,c,f,h,d,v,g,m,y,_,b,S,T,C,A,P,I=n.constructor,k=n.s==i.s?1:-1,E=n.d,D=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(ha+"Division by zero");for(l=n.e-i.e,A=D.length,T=E.length,d=new I(k),v=d.d=[],u=0;D[u]==(E[u]||0);)++u;if(D[u]>(E[u]||0)&&--l,a==null?_=a=I.precision:o?_=a+(Er(n)-Er(i))+1:_=a,_<0)return new I(0);if(_=_/Kt+2|0,u=0,A==1)for(c=0,D=D[0],_++;(u1&&(D=e(D,c),E=e(E,c),A=D.length,T=E.length),S=A,g=E.slice(0,A),m=g.length;m=Qr/2&&++C;do c=0,s=t(D,g,A,m),s<0?(y=g[0],A!=m&&(y=y*Qr+(g[1]||0)),c=y/C|0,c>1?(c>=Qr&&(c=Qr-1),f=e(D,c),h=f.length,m=g.length,s=t(f,g,h,m),s==1&&(c--,r(f,A16)throw Error(QD+Er(e));if(!e.s)return new c(bi);for(tr=!1,s=f,o=new c(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(hc(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new c(bi),c.precision=s;;){if(i=Vt(i.times(e),s),r=r.times(++l),o=a.plus(Ts(i,r,s)),bo(o.d).slice(0,s)===bo(a.d).slice(0,s)){for(;u--;)a=Vt(a.times(a),s);return c.precision=f,t==null?(tr=!0,Vt(a,f)):a}a=o}}function Er(e){for(var t=e.e*Kt,r=e.d[0];r>=10;r/=10)t++;return t}function EA(e,t,r){if(t>e.LN10.sd())throw tr=!0,r&&(e.precision=r),Error(ha+"LN10 precision limit exceeded");return Vt(new e(e.LN10),t)}function yl(e){for(var t="";e--;)t+="0";return t}function Fm(e,t){var r,n,i,a,o,s,l,u,c,f=1,h=10,d=e,v=d.d,g=d.constructor,m=g.precision;if(d.s<1)throw Error(ha+(d.s?"NaN":"-Infinity"));if(d.eq(bi))return new g(0);if(t==null?(tr=!1,u=m):u=t,d.eq(10))return t==null&&(tr=!0),EA(g,u);if(u+=h,g.precision=u,r=bo(v),n=r.charAt(0),a=Er(d),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)d=d.times(e),r=bo(d.d),n=r.charAt(0),f++;a=Er(d),n>1?(d=new g("0."+r),a++):d=new g(n+"."+r.slice(1))}else return l=EA(g,u+2,m).times(a+""),d=Fm(new g(n+"."+r.slice(1)),u-h).plus(l),g.precision=m,t==null?(tr=!0,Vt(d,m)):d;for(s=o=d=Ts(d.minus(bi),d.plus(bi),u),c=Vt(d.times(d),u),i=3;;){if(o=Vt(o.times(c),u),l=s.plus(Ts(o,new g(i),u)),bo(l.d).slice(0,u)===bo(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(EA(g,u+2,m).times(a+""))),s=Ts(s,new g(f),u),g.precision=m,t==null?(tr=!0,Vt(s,m)):s;s=l,i+=2}}function P4(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Ov(r/Kt),e.d=[],n=(r+1)%Kt,r<0&&(n+=Kt),nS1||e.e<-S1))throw Error(QD+r)}else e.s=0,e.e=0,e.d=[0];return e}function Vt(e,t,r){var n,i,a,o,s,l,u,c,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=Kt,i=t,u=f[c=0];else{if(c=Math.ceil((n+1)/Kt),a=f.length,c>=a)return e;for(u=a=f[c],o=1;a>=10;a/=10)o++;n%=Kt,i=n-Kt+o}if(r!==void 0&&(a=hc(10,o-i-1),s=u/a%10|0,l=t<0||f[c+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/hc(10,o-i):0:f[c-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=Er(e),f.length=1,t=t-a-1,f[0]=hc(10,(Kt-t%Kt)%Kt),e.e=Ov(-t/Kt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=c,a=1,c--):(f.length=c+1,a=hc(10,Kt-n),f[c]=i>0?(u/hc(10,o-i)%hc(10,i)|0)*a:0),l)for(;;)if(c==0){(f[0]+=a)==Qr&&(f[0]=1,++e.e);break}else{if(f[c]+=a,f[c]!=Qr)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(tr&&(e.e>S1||e.e<-S1))throw Error(QD+Er(e));return e}function YX(e,t){var r,n,i,a,o,s,l,u,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),tr?Vt(t,d):t;if(l=e.d,f=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(c=o<0,c?(r=l,o=-o,s=f.length):(r=f,n=u,s=l.length),i=Math.max(Math.ceil(d/Kt),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=f.length,c=i0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+yl(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+yl(-i-1)+a,r&&(n=r-o)>0&&(a+=yl(n))):i>=o?(a+=yl(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+yl(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=yl(n))),e.s<0?"-"+a:a}function k4(e,t){if(e.length>t)return e.length=t,!0}function XX(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Gc+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return P4(o,a.toString())}else if(typeof a!="string")throw Error(Gc+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,TAe.test(a))P4(o,a);else throw Error(Gc+a)}if(i.prototype=je,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=XX,i.config=i.set=CAe,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Gc+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Gc+r+": "+n);return this}var eN=XX(SAe);bi=new eN(1);const Bt=eN;function AAe(e){return LAe(e)||kAe(e)||PAe(e)||MAe()}function MAe(){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 PAe(e,t){if(e){if(typeof e=="string")return Xk(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 Xk(e,t)}}function kAe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function LAe(e){if(Array.isArray(e))return Xk(e)}function Xk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,L4(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function HAe(e){if(Array.isArray(e))return e}function eq(e){var t=Vm(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function tq(e,t,r){if(e.lte(0))return new Bt(0);var n=cT.getDigitCount(e.toNumber()),i=new Bt(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Bt(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Bt(Math.ceil(l))}function UAe(e,t,r){var n=1,i=new Bt(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Bt(10).pow(cT.getDigitCount(e)-1),i=new Bt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Bt(Math.floor(e)))}else e===0?i=new Bt(Math.floor((t-1)/2)):r||(i=new Bt(Math.floor(e)));var o=Math.floor((t-1)/2),s=DAe(EAe(function(l){return i.add(new Bt(l-o).mul(n)).toNumber()}),qk);return s(0,t)}function rq(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Bt(0),tickMin:new Bt(0),tickMax:new Bt(0)};var a=tq(new Bt(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Bt(0):(o=new Bt(e).add(t).div(2),o=o.sub(new Bt(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Bt(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?rq(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Bt(s).mul(a)),tickMax:o.add(new Bt(l).mul(a))})}function ZAe(e){var t=Vm(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=eq([r,n]),l=Vm(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(Jk(qk(0,i-1).map(function(){return 1/0}))):[].concat(Jk(qk(0,i-1).map(function(){return-1/0})),[c]);return r>n?Kk(f):f}if(u===c)return UAe(u,i,a);var h=rq(u,c,o,a),d=h.step,v=h.tickMin,g=h.tickMax,m=cT.rangeStep(v,g.add(new Bt(.1).mul(d)),d);return r>n?Kk(m):m}function YAe(e,t){var r=Vm(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=eq([n,i]),s=Vm(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var c=Math.max(t,2),f=tq(new Bt(u).sub(l).div(c-1),a,0),h=[].concat(Jk(cT.rangeStep(new Bt(l),new Bt(u).sub(new Bt(.99).mul(f)),f)),[u]);return n>i?Kk(h):h}var XAe=JX(ZAe),qAe=JX(YAe),KAe="Invariant failed";function lf(e,t){throw new Error(KAe)}var JAe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Nd(e){"@babel/helpers - typeof";return Nd=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},Nd(e)}function T1(){return T1=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 a2e(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 o2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s2e(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,f=i[u].coordinate,h=u>=s-1?i[0].coordinate:i[u+1].coordinate,d=void 0;if(Ra(f-c)!==Ra(h-f)){var v=[];if(Ra(h-f)===Ra(l[1]-l[0])){d=h;var g=f+l[1]-l[0];v[0]=Math.min(g,(g+c)/2),v[1]=Math.max(g,(g+c)/2)}else{d=c;var m=h+l[1]-l[0];v[0]=Math.min(f,(m+f)/2),v[1]=Math.max(f,(m+f)/2)}var y=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(t>y[0]&&t<=y[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var _=Math.min(c,h),b=Math.max(c,h);if(t>(_+f)/2&&t<=(b+f)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},tN=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?vr(vr({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},T2e=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(y&&y.length){var _=y[0].type.defaultProps,b=_!==void 0?vr(vr({},_),y[0].props):y[0].props,S=b.barSize,T=b[m];o[T]||(o[T]=[]);var C=dt(S)?r:S;o[T].push({item:y[0],stackList:y.slice(1),barSize:dt(C)?void 0:of(C,n,0)})}}return o},C2e=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=of(r,i,0,!0),c,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/l,v=o.reduce(function(S,T){return S+T.barSize||0},0);v+=(l-1)*u,v>=i&&(v-=(l-1)*u,u=0),v>=i&&d>0&&(h=!0,d*=.9,v=l*d);var g=(i-v)/2>>0,m={offset:g-u,size:0};c=o.reduce(function(S,T){var C={item:T.item,position:{offset:m.offset+m.size+u,size:h?d:T.barSize}},A=[].concat(E4(S),[C]);return m=A[A.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){A.push({item:P,position:m})}),A},f)}else{var y=of(n,i,0,!0);i-2*y-(l-1)*u<=0&&(u=0);var _=(i-2*y-(l-1)*u)/l;_>1&&(_>>=0);var b=s===+s?Math.min(_,s):_;c=o.reduce(function(S,T,C){var A=[].concat(E4(S),[{item:T.item,position:{offset:y+(_+u)*C+(_-b)/2,size:b}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){A.push({item:P,position:A[A.length-1].position})}),A},f)}return c},A2e=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=oq({children:a,legendWidth:l});if(u){var c=i||{},f=c.width,h=c.height,d=u.align,v=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&v==="middle")&&d!=="center"&&we(t[d]))return vr(vr({},t),{},ud({},d,t[d]+(f||0)));if((g==="horizontal"||g==="vertical"&&d==="center")&&v!=="middle"&&we(t[v]))return vr(vr({},t),{},ud({},v,t[v]+(h||0)))}return t},M2e=function(t,r,n){return dt(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},sq=function(t,r,n,i,a){var o=r.props.children,s=sa(o,t0).filter(function(u){return M2e(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,c){var f=Hn(c,n);if(dt(f))return u;var h=Array.isArray(f)?[lT(f),Ml(f)]:[f,f],d=l.reduce(function(v,g){var m=Hn(c,g,0),y=h[0]-Math.abs(Array.isArray(m)?m[0]:m),_=h[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(y,v[0]),Math.max(_,v[1])]},[1/0,-1/0]);return[Math.min(d[0],u[0]),Math.max(d[1],u[1])]},[1/0,-1/0])}return null},P2e=function(t,r,n,i,a){var o=r.map(function(s){return sq(t,s,n,a,i)}).filter(function(s){return!dt(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},lq=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&sq(t,l,u,i)||Fg(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var c=0,f=u.length;c=2?Ra(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return c.filter(function(f){return!Tv(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},DA=new WeakMap,mx=function(t,r){if(typeof r!="function")return t;DA.has(t)||DA.set(t,new WeakMap);var n=DA.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},k2e=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:jm(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:x1(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:$g(),realScaleType:"point"}:a==="category"?{scale:jm(),realScaleType:"band"}:{scale:x1(),realScaleType:"linear"};if(af(i)){var l="scale".concat(XS(i));return{scale:(M4[l]||$g)(),realScaleType:M4[l]?l:"point"}}return ft(i)?{scale:i}:{scale:$g(),realScaleType:"point"}},N4=1e-4,L2e=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-N4,o=Math.max(i[0],i[1])+N4,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},I2e=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},D2e=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},N2e={sign:E2e,expand:Xpe,none:Ad,silhouette:qpe,wiggle:Kpe,positive:D2e},j2e=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=N2e[n],o=Ype().keys(i).value(function(s,l){return+Hn(s,l,0)}).order(Ak).offset(a);return o(t)},R2e=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(f,h){var d,v=(d=h.type)!==null&&d!==void 0&&d.defaultProps?vr(vr({},h.type.defaultProps),h.props):h.props,g=v.stackId,m=v.hide;if(m)return f;var y=v[n],_=f[y]||{hasStack:!1,stackGroups:{}};if(Vr(g)){var b=_.stackGroups[g]||{numericAxisId:n,cateAxisId:i,items:[]};b.items.push(h),_.hasStack=!0,_.stackGroups[g]=b}else _.stackGroups[Cv("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return vr(vr({},f),{},ud({},y,_))},l),c={};return Object.keys(u).reduce(function(f,h){var d=u[h];if(d.hasStack){var v={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(g,m){var y=d.stackGroups[m];return vr(vr({},g),{},ud({},m,{numericAxisId:n,cateAxisId:i,items:y.items,stackedData:j2e(t,y.items,a)}))},v)}return vr(vr({},f),{},ud({},h,d))},c)},B2e=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var c=XAe(u,a,s);return t.domain([lT(c),Ml(c)]),{niceTicks:c}}if(a&&i==="number"){var f=t.domain(),h=qAe(f,a,s);return{niceTicks:h}}return null};function A1(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!dt(i[t.dataKey])){var s=Xb(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Hn(i,dt(o)?t.dataKey:o);return dt(l)?null:t.scale(l)}var j4=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Hn(o,r.dataKey,r.domain[s]);return dt(l)?null:r.scale(l)-a/2+i},z2e=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},$2e=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?vr(vr({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Vr(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},F2e=function(t){return t.reduce(function(r,n){return[lT(n.concat([r[0]]).filter(we)),Ml(n.concat([r[1]]).filter(we))]},[1/0,-1/0])},cq=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,c){var f=F2e(c.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},R4=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,B4=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,rL=function(t,r,n){if(ft(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(we(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(R4.test(t[0])){var a=+R4.exec(t[0])[1];i[0]=r[0]-a}else ft(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(we(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(B4.test(t[1])){var o=+B4.exec(t[1])[1];i[1]=r[1]+o}else ft(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},M1=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=kD(r,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;so&&(u=2*Math.PI-u),{radius:s,angle:H2e(u),angleInRadian:u}},Y2e=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},X2e=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},V4=function(t,r){var n=t.x,i=t.y,a=Z2e({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var c=Y2e(r),f=c.startAngle,h=c.endAngle,d=s,v;if(f<=h){for(;d>h;)d-=360;for(;d=f&&d<=h}else{for(;d>f;)d-=360;for(;d=h&&d<=f}return v?F4(F4({},r),{},{radius:o,angle:X2e(d,r)}):null};function Um(e){"@babel/helpers - typeof";return Um=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},Um(e)}var q2e=["offset"];function K2e(e){return tMe(e)||eMe(e)||Q2e(e)||J2e()}function J2e(){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 Q2e(e,t){if(e){if(typeof e=="string")return nL(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 nL(e,t)}}function eMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tMe(e){if(Array.isArray(e))return nL(e)}function nL(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 nMe(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 G4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t=0?1:-1,b,S;i==="insideStart"?(b=d+_*o,S=g):i==="insideEnd"?(b=v-_*o,S=!g):i==="end"&&(b=v+_*o,S=g),S=y<=0?S:!S;var T=vn(u,c,m,b),C=vn(u,c,m,b+(S?1:-1)*359),A="M".concat(T.x,",").concat(T.y,` + height and width.`,F,$,o,l,c,f,r);var Z=!Array.isArray(d)&&Cs(d.type).endsWith("Chart");return Q.Children.map(d,function(j){return Q.isValidElement(j)?W.cloneElement(j,px({width:F,height:$},Z?{style:px({height:"100%",width:"100%",maxHeight:$,maxWidth:F},j.props.style)}:{})):j})},[r,d,l,h,f,c,I,o]);return Q.createElement("div",{id:m?"".concat(m):void 0,className:_t("recharts-responsive-container",x),style:px(px({},S),{},{width:o,height:l,minWidth:c,minHeight:f,maxHeight:h}),ref:T},D)}),fX=function(t){return null};fX.displayName="Cell";function jm(e){"@babel/helpers - typeof";return jm=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},jm(e)}function jz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hk(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Cf.isSsr)return{width:0,height:0};var n=Jwe(r),i=JSON.stringify({text:t,copyStyle:n});if(qf.widthCache[i])return qf.widthCache[i];try{var a=document.getElementById(Rz);a||(a=document.createElement("span"),a.setAttribute("id",Rz),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Hk(Hk({},Kwe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return qf.widthCache[i]=l,++qf.cacheCount>qwe&&(qf.cacheCount=0,qf.widthCache={}),l}catch{return{width:0,height:0}}},Qwe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Rm(e){"@babel/helpers - typeof";return Rm=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},Rm(e)}function d1(e,t){return nSe(e)||rSe(e,t)||tSe(e,t)||eSe()}function eSe(){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 tSe(e,t){if(e){if(typeof e=="string")return Bz(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 Bz(e,t)}}function Bz(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 mSe(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 Wz(e,t){return bSe(e)||_Se(e,t)||xSe(e,t)||ySe()}function ySe(){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 xSe(e,t){if(e){if(typeof e=="string")return Hz(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 Hz(e,t)}}function Hz(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 F.reduce(function($,Z){var j=Z.word,U=Z.width,G=$[$.length-1];if(G&&(i==null||a||G.width+U+nZ.width?$:Z})};if(!c)return d;for(var g="…",m=function(F){var $=f.slice(0,F),Z=pX({breakAll:u,style:l,children:$+g}).wordsWithComputedWidth,j=h(Z),U=j.length>o||v(j).width>Number(i);return[U,j]},x=0,_=f.length-1,b=0,S;x<=_&&b<=f.length-1;){var T=Math.floor((x+_)/2),C=T-1,A=m(C),P=Wz(A,2),I=P[0],k=P[1],E=m(T),D=Wz(E,1),N=D[0];if(!I&&!N&&(x=T+1),I&&N&&(_=T-1),!I&&N){S=k;break}b++}return S||d},Uz=function(t){var r=dt(t)?[]:t.toString().split(vX);return[{words:r}]},SSe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Cf.isSsr){var l,u,c=pX({breakAll:o,children:i,style:a});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;l=f,u=h}else return Uz(i);return wSe({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return Uz(i)},Zz="#808080",v1=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,f=c===void 0?!1:c,h=t.textAnchor,d=h===void 0?"start":h,v=t.verticalAnchor,g=v===void 0?"end":v,m=t.fill,x=m===void 0?Zz:m,_=Gz(t,pSe),b=W.useMemo(function(){return SSe({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:f,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,f,_.style,_.width]),S=_.dx,T=_.dy,C=_.angle,A=_.className,P=_.breakAll,I=Gz(_,gSe);if(!Vr(n)||!Vr(a))return null;var k=n+(we(S)?S:0),E=a+(we(T)?T:0),D;switch(g){case"start":D=PA("calc(".concat(u,")"));break;case"middle":D=PA("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:D=PA("calc(".concat(b.length-1," * -").concat(s,")"));break}var N=[];if(f){var z=b[0].width,F=_.width;N.push("scale(".concat((we(F)?F/z:1)/z,")"))}return C&&N.push("rotate(".concat(C,", ").concat(k,", ").concat(E,")")),N.length&&(I.transform=N.join(" ")),Q.createElement("text",Uk({},ct(I,!0),{x:k,y:E,className:_t("recharts-text",A),textAnchor:d,fill:x.includes("url")?Zz:x}),b.map(function($,Z){var j=$.words.join(P?"":" ");return Q.createElement("tspan",{x:k,dy:Z===0?D:s,key:"".concat(j,"-").concat(Z)},j)}))};function Zl(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function TSe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ND(e){let t,r,n;e.length!==2?(t=Zl,r=(s,l)=>Zl(e(s),l),n=(s,l)=>e(s)-l):(t=e===Zl||e===TSe?e:CSe,r=e,n=e);function i(s,l,u=0,c=s.length){if(u>>1;r(s[f],l)<0?u=f+1:c=f}while(u>>1;r(s[f],l)<=0?u=f+1:c=f}while(uu&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function CSe(){return 0}function gX(e){return e===null?NaN:+e}function*ASe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const MSe=ND(Zl),e0=MSe.right;ND(gX).center;class Yz extends Map{constructor(t,r=LSe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Xz(this,t))}has(t){return super.has(Xz(this,t))}set(t,r){return super.set(PSe(this,t),r)}delete(t){return super.delete(kSe(this,t))}}function Xz({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function PSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function kSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function LSe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ISe(e=Zl){if(e===Zl)return mX;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 mX(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const OSe=Math.sqrt(50),ESe=Math.sqrt(10),DSe=Math.sqrt(2);function p1(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=OSe?10:a>=ESe?5:a>=DSe?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function Kz(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function yX(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?mX:ISe(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),d=Math.max(r,Math.floor(t-u*f/l+h)),v=Math.min(n,Math.floor(t+(l-u)*f/l+h));yX(e,t,d,v,i)}const a=e[t];let o=r,s=n;for(Mp(e,r,t),i(e[n],a)>0&&Mp(e,r,n);o0;)--s}i(e[r],a)===0?Mp(e,r,s):(++s,Mp(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Mp(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function NSe(e,t,r){if(e=Float64Array.from(ASe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Kz(e);if(t>=1)return qz(e);var n,i=(n-1)*t,a=Math.floor(i),o=qz(yX(e,a).subarray(0,a+1)),s=Kz(e.subarray(a+1));return o+(s-o)*(i-a)}}function jSe(e,t,r=gX){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function RSe(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?mx(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?mx(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=zSe.exec(e))?new ii(t[1],t[2],t[3],1):(t=$Se.exec(e))?new ii(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=FSe.exec(e))?mx(t[1],t[2],t[3],t[4]):(t=VSe.exec(e))?mx(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=GSe.exec(e))?i4(t[1],t[2]/100,t[3]/100,1):(t=WSe.exec(e))?i4(t[1],t[2]/100,t[3]/100,t[4]):Jz.hasOwnProperty(e)?t4(Jz[e]):e==="transparent"?new ii(NaN,NaN,NaN,0):null}function t4(e){return new ii(e>>16&255,e>>8&255,e&255,1)}function mx(e,t,r,n){return n<=0&&(e=t=r=NaN),new ii(e,t,r,n)}function ZSe(e){return e instanceof t0||(e=Fm(e)),e?(e=e.rgb(),new ii(e.r,e.g,e.b,e.opacity)):new ii}function Kk(e,t,r,n){return arguments.length===1?ZSe(e):new ii(e,t,r,n??1)}function ii(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}RD(ii,Kk,_X(t0,{brighter(e){return e=e==null?g1:Math.pow(g1,e),new ii(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zm:Math.pow(zm,e),new ii(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ii(Vc(this.r),Vc(this.g),Vc(this.b),m1(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:r4,formatHex:r4,formatHex8:YSe,formatRgb:n4,toString:n4}));function r4(){return`#${Pc(this.r)}${Pc(this.g)}${Pc(this.b)}`}function YSe(){return`#${Pc(this.r)}${Pc(this.g)}${Pc(this.b)}${Pc((isNaN(this.opacity)?1:this.opacity)*255)}`}function n4(){const e=m1(this.opacity);return`${e===1?"rgb(":"rgba("}${Vc(this.r)}, ${Vc(this.g)}, ${Vc(this.b)}${e===1?")":`, ${e})`}`}function m1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pc(e){return e=Vc(e),(e<16?"0":"")+e.toString(16)}function i4(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ra(e,t,r,n)}function bX(e){if(e instanceof Ra)return new Ra(e.h,e.s,e.l,e.opacity);if(e instanceof t0||(e=Fm(e)),!e)return new Ra;if(e instanceof Ra)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new Ra(o,s,l,e.opacity)}function XSe(e,t,r,n){return arguments.length===1?bX(e):new Ra(e,t,r,n??1)}function Ra(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}RD(Ra,XSe,_X(t0,{brighter(e){return e=e==null?g1:Math.pow(g1,e),new Ra(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zm:Math.pow(zm,e),new Ra(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new ii(kA(e>=240?e-240:e+120,i,n),kA(e,i,n),kA(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Ra(a4(this.h),yx(this.s),yx(this.l),m1(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=m1(this.opacity);return`${e===1?"hsl(":"hsla("}${a4(this.h)}, ${yx(this.s)*100}%, ${yx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function a4(e){return e=(e||0)%360,e<0?e+360:e}function yx(e){return Math.max(0,Math.min(1,e||0))}function kA(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 BD=e=>()=>e;function qSe(e,t){return function(r){return e+r*t}}function KSe(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 JSe(e){return(e=+e)==1?wX:function(t,r){return r-t?KSe(t,r,e):BD(isNaN(t)?r:t)}}function wX(e,t){var r=t-e;return r?qSe(e,r):BD(isNaN(e)?t:e)}const o4=function e(t){var r=JSe(t);function n(i,a){var o=r((i=Kk(i)).r,(a=Kk(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=wX(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n}(1);function QSe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:y1(n,i)})),r=LA.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function cTe(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?fTe:cTe,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=s(e.map(n),t,r)))(n(o(h)))}return f.invert=function(h){return o(i((u||(u=s(t,e.map(n),y1)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,x1),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=zD,c()},f.clamp=function(h){return arguments.length?(o=h?!0:Vn,c()):o!==Vn},f.interpolate=function(h){return arguments.length?(r=h,c()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return n=h,i=d,c()}}function $D(){return aT()(Vn,Vn)}function hTe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _1(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 Id(e){return e=_1(Math.abs(e)),e?e[1]:NaN}function dTe(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function vTe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var pTe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vm(e){if(!(t=pTe.exec(e)))throw new Error("invalid format: "+e);var t;return new FD({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]})}Vm.prototype=FD.prototype;function FD(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+""}FD.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 gTe(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var b1;function mTe(e,t){var r=_1(e,t);if(!r)return b1=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(b1=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+_1(e,Math.max(0,t+a-1))[0]}function l4(e,t){var r=_1(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const u4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:hTe,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)=>l4(e*100,t),r:l4,s:mTe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function c4(e){return e}var f4=Array.prototype.map,h4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yTe(e){var t=e.grouping===void 0||e.thousands===void 0?c4:dTe(f4.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?c4:vTe(f4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=Vm(f);var d=f.fill,v=f.align,g=f.sign,m=f.symbol,x=f.zero,_=f.width,b=f.comma,S=f.precision,T=f.trim,C=f.type;C==="n"?(b=!0,C="g"):u4[C]||(S===void 0&&(S=12),T=!0,C="g"),(x||d==="0"&&v==="=")&&(x=!0,d="0",v="=");var A=(h&&h.prefix!==void 0?h.prefix:"")+(m==="$"?r:m==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),P=(m==="$"?n:/[%p]/.test(C)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),I=u4[C],k=/[defgprs%]/.test(C);S=S===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function E(D){var N=A,z=P,F,$,Z;if(C==="c")z=I(D)+z,D="";else{D=+D;var j=D<0||1/D<0;if(D=isNaN(D)?l:I(Math.abs(D),S),T&&(D=gTe(D)),j&&+D==0&&g!=="+"&&(j=!1),N=(j?g==="("?g:s:g==="-"||g==="("?"":g)+N,z=(C==="s"&&!isNaN(D)&&b1!==void 0?h4[8+b1/3]:"")+z+(j&&g==="("?")":""),k){for(F=-1,$=D.length;++F<$;)if(Z=D.charCodeAt(F),48>Z||Z>57){z=(Z===46?i+D.slice(F+1):D.slice(F))+z,D=D.slice(0,F);break}}}b&&!x&&(D=t(D,1/0));var U=N.length+D.length+z.length,G=U<_?new Array(_-U+1).join(d):"";switch(b&&x&&(D=t(G+D,G.length?_-z.length:1/0),G=""),v){case"<":D=N+D+z+G;break;case"=":D=N+G+D+z;break;case"^":D=G.slice(0,U=G.length>>1)+N+D+z+G.slice(U);break;default:D=G+N+D+z;break}return a(D)}return E.toString=function(){return f+""},E}function c(f,h){var d=Math.max(-8,Math.min(8,Math.floor(Id(h)/3)))*3,v=Math.pow(10,-d),g=u((f=Vm(f),f.type="f",f),{suffix:h4[8+d/3]});return function(m){return g(v*m)}}return{format:u,formatPrefix:c}}var xx,VD,SX;xTe({thousands:",",grouping:[3],currency:["$",""]});function xTe(e){return xx=yTe(e),VD=xx.format,SX=xx.formatPrefix,xx}function _Te(e){return Math.max(0,-Id(Math.abs(e)))}function bTe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Id(t)/3)))*3-Id(Math.abs(e)))}function wTe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Id(t)-Id(e))+1}function TX(e,t,r,n){var i=Xk(e,t,r),a;switch(n=Vm(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=bTe(i,o))&&(n.precision=a),SX(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=wTe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=_Te(i))&&(n.precision=a-(n.type==="%")*2);break}}return VD(n)}function _u(e){var t=e.domain;return e.ticks=function(r){var n=t();return Zk(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return TX(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,c=10;for(s0;){if(u=Yk(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function w1(){var e=$D();return e.copy=function(){return r0(e,w1())},ya.apply(e,arguments),_u(e)}function CX(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,x1),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return CX(e).unknown(t)},e=arguments.length?Array.from(e,x1):[0,1],_u(r)}function AX(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function MTe(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 p4(e){return(t,r)=>-e(-t,r)}function GD(e){const t=e(d4,v4),r=t.domain;let n=10,i,a;function o(){return i=MTe(n),a=ATe(n),r()[0]<0?(i=p4(i),a=p4(a),e(STe,TTe)):e(d4,v4),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],c=l[l.length-1];const f=c0){for(;h<=d;++h)for(v=1;vc)break;x.push(g)}}else for(;h<=d;++h)for(v=n-1;v>=1;--v)if(g=h>0?v/a(-h):v*a(h),!(gc)break;x.push(g)}x.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Vm(l)).precision==null&&(l.trim=!0),l=VD(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return c=>{let f=c/a(Math.round(i(c)));return f*nr(AX(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function MX(){const e=GD(aT()).domain([1,10]);return e.copy=()=>r0(e,MX()).base(e.base()),ya.apply(e,arguments),e}function g4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function m4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function WD(e){var t=1,r=e(g4(t),m4(t));return r.constant=function(n){return arguments.length?e(g4(t=+n),m4(t)):t},_u(r)}function PX(){var e=WD(aT());return e.copy=function(){return r0(e,PX()).constant(e.constant())},ya.apply(e,arguments)}function y4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function PTe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function kTe(e){return e<0?-e*e:e*e}function HD(e){var t=e(Vn,Vn),r=1;function n(){return r===1?e(Vn,Vn):r===.5?e(PTe,kTe):e(y4(r),y4(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},_u(t)}function UD(){var e=HD(aT());return e.copy=function(){return r0(e,UD()).exponent(e.exponent())},ya.apply(e,arguments),e}function LTe(){return UD.apply(null,arguments).exponent(.5)}function x4(e){return Math.sign(e)*e*e}function ITe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function kX(){var e=$D(),t=[0,1],r=!1,n;function i(a){var o=ITe(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(x4(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,x1)).map(x4)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return kX(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ya.apply(i,arguments),_u(i)}function LX(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return IX().domain([e,t]).range(i).unknown(a)},ya.apply(_u(o),arguments)}function OX(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[e0(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return OX().domain(e).range(t).unknown(r)},ya.apply(i,arguments)}const IA=new Date,OA=new Date;function Zr(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uZr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(IA.setTime(+a),OA.setTime(+o),e(IA),e(OA),Math.floor(r(IA,OA))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const S1=Zr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);S1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):S1);S1.range;const ms=1e3,na=ms*60,ys=na*60,Bs=ys*24,ZD=Bs*7,_4=Bs*30,EA=Bs*365,kc=Zr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ms)},(e,t)=>(t-e)/ms,e=>e.getUTCSeconds());kc.range;const YD=Zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ms)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getMinutes());YD.range;const XD=Zr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getUTCMinutes());XD.range;const qD=Zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ms-e.getMinutes()*na)},(e,t)=>{e.setTime(+e+t*ys)},(e,t)=>(t-e)/ys,e=>e.getHours());qD.range;const KD=Zr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ys)},(e,t)=>(t-e)/ys,e=>e.getUTCHours());KD.range;const n0=Zr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*na)/Bs,e=>e.getDate()-1);n0.range;const oT=Zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Bs,e=>e.getUTCDate()-1);oT.range;const EX=Zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Bs,e=>Math.floor(e/Bs));EX.range;function Af(e){return Zr(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())*na)/ZD)}const sT=Af(0),T1=Af(1),OTe=Af(2),ETe=Af(3),Od=Af(4),DTe=Af(5),NTe=Af(6);sT.range;T1.range;OTe.range;ETe.range;Od.range;DTe.range;NTe.range;function Mf(e){return Zr(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)/ZD)}const lT=Mf(0),C1=Mf(1),jTe=Mf(2),RTe=Mf(3),Ed=Mf(4),BTe=Mf(5),zTe=Mf(6);lT.range;C1.range;jTe.range;RTe.range;Ed.range;BTe.range;zTe.range;const JD=Zr(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());JD.range;const QD=Zr(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());QD.range;const zs=Zr(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());zs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zr(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)});zs.range;const $s=Zr(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());$s.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zr(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)});$s.range;function DX(e,t,r,n,i,a){const o=[[kc,1,ms],[kc,5,5*ms],[kc,15,15*ms],[kc,30,30*ms],[a,1,na],[a,5,5*na],[a,15,15*na],[a,30,30*na],[i,1,ys],[i,3,3*ys],[i,6,6*ys],[i,12,12*ys],[n,1,Bs],[n,2,2*Bs],[r,1,ZD],[t,1,_4],[t,3,3*_4],[e,1,EA]];function s(u,c,f){const h=cm).right(o,h);if(d===o.length)return e.every(Xk(u/EA,c/EA,f));if(d===0)return S1.every(Math.max(Xk(u,c,f),1));const[v,g]=o[h/o[d-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(Se=NA(Pp(te.y,0,1)),Ge=Se.getUTCDay(),Se=Ge>4||Ge===0?C1.ceil(Se):C1(Se),Se=oT.offset(Se,(te.V-1)*7),te.y=Se.getUTCFullYear(),te.m=Se.getUTCMonth(),te.d=Se.getUTCDate()+(te.w+6)%7):(Se=DA(Pp(te.y,0,1)),Ge=Se.getDay(),Se=Ge>4||Ge===0?T1.ceil(Se):T1(Se),Se=n0.offset(Se,(te.V-1)*7),te.y=Se.getFullYear(),te.m=Se.getMonth(),te.d=Se.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),Ge="Z"in te?NA(Pp(te.y,0,1)).getUTCDay():DA(Pp(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(Ge+5)%7:te.w+te.U*7-(Ge+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,NA(te)):DA(te)}}function P(ne,fe,ue,te){for(var Ve=0,Se=fe.length,Ge=ue.length,Ye,vt;Ve=Ge)return-1;if(Ye=fe.charCodeAt(Ve++),Ye===37){if(Ye=fe.charAt(Ve++),vt=T[Ye in b4?fe.charAt(Ve++):Ye],!vt||(te=vt(ne,ue,te))<0)return-1}else if(Ye!=ue.charCodeAt(te++))return-1}return te}function I(ne,fe,ue){var te=u.exec(fe.slice(ue));return te?(ne.p=c.get(te[0].toLowerCase()),ue+te[0].length):-1}function k(ne,fe,ue){var te=d.exec(fe.slice(ue));return te?(ne.w=v.get(te[0].toLowerCase()),ue+te[0].length):-1}function E(ne,fe,ue){var te=f.exec(fe.slice(ue));return te?(ne.w=h.get(te[0].toLowerCase()),ue+te[0].length):-1}function D(ne,fe,ue){var te=x.exec(fe.slice(ue));return te?(ne.m=_.get(te[0].toLowerCase()),ue+te[0].length):-1}function N(ne,fe,ue){var te=g.exec(fe.slice(ue));return te?(ne.m=m.get(te[0].toLowerCase()),ue+te[0].length):-1}function z(ne,fe,ue){return P(ne,t,fe,ue)}function F(ne,fe,ue){return P(ne,r,fe,ue)}function $(ne,fe,ue){return P(ne,n,fe,ue)}function Z(ne){return o[ne.getDay()]}function j(ne){return a[ne.getDay()]}function U(ne){return l[ne.getMonth()]}function G(ne){return s[ne.getMonth()]}function V(ne){return i[+(ne.getHours()>=12)]}function Y(ne){return 1+~~(ne.getMonth()/3)}function K(ne){return o[ne.getUTCDay()]}function ee(ne){return a[ne.getUTCDay()]}function le(ne){return l[ne.getUTCMonth()]}function he(ne){return s[ne.getUTCMonth()]}function Re(ne){return i[+(ne.getUTCHours()>=12)]}function ge(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var fe=C(ne+="",b);return fe.toString=function(){return ne},fe},parse:function(ne){var fe=A(ne+="",!1);return fe.toString=function(){return ne},fe},utcFormat:function(ne){var fe=C(ne+="",S);return fe.toString=function(){return ne},fe},utcParse:function(ne){var fe=A(ne+="",!0);return fe.toString=function(){return ne},fe}}}var b4={"-":"",_:" ",0:"0"},sn=/^\s*\d+/,HTe=/^%/,UTe=/[\\^$*+?|[\]().{}]/g;function At(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function YTe(e,t,r){var n=sn.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function XTe(e,t,r){var n=sn.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function qTe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function KTe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function JTe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function w4(e,t,r){var n=sn.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function S4(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function QTe(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 eCe(e,t,r){var n=sn.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function tCe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function T4(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function rCe(e,t,r){var n=sn.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function C4(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function nCe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function iCe(e,t,r){var n=sn.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function aCe(e,t,r){var n=sn.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function oCe(e,t,r){var n=sn.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function sCe(e,t,r){var n=HTe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function lCe(e,t,r){var n=sn.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function uCe(e,t,r){var n=sn.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function A4(e,t){return At(e.getDate(),t,2)}function cCe(e,t){return At(e.getHours(),t,2)}function fCe(e,t){return At(e.getHours()%12||12,t,2)}function hCe(e,t){return At(1+n0.count(zs(e),e),t,3)}function NX(e,t){return At(e.getMilliseconds(),t,3)}function dCe(e,t){return NX(e,t)+"000"}function vCe(e,t){return At(e.getMonth()+1,t,2)}function pCe(e,t){return At(e.getMinutes(),t,2)}function gCe(e,t){return At(e.getSeconds(),t,2)}function mCe(e){var t=e.getDay();return t===0?7:t}function yCe(e,t){return At(sT.count(zs(e)-1,e),t,2)}function jX(e){var t=e.getDay();return t>=4||t===0?Od(e):Od.ceil(e)}function xCe(e,t){return e=jX(e),At(Od.count(zs(e),e)+(zs(e).getDay()===4),t,2)}function _Ce(e){return e.getDay()}function bCe(e,t){return At(T1.count(zs(e)-1,e),t,2)}function wCe(e,t){return At(e.getFullYear()%100,t,2)}function SCe(e,t){return e=jX(e),At(e.getFullYear()%100,t,2)}function TCe(e,t){return At(e.getFullYear()%1e4,t,4)}function CCe(e,t){var r=e.getDay();return e=r>=4||r===0?Od(e):Od.ceil(e),At(e.getFullYear()%1e4,t,4)}function ACe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+At(t/60|0,"0",2)+At(t%60,"0",2)}function M4(e,t){return At(e.getUTCDate(),t,2)}function MCe(e,t){return At(e.getUTCHours(),t,2)}function PCe(e,t){return At(e.getUTCHours()%12||12,t,2)}function kCe(e,t){return At(1+oT.count($s(e),e),t,3)}function RX(e,t){return At(e.getUTCMilliseconds(),t,3)}function LCe(e,t){return RX(e,t)+"000"}function ICe(e,t){return At(e.getUTCMonth()+1,t,2)}function OCe(e,t){return At(e.getUTCMinutes(),t,2)}function ECe(e,t){return At(e.getUTCSeconds(),t,2)}function DCe(e){var t=e.getUTCDay();return t===0?7:t}function NCe(e,t){return At(lT.count($s(e)-1,e),t,2)}function BX(e){var t=e.getUTCDay();return t>=4||t===0?Ed(e):Ed.ceil(e)}function jCe(e,t){return e=BX(e),At(Ed.count($s(e),e)+($s(e).getUTCDay()===4),t,2)}function RCe(e){return e.getUTCDay()}function BCe(e,t){return At(C1.count($s(e)-1,e),t,2)}function zCe(e,t){return At(e.getUTCFullYear()%100,t,2)}function $Ce(e,t){return e=BX(e),At(e.getUTCFullYear()%100,t,2)}function FCe(e,t){return At(e.getUTCFullYear()%1e4,t,4)}function VCe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ed(e):Ed.ceil(e),At(e.getUTCFullYear()%1e4,t,4)}function GCe(){return"+0000"}function P4(){return"%"}function k4(e){return+e}function L4(e){return Math.floor(+e/1e3)}var Kf,zX,$X;WCe({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 WCe(e){return Kf=WTe(e),zX=Kf.format,Kf.parse,$X=Kf.utcFormat,Kf.utcParse,Kf}function HCe(e){return new Date(e)}function UCe(e){return e instanceof Date?+e:+new Date(+e)}function eN(e,t,r,n,i,a,o,s,l,u){var c=$D(),f=c.invert,h=c.domain,d=u(".%L"),v=u(":%S"),g=u("%I:%M"),m=u("%I %p"),x=u("%a %d"),_=u("%b %d"),b=u("%B"),S=u("%Y");function T(C){return(l(C)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>NSe(e,a/n))},r.copy=function(){return WX(t).domain(e)},Js.apply(r,arguments)}function cT(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Vn,c,f=!1,h;function d(g){return isNaN(g=+g)?h:(g=.5+((g=+c(g))-a)*(n*gt}var eAe=QCe,tAe=YX,rAe=eAe,nAe=Lv;function iAe(e){return e&&e.length?tAe(e,nAe,rAe):void 0}var aAe=iAe;const kl=$t(aAe);function oAe(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Kt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return As(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return Vt(As(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return Er(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(bi))throw Error(ha+"NaN");if(r.s<1)throw Error(ha+(r.s?"NaN":"-Infinity"));return r.eq(bi)?new n(0):(tr=!1,t=As(Gm(r,a),Gm(e,a),a),tr=!0,Vt(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?JX(t,e):qX(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ha+"NaN");return r.s?(tr=!1,t=As(r,e,0,1).times(e),tr=!0,r.minus(t)):Vt(new n(r),i)};je.naturalExponential=je.exp=function(){return KX(this)};je.naturalLogarithm=je.ln=function(){return Gm(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qX(t,e):JX(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Gc+e);if(t=Er(i)+1,n=i.d.length-1,r=n*Kt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ha+"NaN")}for(e=Er(s),tr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=wo(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Dv((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(As(s,a,o+2)).times(.5),wo(a.d).slice(0,o)===(t=wo(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Vt(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return tr=!0,Vt(n,r)};je.times=je.mul=function(e){var t,r,n,i,a,o,s,l,u,c=this,f=c.constructor,h=c.d,d=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,r=c.e+e.e,l=h.length,u=d.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+d[n]*h[i-n-1]+t,a[i--]=s%Qr|0,t=s/Qr|0;a[i]=(a[i]+t)%Qr|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,tr?Vt(e,f.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:($o(e,0,Ev),t===void 0?t=n.rounding:$o(t,0,8),Vt(r,e+Er(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=sf(n,!0):($o(e,0,Ev),t===void 0?t=i.rounding:$o(t,0,8),n=Vt(new i(n),e+1,t),r=sf(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?sf(i):($o(e,0,Ev),t===void 0?t=a.rounding:$o(t,0,8),n=Vt(new a(i),e+Er(i)+1,t),r=sf(n.abs(),!1,e+Er(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return Vt(new t(e),Er(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(bi);if(s=new l(s),!s.s){if(e.s<1)throw Error(ha+"Infinity");return s}if(s.eq(bi))return s;if(n=l.precision,e.eq(bi))return Vt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=c<0?-c:c)<=XX){for(i=new l(bi),t=Math.ceil(n/Kt+4),tr=!1;r%2&&(i=i.times(s),E4(i.d,t)),r=Dv(r/2),r!==0;)s=s.times(s),E4(s.d,t);return tr=!0,e.s<0?new l(bi).div(i):Vt(i,n)}}else if(a<0)throw Error(ha+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,tr=!1,i=e.times(Gm(s,n+u)),tr=!0,i=KX(i),i.s=a,i};je.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Er(i),n=sf(i,r<=a.toExpNeg||r>=a.toExpPos)):($o(e,1,Ev),t===void 0?t=a.rounding:$o(t,0,8),i=Vt(new a(i),e,t),r=Er(i),n=sf(i,e<=r||r<=a.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):($o(e,1,Ev),t===void 0?t=n.rounding:$o(t,0,8)),Vt(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Er(e),r=e.constructor;return sf(e,t<=r.toExpNeg||t>=r.toExpPos)};function qX(e,t){var r,n,i,a,o,s,l,u,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),tr?Vt(t,f):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(f/Kt),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/Qr|0,l[a]%=Qr;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,tr?Vt(t,f):t}function $o(e,t,r){if(e!==~~e||er)throw Error(Gc+e)}function wo(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,c,f,h,d,v,g,m,x,_,b,S,T,C,A,P,I=n.constructor,k=n.s==i.s?1:-1,E=n.d,D=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(ha+"Division by zero");for(l=n.e-i.e,A=D.length,T=E.length,d=new I(k),v=d.d=[],u=0;D[u]==(E[u]||0);)++u;if(D[u]>(E[u]||0)&&--l,a==null?_=a=I.precision:o?_=a+(Er(n)-Er(i))+1:_=a,_<0)return new I(0);if(_=_/Kt+2|0,u=0,A==1)for(c=0,D=D[0],_++;(u1&&(D=e(D,c),E=e(E,c),A=D.length,T=E.length),S=A,g=E.slice(0,A),m=g.length;m=Qr/2&&++C;do c=0,s=t(D,g,A,m),s<0?(x=g[0],A!=m&&(x=x*Qr+(g[1]||0)),c=x/C|0,c>1?(c>=Qr&&(c=Qr-1),f=e(D,c),h=f.length,m=g.length,s=t(f,g,h,m),s==1&&(c--,r(f,A16)throw Error(nN+Er(e));if(!e.s)return new c(bi);for(tr=!1,s=f,o=new c(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(hc(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new c(bi),c.precision=s;;){if(i=Vt(i.times(e),s),r=r.times(++l),o=a.plus(As(i,r,s)),wo(o.d).slice(0,s)===wo(a.d).slice(0,s)){for(;u--;)a=Vt(a.times(a),s);return c.precision=f,t==null?(tr=!0,Vt(a,f)):a}a=o}}function Er(e){for(var t=e.e*Kt,r=e.d[0];r>=10;r/=10)t++;return t}function jA(e,t,r){if(t>e.LN10.sd())throw tr=!0,r&&(e.precision=r),Error(ha+"LN10 precision limit exceeded");return Vt(new e(e.LN10),t)}function _l(e){for(var t="";e--;)t+="0";return t}function Gm(e,t){var r,n,i,a,o,s,l,u,c,f=1,h=10,d=e,v=d.d,g=d.constructor,m=g.precision;if(d.s<1)throw Error(ha+(d.s?"NaN":"-Infinity"));if(d.eq(bi))return new g(0);if(t==null?(tr=!1,u=m):u=t,d.eq(10))return t==null&&(tr=!0),jA(g,u);if(u+=h,g.precision=u,r=wo(v),n=r.charAt(0),a=Er(d),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)d=d.times(e),r=wo(d.d),n=r.charAt(0),f++;a=Er(d),n>1?(d=new g("0."+r),a++):d=new g(n+"."+r.slice(1))}else return l=jA(g,u+2,m).times(a+""),d=Gm(new g(n+"."+r.slice(1)),u-h).plus(l),g.precision=m,t==null?(tr=!0,Vt(d,m)):d;for(s=o=d=As(d.minus(bi),d.plus(bi),u),c=Vt(d.times(d),u),i=3;;){if(o=Vt(o.times(c),u),l=s.plus(As(o,new g(i),u)),wo(l.d).slice(0,u)===wo(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(jA(g,u+2,m).times(a+""))),s=As(s,new g(f),u),g.precision=m,t==null?(tr=!0,Vt(s,m)):s;s=l,i+=2}}function O4(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Dv(r/Kt),e.d=[],n=(r+1)%Kt,r<0&&(n+=Kt),nA1||e.e<-A1))throw Error(nN+r)}else e.s=0,e.e=0,e.d=[0];return e}function Vt(e,t,r){var n,i,a,o,s,l,u,c,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=Kt,i=t,u=f[c=0];else{if(c=Math.ceil((n+1)/Kt),a=f.length,c>=a)return e;for(u=a=f[c],o=1;a>=10;a/=10)o++;n%=Kt,i=n-Kt+o}if(r!==void 0&&(a=hc(10,o-i-1),s=u/a%10|0,l=t<0||f[c+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/hc(10,o-i):0:f[c-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=Er(e),f.length=1,t=t-a-1,f[0]=hc(10,(Kt-t%Kt)%Kt),e.e=Dv(-t/Kt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=c,a=1,c--):(f.length=c+1,a=hc(10,Kt-n),f[c]=i>0?(u/hc(10,o-i)%hc(10,i)|0)*a:0),l)for(;;)if(c==0){(f[0]+=a)==Qr&&(f[0]=1,++e.e);break}else{if(f[c]+=a,f[c]!=Qr)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(tr&&(e.e>A1||e.e<-A1))throw Error(nN+Er(e));return e}function JX(e,t){var r,n,i,a,o,s,l,u,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),tr?Vt(t,d):t;if(l=e.d,f=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(c=o<0,c?(r=l,o=-o,s=f.length):(r=f,n=u,s=l.length),i=Math.max(Math.ceil(d/Kt),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=f.length,c=i0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+_l(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+_l(-i-1)+a,r&&(n=r-o)>0&&(a+=_l(n))):i>=o?(a+=_l(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+_l(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=_l(n))),e.s<0?"-"+a:a}function E4(e,t){if(e.length>t)return e.length=t,!0}function QX(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Gc+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return O4(o,a.toString())}else if(typeof a!="string")throw Error(Gc+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,PAe.test(a))O4(o,a);else throw Error(Gc+a)}if(i.prototype=je,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=QX,i.config=i.set=kAe,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Gc+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Gc+r+": "+n);return this}var iN=QX(MAe);bi=new iN(1);const Bt=iN;function LAe(e){return DAe(e)||EAe(e)||OAe(e)||IAe()}function IAe(){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 OAe(e,t){if(e){if(typeof e=="string")return eL(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 eL(e,t)}}function EAe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function DAe(e){if(Array.isArray(e))return eL(e)}function eL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,D4(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function XAe(e){if(Array.isArray(e))return e}function iq(e){var t=Wm(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function aq(e,t,r){if(e.lte(0))return new Bt(0);var n=dT.getDigitCount(e.toNumber()),i=new Bt(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Bt(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Bt(Math.ceil(l))}function qAe(e,t,r){var n=1,i=new Bt(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Bt(10).pow(dT.getDigitCount(e)-1),i=new Bt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Bt(Math.floor(e)))}else e===0?i=new Bt(Math.floor((t-1)/2)):r||(i=new Bt(Math.floor(e)));var o=Math.floor((t-1)/2),s=BAe(RAe(function(l){return i.add(new Bt(l-o).mul(n)).toNumber()}),tL);return s(0,t)}function oq(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Bt(0),tickMin:new Bt(0),tickMax:new Bt(0)};var a=aq(new Bt(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Bt(0):(o=new Bt(e).add(t).div(2),o=o.sub(new Bt(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Bt(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?oq(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Bt(s).mul(a)),tickMax:o.add(new Bt(l).mul(a))})}function KAe(e){var t=Wm(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=iq([r,n]),l=Wm(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(nL(tL(0,i-1).map(function(){return 1/0}))):[].concat(nL(tL(0,i-1).map(function(){return-1/0})),[c]);return r>n?rL(f):f}if(u===c)return qAe(u,i,a);var h=oq(u,c,o,a),d=h.step,v=h.tickMin,g=h.tickMax,m=dT.rangeStep(v,g.add(new Bt(.1).mul(d)),d);return r>n?rL(m):m}function JAe(e,t){var r=Wm(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=iq([n,i]),s=Wm(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var c=Math.max(t,2),f=aq(new Bt(u).sub(l).div(c-1),a,0),h=[].concat(nL(dT.rangeStep(new Bt(l),new Bt(u).sub(new Bt(.99).mul(f)),f)),[u]);return n>i?rL(h):h}var QAe=rq(KAe),e2e=rq(JAe),t2e="Invariant failed";function lf(e,t){throw new Error(t2e)}var r2e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Nd(e){"@babel/helpers - typeof";return Nd=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},Nd(e)}function M1(){return M1=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 u2e(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 c2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f2e(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,f=i[u].coordinate,h=u>=s-1?i[0].coordinate:i[u+1].coordinate,d=void 0;if(Ba(f-c)!==Ba(h-f)){var v=[];if(Ba(h-f)===Ba(l[1]-l[0])){d=h;var g=f+l[1]-l[0];v[0]=Math.min(g,(g+c)/2),v[1]=Math.max(g,(g+c)/2)}else{d=c;var m=h+l[1]-l[0];v[0]=Math.min(f,(m+f)/2),v[1]=Math.max(f,(m+f)/2)}var x=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(t>x[0]&&t<=x[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var _=Math.min(c,h),b=Math.max(c,h);if(t>(_+f)/2&&t<=(b+f)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},aN=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?vr(vr({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},P2e=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(x&&x.length){var _=x[0].type.defaultProps,b=_!==void 0?vr(vr({},_),x[0].props):x[0].props,S=b.barSize,T=b[m];o[T]||(o[T]=[]);var C=dt(S)?r:S;o[T].push({item:x[0],stackList:x.slice(1),barSize:dt(C)?void 0:of(C,n,0)})}}return o},k2e=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=of(r,i,0,!0),c,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/l,v=o.reduce(function(S,T){return S+T.barSize||0},0);v+=(l-1)*u,v>=i&&(v-=(l-1)*u,u=0),v>=i&&d>0&&(h=!0,d*=.9,v=l*d);var g=(i-v)/2>>0,m={offset:g-u,size:0};c=o.reduce(function(S,T){var C={item:T.item,position:{offset:m.offset+m.size+u,size:h?d:T.barSize}},A=[].concat(R4(S),[C]);return m=A[A.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){A.push({item:P,position:m})}),A},f)}else{var x=of(n,i,0,!0);i-2*x-(l-1)*u<=0&&(u=0);var _=(i-2*x-(l-1)*u)/l;_>1&&(_>>=0);var b=s===+s?Math.min(_,s):_;c=o.reduce(function(S,T,C){var A=[].concat(R4(S),[{item:T.item,position:{offset:x+(_+u)*C+(_-b)/2,size:b}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){A.push({item:P,position:A[A.length-1].position})}),A},f)}return c},L2e=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=cq({children:a,legendWidth:l});if(u){var c=i||{},f=c.width,h=c.height,d=u.align,v=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&v==="middle")&&d!=="center"&&we(t[d]))return vr(vr({},t),{},ud({},d,t[d]+(f||0)));if((g==="horizontal"||g==="vertical"&&d==="center")&&v!=="middle"&&we(t[v]))return vr(vr({},t),{},ud({},v,t[v]+(h||0)))}return t},I2e=function(t,r,n){return dt(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},fq=function(t,r,n,i,a){var o=r.props.children,s=sa(o,i0).filter(function(u){return I2e(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,c){var f=Hn(c,n);if(dt(f))return u;var h=Array.isArray(f)?[fT(f),kl(f)]:[f,f],d=l.reduce(function(v,g){var m=Hn(c,g,0),x=h[0]-Math.abs(Array.isArray(m)?m[0]:m),_=h[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(x,v[0]),Math.max(_,v[1])]},[1/0,-1/0]);return[Math.min(d[0],u[0]),Math.max(d[1],u[1])]},[1/0,-1/0])}return null},O2e=function(t,r,n,i,a){var o=r.map(function(s){return fq(t,s,n,a,i)}).filter(function(s){return!dt(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},hq=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&fq(t,l,u,i)||Gg(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var c=0,f=u.length;c=2?Ba(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return c.filter(function(f){return!Av(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},RA=new WeakMap,_x=function(t,r){if(typeof r!="function")return t;RA.has(t)||RA.set(t,new WeakMap);var n=RA.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},E2e=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Bm(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:w1(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Vg(),realScaleType:"point"}:a==="category"?{scale:Bm(),realScaleType:"band"}:{scale:w1(),realScaleType:"linear"};if(af(i)){var l="scale".concat(JS(i));return{scale:(I4[l]||Vg)(),realScaleType:I4[l]?l:"point"}}return ft(i)?{scale:i}:{scale:Vg(),realScaleType:"point"}},z4=1e-4,D2e=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-z4,o=Math.max(i[0],i[1])+z4,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},N2e=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},B2e=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},z2e={sign:R2e,expand:Qpe,none:Ad,silhouette:ege,wiggle:tge,positive:B2e},$2e=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=z2e[n],o=Jpe().keys(i).value(function(s,l){return+Hn(s,l,0)}).order(Ik).offset(a);return o(t)},F2e=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(f,h){var d,v=(d=h.type)!==null&&d!==void 0&&d.defaultProps?vr(vr({},h.type.defaultProps),h.props):h.props,g=v.stackId,m=v.hide;if(m)return f;var x=v[n],_=f[x]||{hasStack:!1,stackGroups:{}};if(Vr(g)){var b=_.stackGroups[g]||{numericAxisId:n,cateAxisId:i,items:[]};b.items.push(h),_.hasStack=!0,_.stackGroups[g]=b}else _.stackGroups[Mv("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return vr(vr({},f),{},ud({},x,_))},l),c={};return Object.keys(u).reduce(function(f,h){var d=u[h];if(d.hasStack){var v={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(g,m){var x=d.stackGroups[m];return vr(vr({},g),{},ud({},m,{numericAxisId:n,cateAxisId:i,items:x.items,stackedData:$2e(t,x.items,a)}))},v)}return vr(vr({},f),{},ud({},h,d))},c)},V2e=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var c=QAe(u,a,s);return t.domain([fT(c),kl(c)]),{niceTicks:c}}if(a&&i==="number"){var f=t.domain(),h=e2e(f,a,s);return{niceTicks:h}}return null};function k1(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!dt(i[t.dataKey])){var s=Jb(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Hn(i,dt(o)?t.dataKey:o);return dt(l)?null:t.scale(l)}var $4=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Hn(o,r.dataKey,r.domain[s]);return dt(l)?null:r.scale(l)-a/2+i},G2e=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},W2e=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?vr(vr({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Vr(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},H2e=function(t){return t.reduce(function(r,n){return[fT(n.concat([r[0]]).filter(we)),kl(n.concat([r[1]]).filter(we))]},[1/0,-1/0])},vq=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,c){var f=H2e(c.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},F4=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,V4=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,sL=function(t,r,n){if(ft(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(we(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(F4.test(t[0])){var a=+F4.exec(t[0])[1];i[0]=r[0]-a}else ft(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(we(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(V4.test(t[1])){var o=+V4.exec(t[1])[1];i[1]=r[1]+o}else ft(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},L1=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=ED(r,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;so&&(u=2*Math.PI-u),{radius:s,angle:X2e(u),angleInRadian:u}},J2e=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},Q2e=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},U4=function(t,r){var n=t.x,i=t.y,a=K2e({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var c=J2e(r),f=c.startAngle,h=c.endAngle,d=s,v;if(f<=h){for(;d>h;)d-=360;for(;d=f&&d<=h}else{for(;d>f;)d-=360;for(;d=h&&d<=f}return v?H4(H4({},r),{},{radius:o,angle:Q2e(d,r)}):null};function Ym(e){"@babel/helpers - typeof";return Ym=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},Ym(e)}var eMe=["offset"];function tMe(e){return aMe(e)||iMe(e)||nMe(e)||rMe()}function rMe(){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 nMe(e,t){if(e){if(typeof e=="string")return lL(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 lL(e,t)}}function iMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aMe(e){if(Array.isArray(e))return lL(e)}function lL(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 sMe(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 Z4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t=0?1:-1,b,S;i==="insideStart"?(b=d+_*o,S=g):i==="insideEnd"?(b=v-_*o,S=!g):i==="end"&&(b=v+_*o,S=g),S=x<=0?S:!S;var T=vn(u,c,m,b),C=vn(u,c,m,b+(S?1:-1)*359),A="M".concat(T.x,",").concat(T.y,` A`).concat(m,",").concat(m,",0,1,").concat(S?0:1,`, - `).concat(C.x,",").concat(C.y),P=dt(t.id)?Cv("recharts-radial-line-"):t.id;return Q.createElement("text",Zm({},n,{dominantBaseline:"central",className:_t("recharts-radial-bar-label",s)}),Q.createElement("defs",null,Q.createElement("path",{id:P,d:A})),Q.createElement("textPath",{xlinkHref:"#".concat(P)},r))},cMe=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,c=a.startAngle,f=a.endAngle,h=(c+f)/2;if(i==="outside"){var d=vn(o,s,u+n,h),v=d.x,g=d.y;return{x:v,y:g,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var m=(l+u)/2,y=vn(o,s,m,h),_=y.x,b=y.y;return{x:_,y:b,textAnchor:"middle",verticalAnchor:"middle"}},fMe=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,c=o.height,f=c>=0?1:-1,h=f*i,d=f>0?"end":"start",v=f>0?"start":"end",g=u>=0?1:-1,m=g*i,y=g>0?"end":"start",_=g>0?"start":"end";if(a==="top"){var b={x:s+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return Br(Br({},b),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+c+h,textAnchor:"middle",verticalAnchor:v};return Br(Br({},S),n?{height:Math.max(n.y+n.height-(l+c),0),width:u}:{})}if(a==="left"){var T={x:s-m,y:l+c/2,textAnchor:y,verticalAnchor:"middle"};return Br(Br({},T),n?{width:Math.max(T.x-n.x,0),height:c}:{})}if(a==="right"){var C={x:s+u+m,y:l+c/2,textAnchor:_,verticalAnchor:"middle"};return Br(Br({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:c}:{})}var A=n?{width:u,height:c}:{};return a==="insideLeft"?Br({x:s+m,y:l+c/2,textAnchor:_,verticalAnchor:"middle"},A):a==="insideRight"?Br({x:s+u-m,y:l+c/2,textAnchor:y,verticalAnchor:"middle"},A):a==="insideTop"?Br({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},A):a==="insideBottom"?Br({x:s+u/2,y:l+c-h,textAnchor:"middle",verticalAnchor:d},A):a==="insideTopLeft"?Br({x:s+m,y:l+h,textAnchor:_,verticalAnchor:v},A):a==="insideTopRight"?Br({x:s+u-m,y:l+h,textAnchor:y,verticalAnchor:v},A):a==="insideBottomLeft"?Br({x:s+m,y:l+c-h,textAnchor:_,verticalAnchor:d},A):a==="insideBottomRight"?Br({x:s+u-m,y:l+c-h,textAnchor:y,verticalAnchor:d},A):_v(a)&&(we(a.x)||Mc(a.x))&&(we(a.y)||Mc(a.y))?Br({x:s+of(a.x,u),y:l+of(a.y,c),textAnchor:"end",verticalAnchor:"end"},A):Br({x:s+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},A)},hMe=function(t){return"cx"in t&&we(t.cx)};function Ln(e){var t=e.offset,r=t===void 0?5:t,n=rMe(e,q2e),i=Br({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,c=i.className,f=c===void 0?"":c,h=i.textBreakAll;if(!a||dt(s)&&dt(l)&&!W.isValidElement(u)&&!ft(u))return null;if(W.isValidElement(u))return W.cloneElement(u,i);var d;if(ft(u)){if(d=W.createElement(u,i),W.isValidElement(d))return d}else d=sMe(i);var v=hMe(a),g=ct(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return uMe(i,d,g);var m=v?cMe(i):fMe(i);return Q.createElement(f1,Zm({className:_t("recharts-label",f)},g,m,{breakAll:h}),d)}Ln.displayName="Label";var hq=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,c=t.outerRadius,f=t.x,h=t.y,d=t.top,v=t.left,g=t.width,m=t.height,y=t.clockWise,_=t.labelViewBox;if(_)return _;if(we(g)&&we(m)){if(we(f)&&we(h))return{x:f,y:h,width:g,height:m};if(we(d)&&we(v))return{x:d,y:v,width:g,height:m}}return we(f)&&we(h)?{x:f,y:h,width:0,height:0}:we(r)&&we(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:c||l||s||0,clockWise:y}:t.viewBox?t.viewBox:{}},dMe=function(t,r){return t?t===!0?Q.createElement(Ln,{key:"label-implicit",viewBox:r}):Vr(t)?Q.createElement(Ln,{key:"label-implicit",viewBox:r,value:t}):W.isValidElement(t)?t.type===Ln?W.cloneElement(t,{key:"label-implicit",viewBox:r}):Q.createElement(Ln,{key:"label-implicit",content:t,viewBox:r}):ft(t)?Q.createElement(Ln,{key:"label-implicit",content:t,viewBox:r}):_v(t)?Q.createElement(Ln,Zm({viewBox:r},t,{key:"label-implicit"})):null:null},vMe=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=hq(t),o=sa(i,Ln).map(function(l,u){return W.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=dMe(t.label,r||a);return[s].concat(K2e(o))};Ln.parseViewBox=hq;Ln.renderCallByParent=vMe;function pMe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var gMe=pMe;const mMe=$t(gMe);function Ym(e){"@babel/helpers - typeof";return Ym=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},Ym(e)}var yMe=["valueAccessor"],xMe=["data","dataKey","clockWise","id","textBreakAll"];function _Me(e){return TMe(e)||SMe(e)||wMe(e)||bMe()}function bMe(){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 wMe(e,t){if(e){if(typeof e=="string")return iL(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 iL(e,t)}}function SMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TMe(e){if(Array.isArray(e))return iL(e)}function iL(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 PMe(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 kMe=function(t){return Array.isArray(t.value)?mMe(t.value):t.value};function Cs(e){var t=e.valueAccessor,r=t===void 0?kMe:t,n=U4(e,yMe),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=U4(n,xMe);return!i||!i.length?null:Q.createElement(Yt,{className:"recharts-label-list"},i.map(function(c,f){var h=dt(a)?r(c,f):Hn(c&&c.payload,a),d=dt(s)?{}:{id:"".concat(s,"-").concat(f)};return Q.createElement(Ln,k1({},ct(c,!0),u,d,{parentViewBox:c.parentViewBox,value:h,textBreakAll:l,viewBox:Ln.parseViewBox(dt(o)?c:H4(H4({},c),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Cs.displayName="LabelList";function LMe(e,t){return e?e===!0?Q.createElement(Cs,{key:"labelList-implicit",data:t}):Q.isValidElement(e)||ft(e)?Q.createElement(Cs,{key:"labelList-implicit",data:t,content:e}):_v(e)?Q.createElement(Cs,k1({data:t},e,{key:"labelList-implicit"})):null:null}function IMe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=sa(n,Cs).map(function(o,s){return W.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=LMe(e.label,t);return[a].concat(_Me(i))}Cs.renderCallByParent=IMe;function Xm(e){"@babel/helpers - typeof";return Xm=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},Xm(e)}function aL(){return aL=Object.assign?Object.assign.bind():function(e){for(var t=1;t=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var m=(l+u)/2,x=vn(o,s,m,h),_=x.x,b=x.y;return{x:_,y:b,textAnchor:"middle",verticalAnchor:"middle"}},pMe=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,c=o.height,f=c>=0?1:-1,h=f*i,d=f>0?"end":"start",v=f>0?"start":"end",g=u>=0?1:-1,m=g*i,x=g>0?"end":"start",_=g>0?"start":"end";if(a==="top"){var b={x:s+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return Br(Br({},b),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+c+h,textAnchor:"middle",verticalAnchor:v};return Br(Br({},S),n?{height:Math.max(n.y+n.height-(l+c),0),width:u}:{})}if(a==="left"){var T={x:s-m,y:l+c/2,textAnchor:x,verticalAnchor:"middle"};return Br(Br({},T),n?{width:Math.max(T.x-n.x,0),height:c}:{})}if(a==="right"){var C={x:s+u+m,y:l+c/2,textAnchor:_,verticalAnchor:"middle"};return Br(Br({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:c}:{})}var A=n?{width:u,height:c}:{};return a==="insideLeft"?Br({x:s+m,y:l+c/2,textAnchor:_,verticalAnchor:"middle"},A):a==="insideRight"?Br({x:s+u-m,y:l+c/2,textAnchor:x,verticalAnchor:"middle"},A):a==="insideTop"?Br({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},A):a==="insideBottom"?Br({x:s+u/2,y:l+c-h,textAnchor:"middle",verticalAnchor:d},A):a==="insideTopLeft"?Br({x:s+m,y:l+h,textAnchor:_,verticalAnchor:v},A):a==="insideTopRight"?Br({x:s+u-m,y:l+h,textAnchor:x,verticalAnchor:v},A):a==="insideBottomLeft"?Br({x:s+m,y:l+c-h,textAnchor:_,verticalAnchor:d},A):a==="insideBottomRight"?Br({x:s+u-m,y:l+c-h,textAnchor:x,verticalAnchor:d},A):wv(a)&&(we(a.x)||Mc(a.x))&&(we(a.y)||Mc(a.y))?Br({x:s+of(a.x,u),y:l+of(a.y,c),textAnchor:"end",verticalAnchor:"end"},A):Br({x:s+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},A)},gMe=function(t){return"cx"in t&&we(t.cx)};function Ln(e){var t=e.offset,r=t===void 0?5:t,n=oMe(e,eMe),i=Br({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,c=i.className,f=c===void 0?"":c,h=i.textBreakAll;if(!a||dt(s)&&dt(l)&&!W.isValidElement(u)&&!ft(u))return null;if(W.isValidElement(u))return W.cloneElement(u,i);var d;if(ft(u)){if(d=W.createElement(u,i),W.isValidElement(d))return d}else d=fMe(i);var v=gMe(a),g=ct(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return dMe(i,d,g);var m=v?vMe(i):pMe(i);return Q.createElement(v1,Xm({className:_t("recharts-label",f)},g,m,{breakAll:h}),d)}Ln.displayName="Label";var gq=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,c=t.outerRadius,f=t.x,h=t.y,d=t.top,v=t.left,g=t.width,m=t.height,x=t.clockWise,_=t.labelViewBox;if(_)return _;if(we(g)&&we(m)){if(we(f)&&we(h))return{x:f,y:h,width:g,height:m};if(we(d)&&we(v))return{x:d,y:v,width:g,height:m}}return we(f)&&we(h)?{x:f,y:h,width:0,height:0}:we(r)&&we(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:c||l||s||0,clockWise:x}:t.viewBox?t.viewBox:{}},mMe=function(t,r){return t?t===!0?Q.createElement(Ln,{key:"label-implicit",viewBox:r}):Vr(t)?Q.createElement(Ln,{key:"label-implicit",viewBox:r,value:t}):W.isValidElement(t)?t.type===Ln?W.cloneElement(t,{key:"label-implicit",viewBox:r}):Q.createElement(Ln,{key:"label-implicit",content:t,viewBox:r}):ft(t)?Q.createElement(Ln,{key:"label-implicit",content:t,viewBox:r}):wv(t)?Q.createElement(Ln,Xm({viewBox:r},t,{key:"label-implicit"})):null:null},yMe=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=gq(t),o=sa(i,Ln).map(function(l,u){return W.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=mMe(t.label,r||a);return[s].concat(tMe(o))};Ln.parseViewBox=gq;Ln.renderCallByParent=yMe;function xMe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var _Me=xMe;const bMe=$t(_Me);function qm(e){"@babel/helpers - typeof";return qm=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},qm(e)}var wMe=["valueAccessor"],SMe=["data","dataKey","clockWise","id","textBreakAll"];function TMe(e){return PMe(e)||MMe(e)||AMe(e)||CMe()}function CMe(){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 AMe(e,t){if(e){if(typeof e=="string")return uL(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 uL(e,t)}}function MMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PMe(e){if(Array.isArray(e))return uL(e)}function uL(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 OMe(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 EMe=function(t){return Array.isArray(t.value)?bMe(t.value):t.value};function Ms(e){var t=e.valueAccessor,r=t===void 0?EMe:t,n=q4(e,wMe),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=q4(n,SMe);return!i||!i.length?null:Q.createElement(Yt,{className:"recharts-label-list"},i.map(function(c,f){var h=dt(a)?r(c,f):Hn(c&&c.payload,a),d=dt(s)?{}:{id:"".concat(s,"-").concat(f)};return Q.createElement(Ln,O1({},ct(c,!0),u,d,{parentViewBox:c.parentViewBox,value:h,textBreakAll:l,viewBox:Ln.parseViewBox(dt(o)?c:X4(X4({},c),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Ms.displayName="LabelList";function DMe(e,t){return e?e===!0?Q.createElement(Ms,{key:"labelList-implicit",data:t}):Q.isValidElement(e)||ft(e)?Q.createElement(Ms,{key:"labelList-implicit",data:t,content:e}):wv(e)?Q.createElement(Ms,O1({data:t},e,{key:"labelList-implicit"})):null:null}function NMe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=sa(n,Ms).map(function(o,s){return W.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=DMe(e.label,t);return[a].concat(TMe(i))}Ms.renderCallByParent=NMe;function Km(e){"@babel/helpers - typeof";return Km=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},Km(e)}function cL(){return cL=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, `).concat(f.x,",").concat(f.y,` `);if(i>0){var d=vn(r,n,i,o),v=vn(r,n,i,u);h+="L ".concat(v.x,",").concat(v.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},jMe=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,c=t.endAngle,f=Ra(c-u),h=yx({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,v=h.lineTangency,g=h.theta,m=yx({cx:r,cy:n,radius:a,angle:c,sign:-f,cornerRadius:o,cornerIsExternal:l}),y=m.circleTangency,_=m.lineTangency,b=m.theta,S=l?Math.abs(u-c):Math.abs(u-c)-g-b;if(S<0)return s?"M ".concat(v.x,",").concat(v.y,` + `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},$Me=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,c=t.endAngle,f=Ba(c-u),h=bx({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,v=h.lineTangency,g=h.theta,m=bx({cx:r,cy:n,radius:a,angle:c,sign:-f,cornerRadius:o,cornerIsExternal:l}),x=m.circleTangency,_=m.lineTangency,b=m.theta,S=l?Math.abs(u-c):Math.abs(u-c)-g-b;if(S<0)return s?"M ".concat(v.x,",").concat(v.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):dq({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:c});var T="M ".concat(v.x,",").concat(v.y,` + `):mq({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:c});var T="M ".concat(v.x,",").concat(v.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,` - A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,` + A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,` - `);if(i>0){var C=yx({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=C.circleTangency,P=C.lineTangency,I=C.theta,k=yx({cx:r,cy:n,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),E=k.circleTangency,D=k.lineTangency,N=k.theta,z=l?Math.abs(u-c):Math.abs(u-c)-I-N;if(z<0&&o===0)return"".concat(T,"L").concat(r,",").concat(n,"Z");T+="L".concat(D.x,",").concat(D.y,` + `);if(i>0){var C=bx({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=C.circleTangency,P=C.lineTangency,I=C.theta,k=bx({cx:r,cy:n,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),E=k.circleTangency,D=k.lineTangency,N=k.theta,z=l?Math.abs(u-c):Math.abs(u-c)-I-N;if(z<0&&o===0)return"".concat(T,"L").concat(r,",").concat(n,"Z");T+="L".concat(D.x,",").concat(D.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,` A`).concat(i,",").concat(i,",0,").concat(+(z>180),",").concat(+(f>0),",").concat(A.x,",").concat(A.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else T+="L".concat(r,",").concat(n,"Z");return T},RMe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},vq=function(t){var r=Y4(Y4({},RMe),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,c=r.startAngle,f=r.endAngle,h=r.className;if(o0&&Math.abs(c-f)<360?m=jMe({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(g,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):m=dq({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:f}),Q.createElement("path",aL({},ct(r,!0),{className:d,d:m,role:"img"}))};function qm(e){"@babel/helpers - typeof";return qm=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},qm(e)}function oL(){return oL=Object.assign?Object.assign.bind():function(e){for(var t=1;tqMe.call(e,t));function Pf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const QMe="__v",ePe="__o",tPe="_owner",{getOwnPropertyDescriptor:Q4,keys:e$}=Object;function rPe(e,t){return e.byteLength===t.byteLength&&L1(new Uint8Array(e),new Uint8Array(t))}function nPe(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 iPe(e,t){return e.byteLength===t.byteLength&&L1(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function aPe(e,t){return Pf(e.getTime(),t.getTime())}function oPe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function sPe(e,t){return e===t}function t$(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let c=!1,f=0;for(;(s=u.next())&&!s.done;){if(i[f]){f++;continue}const h=o.value,d=s.value;if(r.equals(h[0],d[0],l,f,e,t,r)&&r.equals(h[1],d[1],h[0],d[0],e,t,r)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}const lPe=Pf;function uPe(e,t,r){const n=e$(e);let i=n.length;if(e$(t).length!==i)return!1;for(;i-- >0;)if(!yq(e,t,r,n[i]))return!1;return!0}function Ip(e,t,r){const n=J4(e);let i=n.length;if(J4(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!yq(e,t,r,a)||(o=Q4(e,a),s=Q4(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function cPe(e,t){return Pf(e.valueOf(),t.valueOf())}function fPe(e,t){return e.source===t.source&&e.flags===t.flags}function r$(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,c=0;for(;(s=l.next())&&!s.done;){if(!i[c]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function L1(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 hPe(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 yq(e,t,r,n){return(n===tPe||n===ePe||n===QMe)&&(e.$$typeof||t.$$typeof)?!0:JMe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const dPe="[object ArrayBuffer]",vPe="[object Arguments]",pPe="[object Boolean]",gPe="[object DataView]",mPe="[object Date]",yPe="[object Error]",xPe="[object Map]",_Pe="[object Number]",bPe="[object Object]",wPe="[object RegExp]",SPe="[object Set]",TPe="[object String]",CPe={"[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},APe="[object URL]",MPe=Object.prototype.toString;function PPe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:d,unknownTagComparators:v}){return function(m,y,_){if(m===y)return!0;if(m==null||y==null)return!1;const b=typeof m;if(b!==typeof y)return!1;if(b!=="object")return b==="number"?s(m,y,_):b==="function"?a(m,y,_):!1;const S=m.constructor;if(S!==y.constructor)return!1;if(S===Object)return l(m,y,_);if(Array.isArray(m))return t(m,y,_);if(S===Date)return n(m,y,_);if(S===RegExp)return c(m,y,_);if(S===Map)return o(m,y,_);if(S===Set)return f(m,y,_);const T=MPe.call(m);if(T===mPe)return n(m,y,_);if(T===wPe)return c(m,y,_);if(T===xPe)return o(m,y,_);if(T===SPe)return f(m,y,_);if(T===bPe)return typeof m.then!="function"&&typeof y.then!="function"&&l(m,y,_);if(T===APe)return d(m,y,_);if(T===yPe)return i(m,y,_);if(T===vPe)return l(m,y,_);if(CPe[T])return h(m,y,_);if(T===dPe)return e(m,y,_);if(T===gPe)return r(m,y,_);if(T===pPe||T===_Pe||T===TPe)return u(m,y,_);if(v){let C=v[T];if(!C){const A=KMe(m);A&&(C=v[A])}if(C)return C(m,y,_)}return!1}}function kPe({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:rPe,areArraysEqual:r?Ip:nPe,areDataViewsEqual:iPe,areDatesEqual:aPe,areErrorsEqual:oPe,areFunctionsEqual:sPe,areMapsEqual:r?NA(t$,Ip):t$,areNumbersEqual:lPe,areObjectsEqual:r?Ip:uPe,arePrimitiveWrappersEqual:cPe,areRegExpsEqual:fPe,areSetsEqual:r?NA(r$,Ip):r$,areTypedArraysEqual:r?NA(L1,Ip):L1,areUrlsEqual:hPe,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=_x(n.areArraysEqual),a=_x(n.areMapsEqual),o=_x(n.areObjectsEqual),s=_x(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function LPe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function IPe({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:c}=r();return t(s,l,{cache:u,equals:n,meta:c,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const OPe=wu();wu({strict:!0});wu({circular:!0});wu({circular:!0,strict:!0});wu({createInternalComparator:()=>Pf});wu({strict:!0,createInternalComparator:()=>Pf});wu({circular:!0,createInternalComparator:()=>Pf});wu({circular:!0,createInternalComparator:()=>Pf,strict:!0});function wu(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=kPe(e),o=PPe(a),s=r?r(o):LPe(o);return IPe({circular:t,comparator:o,createState:n,equals:s,strict:i})}function EPe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function n$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):EPe(i)};requestAnimationFrame(n)}function sL(e){"@babel/helpers - typeof";return sL=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},sL(e)}function DPe(e){return BPe(e)||RPe(e)||jPe(e)||NPe()}function NPe(){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 jPe(e,t){if(e){if(typeof e=="string")return i$(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 i$(e,t)}}function i$(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:y<0?0:y},g=function(y){for(var _=y>1?1:y,b=_,S=0;S<8;++S){var T=f(b)-_,C=d(b);if(Math.abs(T-_)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(c,f,h){var d=-(c-f)*n,v=h*a,g=h+(d-v)*s/1e3,m=h*s/1e3+c;return Math.abs(m-f)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 pke(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function jA(e){return xke(e)||yke(e)||mke(e)||gke()}function gke(){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 mke(e,t){if(e){if(typeof e=="string")return hL(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 hL(e,t)}}function yke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xke(e){if(Array.isArray(e))return hL(e)}function hL(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 E1(e){return E1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},E1(e)}var Bo=function(e){Tke(r,e);var t=Cke(r);function r(n,i){var a;_ke(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,c=o.to,f=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(pL(a)),a.changeStyle=a.changeStyle.bind(pL(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:c}),vL(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},vL(a);a.state={style:l?gg({},l,u):u}}else a.state={style:{}};return a}return wke(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,c=a.to,f=a.from,h=this.state.style;if(s){if(!o){var d={style:l?gg({},l,c):c};this.state&&h&&(l&&h[l]!==c||!l&&h!==c)&&this.setState(d);return}if(!(OPe(i.to,c)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=v||u?f:i.to;if(this.state&&h){var m={style:l?gg({},l,g):g};(l&&h[l]!==g||!l&&h!==g)&&this.setState(m)}this.runAnimation(Ca(Ca({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,c=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=hke(o,s,tke(u),l,this.changeStyle),v=function(){a.stopJSAnimation=d()};this.manager.start([h,c,v,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],c=u.style,f=u.duration,h=f===void 0?0:f,d=function(g,m,y){if(y===0)return g;var _=m.duration,b=m.easing,S=b===void 0?"ease":b,T=m.style,C=m.properties,A=m.onAnimationEnd,P=y>0?o[y-1]:m,I=C||Object.keys(T);if(typeof S=="function"||S==="spring")return[].concat(jA(g),[a.runJSAnimation.bind(a,{from:P.style,to:T,duration:_,easing:S}),_]);var k=s$(I,_,S),E=Ca(Ca(Ca({},P.style),T),{},{transition:k});return[].concat(jA(g),[E,_,A]).filter(GPe)};return this.manager.start([l].concat(jA(o.reduce(d,[c,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=zPe());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,c=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof d=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var g=s?gg({},s,l):l,m=s$(Object.keys(g),o,u);v.start([c,a,Ca(Ca({},g),{},{transition:m}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=vke(i,dke),u=W.Children.count(a),c=this.state.style;if(typeof a=="function")return a(c);if(!s||u===0||o<=0)return a;var f=function(d){var v=d.props,g=v.style,m=g===void 0?{}:g,y=v.className,_=W.cloneElement(d,Ca(Ca({},l),{},{style:Ca(Ca({},m),c),className:y}));return _};return u===1?f(W.Children.only(a)):Q.createElement("div",null,W.Children.map(a,function(h){return f(h)}))}}]),r}(W.PureComponent);Bo.displayName="Animate";Bo.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Bo.propTypes={from:Lt.oneOfType([Lt.object,Lt.string]),to:Lt.oneOfType([Lt.object,Lt.string]),attributeName:Lt.string,duration:Lt.number,begin:Lt.number,easing:Lt.oneOfType([Lt.string,Lt.func]),steps:Lt.arrayOf(Lt.shape({duration:Lt.number.isRequired,style:Lt.object.isRequired,easing:Lt.oneOfType([Lt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Lt.func]),properties:Lt.arrayOf("string"),onAnimationEnd:Lt.func})),children:Lt.oneOfType([Lt.node,Lt.func]),isActive:Lt.bool,canBegin:Lt.bool,onAnimationEnd:Lt.func,shouldReAnimate:Lt.bool,onAnimationStart:Lt.func,onAnimationReStart:Lt.func};function Qm(e){"@babel/helpers - typeof";return Qm=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},Qm(e)}function D1(){return D1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,c;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,d=4;ho?o:a[h];c="M".concat(t,",").concat(r+s*f[0]),f[0]>0&&(c+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+l*f[0],",").concat(r)),c+="L ".concat(t+n-l*f[1],",").concat(r),f[1]>0&&(c+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else T+="L".concat(r,",").concat(n,"Z");return T},FMe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},yq=function(t){var r=J4(J4({},FMe),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,c=r.startAngle,f=r.endAngle,h=r.className;if(o0&&Math.abs(c-f)<360?m=$Me({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(g,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):m=mq({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:f}),Q.createElement("path",cL({},ct(r,!0),{className:d,d:m,role:"img"}))};function Jm(e){"@babel/helpers - typeof";return Jm=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},Jm(e)}function fL(){return fL=Object.assign?Object.assign.bind():function(e){for(var t=1;tePe.call(e,t));function Pf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const nPe="__v",iPe="__o",aPe="_owner",{getOwnPropertyDescriptor:n$,keys:i$}=Object;function oPe(e,t){return e.byteLength===t.byteLength&&E1(new Uint8Array(e),new Uint8Array(t))}function sPe(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 lPe(e,t){return e.byteLength===t.byteLength&&E1(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function uPe(e,t){return Pf(e.getTime(),t.getTime())}function cPe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function fPe(e,t){return e===t}function a$(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let c=!1,f=0;for(;(s=u.next())&&!s.done;){if(i[f]){f++;continue}const h=o.value,d=s.value;if(r.equals(h[0],d[0],l,f,e,t,r)&&r.equals(h[1],d[1],h[0],d[0],e,t,r)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}const hPe=Pf;function dPe(e,t,r){const n=i$(e);let i=n.length;if(i$(t).length!==i)return!1;for(;i-- >0;)if(!wq(e,t,r,n[i]))return!1;return!0}function Ep(e,t,r){const n=r$(e);let i=n.length;if(r$(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!wq(e,t,r,a)||(o=n$(e,a),s=n$(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function vPe(e,t){return Pf(e.valueOf(),t.valueOf())}function pPe(e,t){return e.source===t.source&&e.flags===t.flags}function o$(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,c=0;for(;(s=l.next())&&!s.done;){if(!i[c]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function E1(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 gPe(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 wq(e,t,r,n){return(n===aPe||n===iPe||n===nPe)&&(e.$$typeof||t.$$typeof)?!0:rPe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const mPe="[object ArrayBuffer]",yPe="[object Arguments]",xPe="[object Boolean]",_Pe="[object DataView]",bPe="[object Date]",wPe="[object Error]",SPe="[object Map]",TPe="[object Number]",CPe="[object Object]",APe="[object RegExp]",MPe="[object Set]",PPe="[object String]",kPe={"[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},LPe="[object URL]",IPe=Object.prototype.toString;function OPe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:d,unknownTagComparators:v}){return function(m,x,_){if(m===x)return!0;if(m==null||x==null)return!1;const b=typeof m;if(b!==typeof x)return!1;if(b!=="object")return b==="number"?s(m,x,_):b==="function"?a(m,x,_):!1;const S=m.constructor;if(S!==x.constructor)return!1;if(S===Object)return l(m,x,_);if(Array.isArray(m))return t(m,x,_);if(S===Date)return n(m,x,_);if(S===RegExp)return c(m,x,_);if(S===Map)return o(m,x,_);if(S===Set)return f(m,x,_);const T=IPe.call(m);if(T===bPe)return n(m,x,_);if(T===APe)return c(m,x,_);if(T===SPe)return o(m,x,_);if(T===MPe)return f(m,x,_);if(T===CPe)return typeof m.then!="function"&&typeof x.then!="function"&&l(m,x,_);if(T===LPe)return d(m,x,_);if(T===wPe)return i(m,x,_);if(T===yPe)return l(m,x,_);if(kPe[T])return h(m,x,_);if(T===mPe)return e(m,x,_);if(T===_Pe)return r(m,x,_);if(T===xPe||T===TPe||T===PPe)return u(m,x,_);if(v){let C=v[T];if(!C){const A=tPe(m);A&&(C=v[A])}if(C)return C(m,x,_)}return!1}}function EPe({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:oPe,areArraysEqual:r?Ep:sPe,areDataViewsEqual:lPe,areDatesEqual:uPe,areErrorsEqual:cPe,areFunctionsEqual:fPe,areMapsEqual:r?BA(a$,Ep):a$,areNumbersEqual:hPe,areObjectsEqual:r?Ep:dPe,arePrimitiveWrappersEqual:vPe,areRegExpsEqual:pPe,areSetsEqual:r?BA(o$,Ep):o$,areTypedArraysEqual:r?BA(E1,Ep):E1,areUrlsEqual:gPe,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=Tx(n.areArraysEqual),a=Tx(n.areMapsEqual),o=Tx(n.areObjectsEqual),s=Tx(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function DPe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function NPe({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:c}=r();return t(s,l,{cache:u,equals:n,meta:c,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const jPe=wu();wu({strict:!0});wu({circular:!0});wu({circular:!0,strict:!0});wu({createInternalComparator:()=>Pf});wu({strict:!0,createInternalComparator:()=>Pf});wu({circular:!0,createInternalComparator:()=>Pf});wu({circular:!0,createInternalComparator:()=>Pf,strict:!0});function wu(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=EPe(e),o=OPe(a),s=r?r(o):DPe(o);return NPe({circular:t,comparator:o,createState:n,equals:s,strict:i})}function RPe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function s$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):RPe(i)};requestAnimationFrame(n)}function hL(e){"@babel/helpers - typeof";return hL=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},hL(e)}function BPe(e){return VPe(e)||FPe(e)||$Pe(e)||zPe()}function zPe(){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 $Pe(e,t){if(e){if(typeof e=="string")return l$(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 l$(e,t)}}function l$(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:x<0?0:x},g=function(x){for(var _=x>1?1:x,b=_,S=0;S<8;++S){var T=f(b)-_,C=d(b);if(Math.abs(T-_)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(c,f,h){var d=-(c-f)*n,v=h*a,g=h+(d-v)*s/1e3,m=h*s/1e3+c;return Math.abs(m-f)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 xke(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function zA(e){return Ske(e)||wke(e)||bke(e)||_ke()}function _ke(){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 bke(e,t){if(e){if(typeof e=="string")return mL(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 mL(e,t)}}function wke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ske(e){if(Array.isArray(e))return mL(e)}function mL(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 j1(e){return j1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},j1(e)}var Fo=function(e){Pke(r,e);var t=kke(r);function r(n,i){var a;Tke(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,c=o.to,f=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(_L(a)),a.changeStyle=a.changeStyle.bind(_L(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:c}),xL(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},xL(a);a.state={style:l?yg({},l,u):u}}else a.state={style:{}};return a}return Ake(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,c=a.to,f=a.from,h=this.state.style;if(s){if(!o){var d={style:l?yg({},l,c):c};this.state&&h&&(l&&h[l]!==c||!l&&h!==c)&&this.setState(d);return}if(!(jPe(i.to,c)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=v||u?f:i.to;if(this.state&&h){var m={style:l?yg({},l,g):g};(l&&h[l]!==g||!l&&h!==g)&&this.setState(m)}this.runAnimation(Ca(Ca({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,c=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=gke(o,s,ake(u),l,this.changeStyle),v=function(){a.stopJSAnimation=d()};this.manager.start([h,c,v,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],c=u.style,f=u.duration,h=f===void 0?0:f,d=function(g,m,x){if(x===0)return g;var _=m.duration,b=m.easing,S=b===void 0?"ease":b,T=m.style,C=m.properties,A=m.onAnimationEnd,P=x>0?o[x-1]:m,I=C||Object.keys(T);if(typeof S=="function"||S==="spring")return[].concat(zA(g),[a.runJSAnimation.bind(a,{from:P.style,to:T,duration:_,easing:S}),_]);var k=f$(I,_,S),E=Ca(Ca(Ca({},P.style),T),{},{transition:k});return[].concat(zA(g),[E,_,A]).filter(ZPe)};return this.manager.start([l].concat(zA(o.reduce(d,[c,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=GPe());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,c=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof d=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var g=s?yg({},s,l):l,m=f$(Object.keys(g),o,u);v.start([c,a,Ca(Ca({},g),{},{transition:m}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=yke(i,mke),u=W.Children.count(a),c=this.state.style;if(typeof a=="function")return a(c);if(!s||u===0||o<=0)return a;var f=function(d){var v=d.props,g=v.style,m=g===void 0?{}:g,x=v.className,_=W.cloneElement(d,Ca(Ca({},l),{},{style:Ca(Ca({},m),c),className:x}));return _};return u===1?f(W.Children.only(a)):Q.createElement("div",null,W.Children.map(a,function(h){return f(h)}))}}]),r}(W.PureComponent);Fo.displayName="Animate";Fo.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Fo.propTypes={from:Lt.oneOfType([Lt.object,Lt.string]),to:Lt.oneOfType([Lt.object,Lt.string]),attributeName:Lt.string,duration:Lt.number,begin:Lt.number,easing:Lt.oneOfType([Lt.string,Lt.func]),steps:Lt.arrayOf(Lt.shape({duration:Lt.number.isRequired,style:Lt.object.isRequired,easing:Lt.oneOfType([Lt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Lt.func]),properties:Lt.arrayOf("string"),onAnimationEnd:Lt.func})),children:Lt.oneOfType([Lt.node,Lt.func]),isActive:Lt.bool,canBegin:Lt.bool,onAnimationEnd:Lt.func,shouldReAnimate:Lt.bool,onAnimationStart:Lt.func,onAnimationReStart:Lt.func};function ty(e){"@babel/helpers - typeof";return ty=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},ty(e)}function R1(){return R1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,c;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,d=4;ho?o:a[h];c="M".concat(t,",").concat(r+s*f[0]),f[0]>0&&(c+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+l*f[0],",").concat(r)),c+="L ".concat(t+n-l*f[1],",").concat(r),f[1]>0&&(c+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, `).concat(t+n,",").concat(r+s*f[1])),c+="L ".concat(t+n,",").concat(r+i-s*f[2]),f[2]>0&&(c+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, `).concat(t+n-l*f[2],",").concat(r+i)),c+="L ".concat(t+l*f[3],",").concat(r+i),f[3]>0&&(c+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, `).concat(t,",").concat(r+i-s*f[3])),c+="Z"}else if(o>0&&a===+a&&a>0){var v=Math.min(o,a);c="M ".concat(t,",").concat(r+s*v,` @@ -456,13 +456,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+n,",").concat(r+i-s*v,` A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-l*v,",").concat(r+i,` L `).concat(t+l*v,",").concat(r+i,` - A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*v," Z")}else c="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return c},Nke=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),c=Math.max(a,a+s),f=Math.min(o,o+l),h=Math.max(o,o+l);return n>=u&&n<=c&&i>=f&&i<=h}return!1},jke={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},rN=function(t){var r=p$(p$({},jke),t),n=W.useRef(),i=W.useState(-1),a=Mke(i,2),o=a[0],s=a[1];W.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,c=r.width,f=r.height,h=r.radius,d=r.className,v=r.animationEasing,g=r.animationDuration,m=r.animationBegin,y=r.isAnimationActive,_=r.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||c===0||f===0)return null;var b=_t("recharts-rectangle",d);return _?Q.createElement(Bo,{canBegin:o>0,from:{width:c,height:f,x:l,y:u},to:{width:c,height:f,x:l,y:u},duration:g,animationEasing:v,isActive:_},function(S){var T=S.width,C=S.height,A=S.x,P=S.y;return Q.createElement(Bo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,isActive:y,easing:v},Q.createElement("path",D1({},ct(r,!0),{className:b,d:g$(A,P,T,C,h),ref:n})))}):Q.createElement("path",D1({},ct(r,!0),{className:b,d:g$(l,u,c,f,h)}))};function gL(){return gL=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 Gke(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 Wke=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},Hke=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,c=t.width,f=c===void 0?0:c,h=t.height,d=h===void 0?0:h,v=t.className,g=Vke(t,Rke),m=Bke({x:n,y:a,top:s,left:u,width:f,height:d},g);return!we(n)||!we(a)||!we(f)||!we(d)||!we(s)||!we(u)?null:Q.createElement("path",mL({},ct(m,!0),{className:_t("recharts-cross",v),d:Wke(n,a,f,d,s,u)}))},Uke=$Y,Zke=Uke(Object.getPrototypeOf,Object),Yke=Zke,Xke=Ys,qke=Yke,Kke=Xs,Jke="[object Object]",Qke=Function.prototype,eLe=Object.prototype,Cq=Qke.toString,tLe=eLe.hasOwnProperty,rLe=Cq.call(Object);function nLe(e){if(!Kke(e)||Xke(e)!=Jke)return!1;var t=qke(e);if(t===null)return!0;var r=tLe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Cq.call(r)==rLe}var iLe=nLe;const aLe=$t(iLe);var oLe=Ys,sLe=Xs,lLe="[object Boolean]";function uLe(e){return e===!0||e===!1||sLe(e)&&oLe(e)==lLe}var cLe=uLe;const fLe=$t(cLe);function ty(e){"@babel/helpers - typeof";return ty=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},ty(e)}function N1(){return N1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:c,lowerWidth:f,height:h,x:l,y:u},duration:g,animationEasing:v,isActive:y},function(b){var S=b.upperWidth,T=b.lowerWidth,C=b.height,A=b.x,P=b.y;return Q.createElement(Bo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,easing:v},Q.createElement("path",N1({},ct(r,!0),{className:_,d:b$(A,P,S,T,C),ref:n})))}):Q.createElement("g",null,Q.createElement("path",N1({},ct(r,!0),{className:_,d:b$(l,u,c,f,h)})))},wLe=["option","shapeType","propTransformer","activeClassName","isActive"];function ry(e){"@babel/helpers - typeof";return ry=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},ry(e)}function SLe(e,t){if(e==null)return{};var r=TLe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TLe(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 w$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function j1(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),gi(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),gi(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),gi(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),gi(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),gi(n,"handleSlideDragStart",function(i){var a=k$(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return uIe(t,e),aIe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,c=u.length-1,f=Math.min(i,a),h=Math.max(i,a),d=t.getIndexInRange(o,f),v=t.getIndexInRange(o,h);return{startIndex:d-d%l,endIndex:v===c?c:v-v%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=Hn(a[n],s,n);return ft(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,c=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,v=l.onChange,g=n.pageX-a;g>0?g=Math.min(g,u+c-f-s,u+c-f-o):g<0&&(g=Math.max(g,u-o,u-s));var m=this.getIndex({startX:o+g,endX:s+g});(m.startIndex!==h||m.endIndex!==d)&&v&&v(m),this.setState({startX:o+g,endX:s+g,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=k$(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],c=this.props,f=c.x,h=c.width,d=c.travellerWidth,v=c.onChange,g=c.gap,m=c.data,y={startX:this.state.startX,endX:this.state.endX},_=n.pageX-a;_>0?_=Math.min(_,f+h-d-u):_<0&&(_=Math.max(_,f-u)),y[o]=u+_;var b=this.getIndex(y),S=b.startIndex,T=b.endIndex,C=function(){var P=m.length-1;return o==="startX"&&(s>l?S%g===0:T%g===0)||sl?T%g===0:S%g===0)||s>l&&T===P};this.setState(gi(gi({},o,u+_),"brushMoveStartX",n.pageX),function(){v&&C()&&v(b)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,c=this.state[i],f=s.indexOf(c);if(f!==-1){var h=f+n;if(!(h===-1||h>=s.length)){var d=s[h];i==="startX"&&d>=u||i==="endX"&&d<=l||this.setState(gi({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return Q.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,c=n.padding,f=W.Children.only(u);return f?Q.cloneElement(f,{x:i,y:a,width:o,height:s,margin:c,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,c=l.travellerWidth,f=l.height,h=l.traveller,d=l.ariaLabel,v=l.data,g=l.startIndex,m=l.endIndex,y=Math.max(n,this.props.x),_=BA(BA({},ct(this.props,!1)),{},{x:y,y:u,width:c,height:f}),b=d||"Min value: ".concat((a=v[g])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[m])===null||o===void 0?void 0:o.name);return Q.createElement(Yt,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),s.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,_))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,c=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,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:l,fillOpacity:.2,x:c,y:o,width:f,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,c=this.state,f=c.startX,h=c.endX,d=5,v={pointerEvents:"none",fill:u};return Q.createElement(Yt,{className:"recharts-brush-texts"},Q.createElement(f1,B1({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},v),this.getTextOfTick(i)),Q.createElement(f1,B1({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:o+s/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,c=n.height,f=n.alwaysShowText,h=this.state,d=h.startX,v=h.endX,g=h.isTextActive,m=h.isSlideMoving,y=h.isTravellerMoving,_=h.isTravellerFocused;if(!i||!i.length||!we(s)||!we(l)||!we(u)||!we(c)||u<=0||c<=0)return null;var b=_t("recharts-brush",a),S=Q.Children.count(o)===1,T=nIe("userSelect","none");return Q.createElement(Yt,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(d,v),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(v,"endX"),(g||m||y||_||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return Q.createElement(Q.Fragment,null,Q.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),Q.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),Q.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return Q.isValidElement(n)?a=Q.cloneElement(n,i):ft(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,c=n.startIndex,f=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return BA({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?fIe({data:a,width:o,x:s,travellerWidth:l,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(W.PureComponent);gi(Bd,"displayName","Brush");gi(Bd,"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 hIe=PD;function dIe(e,t){var r;return hIe(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var vIe=dIe,pIe=OY,gIe=kv,mIe=vIe,yIe=ci,xIe=tT;function _Ie(e,t,r){var n=yIe(e)?pIe:mIe;return r&&xIe(e,t,r)&&(t=void 0),n(e,gIe(t))}var bIe=_Ie;const wIe=$t(bIe);var Oo=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},L$=QY;function SIe(e,t,r){t=="__proto__"&&L$?L$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var TIe=SIe,CIe=TIe,AIe=KY,MIe=kv;function PIe(e,t){var r={};return t=MIe(t),AIe(e,function(n,i,a){CIe(r,i,t(n,i,a))}),r}var kIe=PIe;const LIe=$t(kIe);function IIe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XIe(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 qIe(e,t){var r=e.x,n=e.y,i=YIe(e,WIe),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),c=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return Op(Op(Op(Op(Op({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function O$(e){return Q.createElement(ILe,xL({shapeType:"rectangle",propTransformer:qIe,activeClassName:"recharts-active-bar"},e))}var KIe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=we(n)||lve(n);return a?t(n,i):(a||lf(),r)}},JIe=["value","background"],kq;function zd(e){"@babel/helpers - typeof";return zd=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},zd(e)}function QIe(e,t){if(e==null)return{};var r=eOe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eOe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(F)0&&Math.abs(z)0&&(N=Math.min((ee||0)-(z[le-1]||0),N))}),Number.isFinite(N)){var F=N/D,$=g.layout==="vertical"?n.height:n.width;if(g.padding==="gap"&&(A=F*$/2),g.padding==="no-gap"){var Z=of(t.barCategoryGap,F*$),j=F*$/2;A=j-Z-(j-Z)/$*Z}}}i==="xAxis"?P=[n.left+(b.left||0)+(A||0),n.left+n.width-(b.right||0)-(A||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(A||0),n.top+n.height-(b.bottom||0)-(A||0)]:P=g.range,T&&(P=[P[1],P[0]]);var U=k2e(g,a,h),G=U.scale,V=U.realScaleType;G.domain(y).range(P),L2e(G);var Y=B2e(G,Ea(Ea({},g),{},{realScaleType:V}));i==="xAxis"?(E=m==="top"&&!S||m==="bottom"&&S,I=n.left,k=f[C]-E*g.height):i==="yAxis"&&(E=m==="left"&&!S||m==="right"&&S,I=f[C]-E*g.width,k=n.top);var K=Ea(Ea(Ea({},g),Y),{},{realScaleType:V,x:I,y:k,scale:G,width:i==="xAxis"?n.width:g.width,height:i==="yAxis"?n.height:g.height});return K.bandSize=M1(K,Y),!g.hide&&i==="xAxis"?f[C]+=(E?-1:1)*K.height:g.hide||(f[C]+=(E?-1:1)*K.width),Ea(Ea({},d),{},vT({},v,K))},{})},Dq=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},fOe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return Dq({x:r,y:n},{x:i,y:a})},Nq=function(){function e(t){lOe(this,e),this.scale=t}return uOe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();vT(Nq,"EPS",1e-4);var nN=function(t){var r=Object.keys(t).reduce(function(n,i){return Ea(Ea({},n),{},vT({},i,Nq.create(t[i])))},{});return Ea(Ea({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return LIe(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return GIe(i,function(a,o){return r[o].isInRange(a)})}})};function hOe(e){return(e%180+180)%180}var dOe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=hOe(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&oe.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function eEe(e,t){return Jq(e,t+1)}function tEe(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,c=o,f=function(){var v=n==null?void 0:n[l];if(v===void 0)return{v:Jq(n,u)};var g=l,m,y=function(){return m===void 0&&(m=r(v,g)),m},_=v.coordinate,b=l===0||H1(e,_,y,c,s);b||(l=0,c=o,u+=1),b&&(c=_+e*(y()/2+i),l+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function ly(e){"@babel/helpers - typeof";return ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ly(e)}function H$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function An(e){for(var t=1;t0?d.coordinate-m*e:d.coordinate})}else a[h]=d=An(An({},d),{},{tickCoord:d.coordinate});var y=H1(e,d.tickCoord,g,s,l);y&&(l=d.tickCoord-e*(g()/2+i),a[h]=An(An({},d),{},{isShow:!0}))},c=o-1;c>=0;c--)u(c);return a}function oEe(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var c=n[s-1],f=r(c,s-1),h=e*(c.coordinate+e*f/2-u);o[s-1]=c=An(An({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var d=H1(e,c.tickCoord,function(){return f},l,u);d&&(u=c.tickCoord-e*(f/2+i),o[s-1]=An(An({},c),{},{isShow:!0}))}for(var v=a?s-1:s,g=function(_){var b=o[_],S,T=function(){return S===void 0&&(S=r(b,_)),S};if(_===0){var C=e*(b.coordinate-e*T()/2-l);o[_]=b=An(An({},b),{},{tickCoord:C<0?b.coordinate-C*e:b.coordinate})}else o[_]=b=An(An({},b),{},{tickCoord:b.coordinate});var A=H1(e,b.tickCoord,T,l,u);A&&(l=b.tickCoord+e*(T()/2+i),o[_]=An(An({},b),{},{isShow:!0}))},m=0;m=2?Ra(i[1].coordinate-i[0].coordinate):1,y=QOe(a,m,d);return l==="equidistantPreserveStart"?tEe(m,y,g,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=oEe(m,y,g,i,o,l==="preserveStartEnd"):h=aEe(m,y,g,i,o),h.filter(function(_){return _.isShow}))}var lEe=["viewBox"],uEe=["viewBox"],cEe=["ticks"];function Gd(e){"@babel/helpers - typeof";return Gd=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},Gd(e)}function Wh(){return Wh=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 fEe(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 hEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z$(e,t){for(var r=0;r0?l(this.props):l(d)),o<=0||s<=0||!v||!v.length?null:Q.createElement(Yt,{className:_t("recharts-cartesian-axis",u),ref:function(m){n.layerReference=m}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Ln.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=_t(i.className,"recharts-cartesian-axis-tick-value");return Q.isValidElement(n)?o=Q.cloneElement(n,Rr(Rr({},i),{},{className:s})):ft(n)?o=n(Rr(Rr({},i),{},{className:s})):o=Q.createElement(f1,Wh({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(W.Component);aN(xT,"displayName","CartesianAxis");aN(xT,"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 xEe=["type","layout","connectNulls","ref"],_Ee=["key"];function Wd(e){"@babel/helpers - typeof";return Wd=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},Wd(e)}function Y$(e,t){if(e==null)return{};var r=bEe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bEe(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 Gg(){return Gg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rf){d=[].concat(Jf(l.slice(0,v)),[f-g]);break}var m=d.length%2===0?[0,h]:[h];return[].concat(Jf(t.repeat(l,c)),Jf(d),m).map(function(y){return"".concat(y,"px")}).join(", ")}),Da(r,"id",Cv("recharts-line-")),Da(r,"pathRef",function(o){r.mainCurve=o}),Da(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Da(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return IEe(t,e),MEe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,c=a.children,f=sa(c,t0);if(!f)return null;var h=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Hn(g.payload,m)}},d={clipPath:n?"url(#clipPath-".concat(i,")"):null};return Q.createElement(Yt,d,f.map(function(v){return Q.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,c=s.dataKey,f=ct(this.props,!1),h=ct(l,!0),d=u.map(function(g,m){var y=pi(pi(pi({key:"dot-".concat(m),r:3},f),h),{},{index:m,cx:g.x,cy:g.y,value:g.value,dataKey:c,payload:g.payload,points:u});return t.renderDotItem(l,y)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return Q.createElement(Yt,Gg({className:"recharts-line-dots",key:"dots"},v),d)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,c=s.connectNulls;s.ref;var f=Y$(s,xEe),h=pi(pi(pi({},ct(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:c});return Q.createElement(cd,Gg({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,c=o.animationBegin,f=o.animationDuration,h=o.animationEasing,d=o.animationId,v=o.animateNewValues,g=o.width,m=o.height,y=this.state,_=y.prevPoints,b=y.totalLength;return Q.createElement(Bo,{begin:c,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var T=S.t;if(_){var C=_.length/s.length,A=s.map(function(D,N){var z=Math.floor(N*C);if(_[z]){var F=_[z],$=dn(F.x,D.x),Z=dn(F.y,D.y);return pi(pi({},D),{},{x:$(T),y:Z(T)})}if(v){var j=dn(g*2,D.x),U=dn(m/2,D.y);return pi(pi({},D),{},{x:j(T),y:U(T)})}return pi(pi({},D),{},{x:D.x,y:D.y})});return a.renderCurveStatically(A,n,i)}var P=dn(0,b),I=P(T),k;if(l){var E="".concat(l).split(/[,\s]+/gim).map(function(D){return parseFloat(D)});k=a.getStrokeDasharray(I,b,E)}else k=a.generateSimpleStrokeDasharray(b,I);return a.renderCurveStatically(s,n,i,{strokeDasharray:k})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,c=l.totalLength;return s&&o&&o.length&&(!u&&c>0||!Dd(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.xAxis,c=i.yAxis,f=i.top,h=i.left,d=i.width,v=i.height,g=i.isAnimationActive,m=i.id;if(a||!s||!s.length)return null;var y=this.state.isAnimationFinished,_=s.length===1,b=_t("recharts-line",l),S=u&&u.allowDataOverflow,T=c&&c.allowDataOverflow,C=S||T,A=dt(m)?this.id:m,P=(n=ct(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=P.r,k=I===void 0?3:I,E=P.strokeWidth,D=E===void 0?2:E,N=nY(o)?o:{},z=N.clipDot,F=z===void 0?!0:z,$=k*2+D;return Q.createElement(Yt,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(A)},Q.createElement("rect",{x:S?h:h-d/2,y:T?f:f-v/2,width:S?d:d*2,height:T?v:v*2})),!F&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(A)},Q.createElement("rect",{x:h-$/2,y:f-$/2,width:d+$,height:v+$}))):null,!_&&this.renderCurve(C,A),this.renderErrorBar(C,A),(_||o)&&this.renderDots(C,F,A),(!g||y)&&Cs.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Jf(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function NEe(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 Ic(){return Ic=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Dd(c,o)||!Dd(f,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,c=i.left,f=i.xAxis,h=i.yAxis,d=i.width,v=i.height,g=i.isAnimationActive,m=i.id;if(a||!s||!s.length)return null;var y=this.state.isAnimationFinished,_=s.length===1,b=_t("recharts-area",l),S=f&&f.allowDataOverflow,T=h&&h.allowDataOverflow,C=S||T,A=dt(m)?this.id:m,P=(n=ct(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=P.r,k=I===void 0?3:I,E=P.strokeWidth,D=E===void 0?2:E,N=nY(o)?o:{},z=N.clipDot,F=z===void 0?!0:z,$=k*2+D;return Q.createElement(Yt,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(A)},Q.createElement("rect",{x:S?c:c-d/2,y:T?u:u-v/2,width:S?d:d*2,height:T?v:v*2})),!F&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(A)},Q.createElement("rect",{x:c-$/2,y:u-$/2,width:d+$,height:v+$}))):null,_?null:this.renderArea(C,A),(o||_)&&this.renderDots(C,F,A),(!g||y)&&Cs.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(W.PureComponent);nK=Su;wo(Su,"displayName","Area");wo(Su,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Cf.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});wo(Su,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(we(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var c=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});wo(Su,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,c=e.dataStartIndex,f=e.displayedData,h=e.offset,d=t.layout,v=u&&u.length,g=nK.getBaseValue(t,r,n,i),m=d==="horizontal",y=!1,_=f.map(function(S,T){var C;v?C=u[c+T]:(C=Hn(S,l),Array.isArray(C)?y=!0:C=[g,C]);var A=C[1]==null||v&&Hn(S,l)==null;return m?{x:A1({axis:n,ticks:a,bandSize:s,entry:S,index:T}),y:A?null:i.scale(C[1]),value:C,payload:S}:{x:A?null:n.scale(C[1]),y:A1({axis:i,ticks:o,bandSize:s,entry:S,index:T}),value:C,payload:S}}),b;return v||y?b=_.map(function(S){var T=Array.isArray(S.value)?S.value[0]:null;return m?{x:S.x,y:T!=null&&S.y!=null?i.scale(T):null}:{x:T!=null?n.scale(T):null,y:S.y}}):b=m?i.scale(g):n.scale(g),dl({points:_,baseLine:b,layout:d,isRange:y},h)});wo(Su,"renderDotItem",function(e,t){var r;if(Q.isValidElement(e))r=Q.cloneElement(e,t);else if(ft(e))r=e(t);else{var n=_t("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=iK(t,DEe);r=Q.createElement(fT,Ic({},a,{key:i,className:n}))}return r});function Ud(e){"@babel/helpers - typeof";return Ud=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},Ud(e)}function GEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WEe(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 LDe(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 IDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ODe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&we(i)&&we(a)?t.slice(i,a+1):[]};function _K(e){return e==="number"?[0,"auto"]:void 0}var zL=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=_T(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=f===void 0?s:f;h=Xb(d,o.dataKey,i)}else h=f&&f[n]||s[n];return h?[].concat(Xd(l),[fq(u,h)]):l},[])},iF=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=WDe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=S2e(o,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,h=zL(t,r,c,f),d=HDe(n,s,c,a);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},UDe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,d=uq(c,a);return n.reduce(function(v,g){var m,y=g.type.defaultProps!==void 0?ce(ce({},g.type.defaultProps),g.props):g.props,_=y.type,b=y.dataKey,S=y.allowDataOverflow,T=y.allowDuplicatedCategory,C=y.scale,A=y.ticks,P=y.includeHidden,I=y[o];if(v[I])return v;var k=_T(t.data,{graphicalItems:i.filter(function(Y){var K,ee=o in Y.props?Y.props[o]:(K=Y.type.defaultProps)===null||K===void 0?void 0:K[o];return ee===I}),dataStartIndex:l,dataEndIndex:u}),E=k.length,D,N,z;yDe(y.domain,S,_)&&(D=rL(y.domain,null,S),d&&(_==="number"||C!=="auto")&&(z=Fg(k,b,"category")));var F=_K(_);if(!D||D.length===0){var $,Z=($=y.domain)!==null&&$!==void 0?$:F;if(b){if(D=Fg(k,b,_),_==="category"&&d){var j=cve(D);T&&j?(N=D,D=R1(0,E)):T||(D=z4(Z,D,g).reduce(function(Y,K){return Y.indexOf(K)>=0?Y:[].concat(Xd(Y),[K])},[]))}else if(_==="category")T?D=D.filter(function(Y){return Y!==""&&!dt(Y)}):D=z4(Z,D,g).reduce(function(Y,K){return Y.indexOf(K)>=0||K===""||dt(K)?Y:[].concat(Xd(Y),[K])},[]);else if(_==="number"){var U=P2e(k,i.filter(function(Y){var K,ee,le=o in Y.props?Y.props[o]:(K=Y.type.defaultProps)===null||K===void 0?void 0:K[o],he="hide"in Y.props?Y.props.hide:(ee=Y.type.defaultProps)===null||ee===void 0?void 0:ee.hide;return le===I&&(P||!he)}),b,a,c);U&&(D=U)}d&&(_==="number"||C!=="auto")&&(z=Fg(k,b,"category"))}else d?D=R1(0,E):s&&s[I]&&s[I].hasStack&&_==="number"?D=h==="expand"?[0,1]:cq(s[I].stackGroups,l,u):D=lq(k,i.filter(function(Y){var K=o in Y.props?Y.props[o]:Y.type.defaultProps[o],ee="hide"in Y.props?Y.props.hide:Y.type.defaultProps.hide;return K===I&&(P||!ee)}),_,c,!0);if(_==="number")D=jL(f,D,I,a,A),Z&&(D=rL(Z,D,S));else if(_==="category"&&Z){var G=Z,V=D.every(function(Y){return G.indexOf(Y)>=0});V&&(D=G)}}return ce(ce({},v),{},qe({},I,ce(ce({},y),{},{axisType:a,domain:D,categoricalDomain:z,duplicateDomain:N,originalDomain:(m=y.domain)!==null&&m!==void 0?m:F,isCategorical:d,layout:c})))},{})},ZDe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,f=t.children,h=_T(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),d=h.length,v=uq(c,a),g=-1;return n.reduce(function(m,y){var _=y.type.defaultProps!==void 0?ce(ce({},y.type.defaultProps),y.props):y.props,b=_[o],S=_K("number");if(!m[b]){g++;var T;return v?T=R1(0,d):s&&s[b]&&s[b].hasStack?(T=cq(s[b].stackGroups,l,u),T=jL(f,T,b,a)):(T=rL(S,lq(h,n.filter(function(C){var A,P,I=o in C.props?C.props[o]:(A=C.type.defaultProps)===null||A===void 0?void 0:A[o],k="hide"in C.props?C.props.hide:(P=C.type.defaultProps)===null||P===void 0?void 0:P.hide;return I===b&&!k}),"number",c),i.defaultProps.allowDataOverflow),T=jL(f,T,b,a)),ce(ce({},m),{},qe({},b,ce(ce({axisType:a},i.defaultProps),{},{hide:!0,orientation:oa(VDe,"".concat(a,".").concat(g%2),null),domain:T,originalDomain:S,isCategorical:v,layout:c})))}return m},{})},YDe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=sa(c,a),d={};return h&&h.length?d=UDe(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(d=ZDe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),d},XDe=function(t){var r=Ah(t),n=Lc(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:kD(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:M1(r,n)}},aF=function(t){var r=t.children,n=t.defaultShowTooltip,i=yi(r,Bd),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},qDe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Ss(r&&r.type);return n&&n.indexOf("Bar")>=0})},oF=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"}},KDe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,c=n.height,f=n.children,h=n.margin||{},d=yi(f,Bd),v=yi(f,sd),g=Object.keys(l).reduce(function(T,C){var A=l[C],P=A.orientation;return!A.mirror&&!A.hide?ce(ce({},T),{},qe({},P,T[P]+A.width)):T},{left:h.left||0,right:h.right||0}),m=Object.keys(o).reduce(function(T,C){var A=o[C],P=A.orientation;return!A.mirror&&!A.hide?ce(ce({},T),{},qe({},P,oa(T,"".concat(P))+A.height)):T},{top:h.top||0,bottom:h.bottom||0}),y=ce(ce({},m),g),_=y.bottom;d&&(y.bottom+=d.props.height||Bd.defaultProps.height),v&&r&&(y=A2e(y,i,n,r));var b=u-y.left-y.right,S=c-y.top-y.bottom;return ce(ce({brushBottom:_},y),{},{width:Math.max(b,0),height:Math.max(S,0)})},JDe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},bK=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(y,_){var b=_.graphicalItems,S=_.stackGroups,T=_.offset,C=_.updateId,A=_.dataStartIndex,P=_.dataEndIndex,I=y.barSize,k=y.layout,E=y.barGap,D=y.barCategoryGap,N=y.maxBarSize,z=oF(k),F=z.numericAxisName,$=z.cateAxisName,Z=qDe(b),j=[];return b.forEach(function(U,G){var V=_T(y.data,{graphicalItems:[U],dataStartIndex:A,dataEndIndex:P}),Y=U.type.defaultProps!==void 0?ce(ce({},U.type.defaultProps),U.props):U.props,K=Y.dataKey,ee=Y.maxBarSize,le=Y["".concat(F,"Id")],he=Y["".concat($,"Id")],Re={},ge=l.reduce(function(Xr,qn){var zf=_["".concat(qn.axisType,"Map")],A0=Y["".concat(qn.axisType,"Id")];zf&&zf[A0]||qn.axisType==="zAxis"||lf();var M0=zf[A0];return ce(ce({},Xr),{},qe(qe({},qn.axisType,M0),"".concat(qn.axisType,"Ticks"),Lc(M0)))},Re),ne=ge[$],fe=ge["".concat($,"Ticks")],ue=S&&S[le]&&S[le].hasStack&&$2e(U,S[le].stackGroups),te=Ss(U.type).indexOf("Bar")>=0,Ve=M1(ne,fe),Se=[],Ge=Z&&T2e({barSize:I,stackGroups:S,totalSize:JDe(ge,$)});if(te){var Ye,vt,Ft=dt(ee)?N:ee,rr=(Ye=(vt=M1(ne,fe,!0))!==null&&vt!==void 0?vt:Ft)!==null&&Ye!==void 0?Ye:0;Se=C2e({barGap:E,barCategoryGap:D,bandSize:rr!==Ve?rr:Ve,sizeList:Ge[he],maxBarSize:Ft}),rr!==Ve&&(Se=Se.map(function(Xr){return ce(ce({},Xr),{},{position:ce(ce({},Xr.position),{},{offset:Xr.position.offset-rr/2})})}))}var Nn=U&&U.type&&U.type.getComposedData;Nn&&j.push({props:ce(ce({},Nn(ce(ce({},ge),{},{displayedData:V,props:y,dataKey:K,item:U,bandSize:Ve,barPosition:Se,offset:T,stackedData:ue,layout:k,dataStartIndex:A,dataEndIndex:P}))),{},qe(qe(qe({key:U.key||"item-".concat(G)},F,ge[F]),$,ge[$]),"animationId",C)),childIndex:wve(U,y.children),item:U})}),j},d=function(y,_){var b=y.props,S=y.dataStartIndex,T=y.dataEndIndex,C=y.updateId;if(!E3({props:b}))return null;var A=b.children,P=b.layout,I=b.stackOffset,k=b.data,E=b.reverseStackOrder,D=oF(P),N=D.numericAxisName,z=D.cateAxisName,F=sa(A,n),$=R2e(k,F,"".concat(N,"Id"),"".concat(z,"Id"),I,E),Z=l.reduce(function(Y,K){var ee="".concat(K.axisType,"Map");return ce(ce({},Y),{},qe({},ee,YDe(b,ce(ce({},K),{},{graphicalItems:F,stackGroups:K.axisType===N&&$,dataStartIndex:S,dataEndIndex:T}))))},{}),j=KDe(ce(ce({},Z),{},{props:b,graphicalItems:F}),_==null?void 0:_.legendBBox);Object.keys(Z).forEach(function(Y){Z[Y]=c(b,Z[Y],j,Y.replace("Map",""),r)});var U=Z["".concat(z,"Map")],G=XDe(U),V=h(b,ce(ce({},Z),{},{dataStartIndex:S,dataEndIndex:T,updateId:C,graphicalItems:F,stackGroups:$,offset:j}));return ce(ce({formattedGraphicalItems:V,graphicalItems:F,offset:j,stackGroups:$},G),Z)},v=function(m){function y(_){var b,S,T;return IDe(this,y),T=DDe(this,y,[_]),qe(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),qe(T,"accessibilityManager",new mDe),qe(T,"handleLegendBBoxUpdate",function(C){if(C){var A=T.state,P=A.dataStartIndex,I=A.dataEndIndex,k=A.updateId;T.setState(ce({legendBBox:C},d({props:T.props,dataStartIndex:P,dataEndIndex:I,updateId:k},ce(ce({},T.state),{},{legendBBox:C}))))}}),qe(T,"handleReceiveSyncEvent",function(C,A,P){if(T.props.syncId===C){if(P===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(A)}}),qe(T,"handleBrushChange",function(C){var A=C.startIndex,P=C.endIndex;if(A!==T.state.dataStartIndex||P!==T.state.dataEndIndex){var I=T.state.updateId;T.setState(function(){return ce({dataStartIndex:A,dataEndIndex:P},d({props:T.props,dataStartIndex:A,dataEndIndex:P,updateId:I},T.state))}),T.triggerSyncEvent({dataStartIndex:A,dataEndIndex:P})}}),qe(T,"handleMouseEnter",function(C){var A=T.getMouseInfo(C);if(A){var P=ce(ce({},A),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var I=T.props.onMouseEnter;ft(I)&&I(P,C)}}),qe(T,"triggeredAfterMouseMove",function(C){var A=T.getMouseInfo(C),P=A?ce(ce({},A),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(P),T.triggerSyncEvent(P);var I=T.props.onMouseMove;ft(I)&&I(P,C)}),qe(T,"handleItemMouseEnter",function(C){T.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),qe(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),qe(T,"handleMouseMove",function(C){C.persist(),T.throttleTriggeredAfterMouseMove(C)}),qe(T,"handleMouseLeave",function(C){T.throttleTriggeredAfterMouseMove.cancel();var A={isTooltipActive:!1};T.setState(A),T.triggerSyncEvent(A);var P=T.props.onMouseLeave;ft(P)&&P(A,C)}),qe(T,"handleOuterEvent",function(C){var A=bve(C),P=oa(T.props,"".concat(A));if(A&&ft(P)){var I,k;/.*touch.*/i.test(A)?k=T.getMouseInfo(C.changedTouches[0]):k=T.getMouseInfo(C),P((I=k)!==null&&I!==void 0?I:{},C)}}),qe(T,"handleClick",function(C){var A=T.getMouseInfo(C);if(A){var P=ce(ce({},A),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var I=T.props.onClick;ft(I)&&I(P,C)}}),qe(T,"handleMouseDown",function(C){var A=T.props.onMouseDown;if(ft(A)){var P=T.getMouseInfo(C);A(P,C)}}),qe(T,"handleMouseUp",function(C){var A=T.props.onMouseUp;if(ft(A)){var P=T.getMouseInfo(C);A(P,C)}}),qe(T,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),qe(T,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseDown(C.changedTouches[0])}),qe(T,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseUp(C.changedTouches[0])}),qe(T,"handleDoubleClick",function(C){var A=T.props.onDoubleClick;if(ft(A)){var P=T.getMouseInfo(C);A(P,C)}}),qe(T,"handleContextMenu",function(C){var A=T.props.onContextMenu;if(ft(A)){var P=T.getMouseInfo(C);A(P,C)}}),qe(T,"triggerSyncEvent",function(C){T.props.syncId!==void 0&&$A.emit(FA,T.props.syncId,C,T.eventEmitterSymbol)}),qe(T,"applySyncEvent",function(C){var A=T.props,P=A.layout,I=A.syncMethod,k=T.state.updateId,E=C.dataStartIndex,D=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)T.setState(ce({dataStartIndex:E,dataEndIndex:D},d({props:T.props,dataStartIndex:E,dataEndIndex:D,updateId:k},T.state)));else if(C.activeTooltipIndex!==void 0){var N=C.chartX,z=C.chartY,F=C.activeTooltipIndex,$=T.state,Z=$.offset,j=$.tooltipTicks;if(!Z)return;if(typeof I=="function")F=I(j,C);else if(I==="value"){F=-1;for(var U=0;U=0){var ue,te;if(N.dataKey&&!N.allowDuplicatedCategory){var Ve=typeof N.dataKey=="function"?fe:"payload.".concat(N.dataKey.toString());ue=Xb(U,Ve,F),te=G&&V&&Xb(V,Ve,F)}else ue=U==null?void 0:U[z],te=G&&V&&V[z];if(he||le){var Se=C.props.activeIndex!==void 0?C.props.activeIndex:z;return[W.cloneElement(C,ce(ce(ce({},I.props),ge),{},{activeIndex:Se})),null,null]}if(!dt(ue))return[ne].concat(Xd(T.renderActivePoints({item:I,activePoint:ue,basePoint:te,childIndex:z,isRange:G})))}else{var Ge,Ye=(Ge=T.getItemByXY(T.state.activeCoordinate))!==null&&Ge!==void 0?Ge:{graphicalItem:ne},vt=Ye.graphicalItem,Ft=vt.item,rr=Ft===void 0?C:Ft,Nn=vt.childIndex,Xr=ce(ce(ce({},I.props),ge),{},{activeIndex:Nn});return[W.cloneElement(rr,Xr),null,null]}return G?[ne,null,null]:[ne,null]}),qe(T,"renderCustomized",function(C,A,P){return W.cloneElement(C,ce(ce({key:"recharts-customized-".concat(P)},T.props),T.state))}),qe(T,"renderMap",{CartesianGrid:{handler:Sx,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:Sx},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:Sx},YAxis:{handler:Sx},Brush:{handler:T.renderBrush,once:!0},Bar:{handler:T.renderGraphicChild},Line:{handler:T.renderGraphicChild},Area:{handler:T.renderGraphicChild},Radar:{handler:T.renderGraphicChild},RadialBar:{handler:T.renderGraphicChild},Scatter:{handler:T.renderGraphicChild},Pie:{handler:T.renderGraphicChild},Funnel:{handler:T.renderGraphicChild},Tooltip:{handler:T.renderCursor,once:!0},PolarGrid:{handler:T.renderPolarGrid,once:!0},PolarAngleAxis:{handler:T.renderPolarAxis},PolarRadiusAxis:{handler:T.renderPolarAxis},Customized:{handler:T.renderCustomized}}),T.clipPathId="".concat((b=_.id)!==null&&b!==void 0?b:Cv("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=aX(T.triggeredAfterMouseMove,(S=_.throttleDelay)!==null&&S!==void 0?S:1e3/60),T.state={},T}return RDe(y,m),EDe(y,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,T=b.data,C=b.height,A=b.layout,P=yi(S,ls);if(P){var I=P.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,E=zL(this.state,T,I,k),D=this.state.tooltipTicks[I].coordinate,N=(this.state.offset.top+C)/2,z=A==="horizontal",F=z?{x:D,y:N}:{y:D,x:N},$=this.state.formattedGraphicalItems.find(function(j){var U=j.item;return U.type.name==="Scatter"});$&&(F=ce(ce({},F),$.props.points[I].tooltipPosition),E=$.props.points[I].tooltipPayload);var Z={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:F};this.setState(Z),this.renderCursor(P),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var T,C;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(b){mk([yi(b.children,ls)],[yi(this.props.children,ls)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=yi(this.props.children,ls);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,T=S.getBoundingClientRect(),C=Xwe(T),A={chartX:Math.round(b.pageX-C.left),chartY:Math.round(b.pageY-C.top)},P=T.width/S.offsetWidth||1,I=this.inRange(A.chartX,A.chartY,P);if(!I)return null;var k=this.state,E=k.xAxisMap,D=k.yAxisMap,N=this.getTooltipEventType(),z=iF(this.state,this.props.data,this.props.layout,I);if(N!=="axis"&&E&&D){var F=Ah(E).scale,$=Ah(D).scale,Z=F&&F.invert?F.invert(A.chartX):null,j=$&&$.invert?$.invert(A.chartY):null;return ce(ce({},A),{},{xValue:Z,yValue:j},z)}return z?ce(ce({},A),z):null}},{key:"inRange",value:function(b,S){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,A=b/T,P=S/T;if(C==="horizontal"||C==="vertical"){var I=this.state.offset,k=A>=I.left&&A<=I.left+I.width&&P>=I.top&&P<=I.top+I.height;return k?{x:A,y:P}:null}var E=this.state,D=E.angleAxisMap,N=E.radiusAxisMap;if(D&&N){var z=Ah(D);return V4({x:A,y:P},z)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),T=yi(b,ls),C={};T&&S==="axis"&&(T.props.trigger==="click"?C={onClick:this.handleClick}:C={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 A=qb(this.props,this.handleOuterEvent);return ce(ce({},A),C)}},{key:"addListener",value:function(){$A.on(FA,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){$A.removeListener(FA,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,T){for(var C=this.state.formattedGraphicalItems,A=0,P=C.length;As>=80?"#22c55e":s>=60?"#f59e0b":"#ef4444")(t),a=2*Math.PI*45,o=t/100*a;return x.jsx("div",{className:"flex flex-col items-center",children:x.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[x.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e2a3a",strokeWidth:"8"}),x.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:i,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:a-o,transform:"rotate(-90 50 50)",className:"transition-all duration-500"}),x.jsx("text",{x:"50",y:"46",textAnchor:"middle",className:"fill-slate-100 font-mono text-2xl font-bold",style:{fontSize:"24px"},children:t.toFixed(1)}),x.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"fill-slate-400 text-xs",style:{fontSize:"10px"},children:r})]})})}function Tx({label:e,value:t}){const r=n=>n>=80?"bg-green-500":n>=60?"bg-amber-500":"bg-red-500";return x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:"w-24 text-xs text-slate-400 truncate",children:e}),x.jsx("div",{className:"flex-1 h-2 bg-border rounded-full overflow-hidden",children:x.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),x.jsx("div",{className:"w-12 text-right text-xs font-mono text-slate-300",children:t.toFixed(1)})]})}function rNe({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",icon:au,iconColor:"text-red-500"};case"warning":case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:su,iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:MS,iconColor:"text-blue-500"}}})(e.severity),n=r.icon;return x.jsxs("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[x.jsx(n,{size:16,className:r.iconColor}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:"text-sm text-slate-200",children:e.message}),x.jsx("div",{className:"text-xs text-slate-500 mt-1",children:e.timestamp||"Just now"})]})]})}function nNe({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-amber-500":"bg-green-500":"bg-red-500";return x.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-hover",children:[x.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.name}),x.jsxs("div",{className:"text-xs text-slate-500",children:[e.node_count," nodes · ",e.type]})]})]})}function Cx({icon:e,label:t,value:r,subvalue:n}){return x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4",children:[x.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[x.jsx(e,{size:14}),x.jsx("span",{className:"text-xs",children:t})]}),x.jsx("div",{className:"font-mono text-xl text-slate-100",children:r}),n&&x.jsx("div",{className:"text-xs text-slate-500 mt-1",children:n})]})}function GA({label:e,value:t}){const r=()=>t===0?"bg-green-500/20 text-green-400 border-green-500/50":t<=2?"bg-amber-500/20 text-amber-400 border-amber-500/50":"bg-red-500/20 text-red-400 border-red-500/50";return x.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-medium border ${r()}`,children:[e,t]})}function sF({label:e,value:t,unit:r,getColor:n}){const i=t!==void 0?n(t):"text-slate-400";return x.jsxs("div",{className:"text-center",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:e}),x.jsx("div",{className:`font-mono text-3xl font-bold ${i}`,children:(t==null?void 0:t.toFixed(0))??"—"}),r&&x.jsx("div",{className:"text-xs text-slate-500",children:r})]})}function iNe({history:e}){var a;const t=W.useMemo(()=>!e||e.length===0?[]:e.slice(-16).map((o,s)=>({idx:s,value:o.value,time:o.time})),[e]);if(t.length===0)return null;const r=Math.max(...t.map(o=>o.value),5),n=((a=t[t.length-1])==null?void 0:a.value)??0,i=()=>r>5?"kpGradientRed":r>3?"kpGradientAmber":"kpGradientGreen";return x.jsxs("div",{className:"h-20 w-full",children:[x.jsx(oX,{width:"100%",height:"100%",children:x.jsxs(eNe,{data:t,margin:{top:5,right:5,bottom:5,left:5},children:[x.jsxs("defs",{children:[x.jsxs("linearGradient",{id:"kpGradientGreen",x1:"0",y1:"0",x2:"0",y2:"1",children:[x.jsx("stop",{offset:"0%",stopColor:"#22c55e",stopOpacity:.4}),x.jsx("stop",{offset:"100%",stopColor:"#22c55e",stopOpacity:.05})]}),x.jsxs("linearGradient",{id:"kpGradientAmber",x1:"0",y1:"0",x2:"0",y2:"1",children:[x.jsx("stop",{offset:"0%",stopColor:"#f59e0b",stopOpacity:.4}),x.jsx("stop",{offset:"100%",stopColor:"#f59e0b",stopOpacity:.05})]}),x.jsxs("linearGradient",{id:"kpGradientRed",x1:"0",y1:"0",x2:"0",y2:"1",children:[x.jsx("stop",{offset:"0%",stopColor:"#ef4444",stopOpacity:.4}),x.jsx("stop",{offset:"100%",stopColor:"#ef4444",stopOpacity:.05})]})]}),x.jsx(Dv,{domain:[0,Math.ceil(r)],hide:!0}),x.jsx(Ev,{dataKey:"idx",hide:!0}),x.jsx(sy,{y:3,stroke:"#f59e0b",strokeDasharray:"3 3",strokeOpacity:.5}),x.jsx(sy,{y:5,stroke:"#ef4444",strokeDasharray:"3 3",strokeOpacity:.5}),x.jsx(Su,{type:"monotone",dataKey:"value",stroke:n>5?"#ef4444":n>3?"#f59e0b":"#22c55e",fill:`url(#${i()})`,strokeWidth:2})]})}),x.jsxs("div",{className:"flex justify-between text-xs text-slate-600 px-1",children:[x.jsx("span",{children:"48h ago"}),x.jsx("span",{children:"now"})]})]})}function aNe({profile:e}){const t=W.useMemo(()=>!e||e.length===0?[]:[...e].sort((r,n)=>r.height_m-n.height_m).map(r=>({height:r.height_m,M:r.M})),[e]);return t.length===0?null:x.jsxs("div",{className:"h-24 w-full",children:[x.jsx(oX,{width:"100%",height:"100%",children:x.jsxs(QDe,{data:t,margin:{top:5,right:10,bottom:5,left:5},children:[x.jsx(Ev,{dataKey:"M",type:"number",domain:["dataMin - 20","dataMax + 20"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"}}),x.jsx(Dv,{dataKey:"height",type:"number",domain:[0,"dataMax"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"},tickFormatter:r=>`${(r/1e3).toFixed(1)}k`}),x.jsx(n0,{type:"monotone",dataKey:"M",stroke:"#3b82f6",strokeWidth:2,dot:{r:3,fill:"#3b82f6"}})]})}),x.jsx("div",{className:"text-center text-xs text-slate-600",children:"M-units vs Height (km)"})]})}function oNe({swpc:e,ducting:t}){const r=a=>a>=120?"text-green-400":a>=80?"text-amber-400":"text-red-400",n=a=>a<=3?"text-green-400":a<=5?"text-amber-400":"text-red-400",i=a=>{if(!a)return null;const o={normal:"bg-green-500/20 text-green-400 border-green-500/50",super_refraction:"bg-amber-500/20 text-amber-400 border-amber-500/50",surface_duct:"bg-blue-500/20 text-blue-400 border-blue-500/50",elevated_duct:"bg-blue-500/20 text-blue-400 border-blue-500/50"},s={normal:"Normal",super_refraction:"Super Refraction",surface_duct:"Surface Duct",elevated_duct:"Elevated Duct"};return x.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium border ${o[a]||o.normal}`,children:s[a]||a})};return x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[x.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[x.jsx(Pm,{size:14}),"RF Propagation"]}),x.jsxs("div",{className:"flex justify-around mb-4",children:[x.jsx(sF,{label:"SFI",value:e==null?void 0:e.sfi,getColor:r}),x.jsx("div",{className:"w-px bg-border"}),x.jsx(sF,{label:"Kp",value:e==null?void 0:e.kp_current,getColor:n})]}),x.jsxs("div",{className:"flex justify-center gap-2 mb-4",children:[x.jsx(GA,{label:"R",value:(e==null?void 0:e.r_scale)??0}),x.jsx(GA,{label:"S",value:(e==null?void 0:e.s_scale)??0}),x.jsx(GA,{label:"G",value:(e==null?void 0:e.g_scale)??0})]}),(e==null?void 0:e.kp_history)&&e.kp_history.length>0&&x.jsxs("div",{className:"mb-4",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Kp Trend (48h)"}),x.jsx(iNe,{history:e.kp_history})]}),x.jsx("div",{className:"border-t border-border my-3"}),x.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.jsx(ou,{size:14,className:"text-slate-400"}),x.jsx("span",{className:"text-xs text-slate-500",children:"Tropospheric"}),i(t==null?void 0:t.condition)]}),(t==null?void 0:t.min_gradient)!==void 0&&x.jsxs("div",{className:"text-xs text-slate-400 font-mono mb-2",children:["dM/dz: ",t.min_gradient.toFixed(1)," M-units/km"]}),(t==null?void 0:t.profile)&&t.profile.length>0&&x.jsx(aNe,{profile:t.profile}),(e==null?void 0:e.active_warnings)&&e.active_warnings.length>0&&x.jsxs("div",{className:"mt-auto pt-3 border-t border-border",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"SWPC Alerts"}),x.jsx("div",{className:"flex flex-wrap gap-1",children:e.active_warnings.slice(0,3).map((a,o)=>x.jsx("span",{className:"px-2 py-0.5 rounded text-xs bg-amber-500/20 text-amber-400 border border-amber-500/30 truncate max-w-full",children:a.replace("Space Weather Message Code: ","")},o))})]})]})}const sNe={nws:{icon:ou,color:"text-blue-400",label:"NWS"},swpc:{icon:jZ,color:"text-yellow-400",label:"SWPC"},ducting:{icon:Za,color:"text-cyan-400",label:"Tropo"},nifc:{icon:AS,color:"text-orange-400",label:"NIFC"},firms:{icon:OS,color:"text-red-400",label:"FIRMS"},avalanche:{icon:kS,color:"text-slate-300",label:"Avy"},usgs:{icon:PZ,color:"text-blue-300",label:"USGS"},traffic:{icon:CS,color:"text-purple-400",label:"Traffic"},roads:{icon:AZ,color:"text-amber-400",label:"511"}},lF={routine:"bg-blue-500/20 text-blue-400 border-blue-500/30",priority:"bg-amber-500/20 text-amber-400 border-amber-500/30",immediate:"bg-red-600/20 text-red-300 border-red-600/30",info:"bg-blue-500/20 text-blue-400 border-blue-500/30",advisory:"bg-blue-500/20 text-blue-400 border-blue-500/30",moderate:"bg-amber-500/20 text-amber-400 border-amber-500/30",watch:"bg-amber-500/20 text-amber-400 border-amber-500/30",warning:"bg-amber-500/20 text-amber-400 border-amber-500/30",severe:"bg-red-500/20 text-red-400 border-red-500/30",extreme:"bg-red-600/20 text-red-300 border-red-600/30",critical:"bg-red-600/20 text-red-300 border-red-600/30",emergency:"bg-red-700/20 text-red-200 border-red-700/30"};function lNe({event:e,isLocal:t}){var f;const r=sNe[e.source]||{icon:MS,color:"text-slate-400",label:e.source},n=r.icon,i=lF[(f=e.severity)==null?void 0:f.toLowerCase()]||lF.info,a=h=>{const d=new Date(h*1e3),g=new Date().getTime()-d.getTime(),m=Math.floor(g/6e4);return m<1?"just now":m<60?`${m}m ago`:m<1440?`${Math.floor(m/60)}h ago`:d.toLocaleDateString(void 0,{month:"short",day:"numeric"})},o=e.event_type,s=e.area_desc,l=e.description;let u=e.headline;if(o&&s){const h=s.replace(/ County/g,"").split(";")[0];u=`${o} — ${h}`}else o&&(u=o);const c=l?l.split(". ")[0]:null;return x.jsxs("div",{className:`flex items-start gap-2 py-2 border-b border-border/50 last:border-0 ${t?"border-l-2 border-l-blue-500 pl-2 -ml-2":""}`,children:[x.jsx(n,{size:14,className:`mt-0.5 flex-shrink-0 ${r.color}`}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[x.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs border ${i}`,children:e.severity||"info"}),t&&x.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-blue-500/20 text-blue-400 border border-blue-500/30",children:"LOCAL"}),x.jsx("span",{className:"text-xs text-slate-500",children:r.label}),x.jsx("span",{className:"text-xs text-slate-600 ml-auto",children:a(e.fetched_at)})]}),x.jsx("div",{className:`text-sm truncate ${t?"text-slate-100":"text-slate-300"}`,children:u}),c&&x.jsx("div",{className:"text-xs text-slate-500 truncate mt-0.5",children:c})]})]})}function uNe({events:e,envStatus:t}){const r={immediate:0,priority:1,routine:2},n=W.useMemo(()=>{const a=new Set;return e.filter(s=>s.event_id?a.has(s.event_id)?!1:(a.add(s.event_id),!0):!0).sort((s,l)=>{var d,v;const u=s.is_local?1:0,c=l.is_local?1:0;if(u!==c)return c-u;const f=r[((d=s.severity)==null?void 0:d.toLowerCase())||"routine"]??2,h=r[((v=l.severity)==null?void 0:v.toLowerCase())||"routine"]??2;return f!==h?f-h:(l.fetched_at||0)-(s.fetched_at||0)})},[e]),i=W.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const a=t.feeds.length,o=t.feeds.filter(c=>c.is_loaded&&!c.last_error).length,s=t.feeds.filter(c=>c.last_error).map(c=>c.source),l=Math.max(...t.feeds.map(c=>c.last_fetch||0)),u=l?Math.floor(Date.now()/1e3-l):null;return{total:a,active:o,errors:s,secAgo:u}},[t]);return x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[x.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-3 flex items-center gap-2",children:[x.jsx(yv,{size:14}),"Live Event Feed"]}),n.length>0?x.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:n.map((a,o)=>x.jsx(lNe,{event:a,isLocal:a.is_local},a.event_id||o))}):x.jsx("div",{className:"flex-1 flex items-center justify-center",children:x.jsxs("div",{className:"text-center py-8",children:[x.jsx(JE,{size:24,className:"text-green-500 mx-auto mb-2"}),x.jsx("div",{className:"text-slate-400",children:"No active events"}),x.jsx("div",{className:"text-xs text-slate-500",children:"All clear"})]})}),i&&x.jsxs("div",{className:`text-xs mt-3 pt-3 border-t border-border ${i.errors.length>0?"text-amber-400":"text-slate-500"}`,children:[i.active," of ",i.total," feeds active",i.secAgo!==null&&` · Last update ${i.secAgo}s ago`,i.errors.length>0&&x.jsxs("span",{className:"text-amber-400",children:[" · ",i.errors.join(", "),": error"]})]})]})}function cNe(){var S,T,C,A,P;const[e,t]=W.useState(null),[r,n]=W.useState([]),[i,a]=W.useState([]),[o,s]=W.useState(null),[l,u]=W.useState([]),[c,f]=W.useState(null),[h,d]=W.useState(null),[v,g]=W.useState(!0),[m,y]=W.useState(null),{lastHealth:_,lastMessage:b}=iD();return W.useEffect(()=>{Promise.all([mce(),_ce(),zZ(),$Z(),FZ().catch(()=>[]),wce().catch(()=>null),Sce().catch(()=>null)]).then(([I,k,E,D,N,z,F])=>{t(I),n(k),a(E),s(D),u(N),f(z),d(F),g(!1),document.title="Dashboard — MeshAI"}).catch(I=>{y(I.message),g(!1),document.title="Dashboard — MeshAI"})},[]),W.useEffect(()=>{_&&t(_)},[_]),W.useEffect(()=>{(b==null?void 0:b.type)==="env_update"&&b.event&&u(I=>{const k=b.event,E=I.filter(D=>D.event_id!==k.event_id);return[k,...E].slice(0,100)})},[b]),v?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsx("div",{className:"text-slate-400",children:"Loading..."})}):m?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsxs("div",{className:"text-red-400",children:["Error: ",m]})}):x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[x.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Mesh Health"}),e&&x.jsxs(x.Fragment,{children:[x.jsx(tNe,{health:e}),x.jsxs("div",{className:"mt-6 space-y-3",children:[x.jsx(Tx,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),x.jsx(Tx,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),x.jsx(Tx,{label:"Behavior",value:((C=e.pillars)==null?void 0:C.behavior)??0}),x.jsx(Tx,{label:"Power",value:((A=e.pillars)==null?void 0:A.power)??0})]})]})]}),x.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[x.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Active Alerts"}),i.length>0?x.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:i.map((I,k)=>x.jsx(rNe,{alert:I},k))}):x.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[x.jsx(JE,{size:16,className:"text-green-500"}),x.jsx("span",{children:"No active alerts"})]})]}),x.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[x.jsx(Cx,{icon:Za,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),x.jsx(Cx,{icon:MZ,label:"Infrastructure",value:`${(e==null?void 0:e.infra_online)||0}/${(e==null?void 0:e.infra_total)||0}`,subvalue:(e==null?void 0:e.infra_online)===(e==null?void 0:e.infra_total)?"All online":"Some offline"}),x.jsx(Cx,{icon:yv,label:"Utilization",value:`${((P=e==null?void 0:e.util_percent)==null?void 0:P.toFixed(1))||0}%`,subvalue:`${(e==null?void 0:e.flagged_nodes)||0} flagged`}),x.jsx(Cx,{icon:PS,label:"Regions",value:(e==null?void 0:e.total_regions)||0,subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),x.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[x.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:["Mesh Sources (",r.length,")"]}),r.length>0?x.jsx("div",{className:"space-y-2",children:r.map((I,k)=>x.jsx(nNe,{source:I},k))}):x.jsx("div",{className:"text-slate-500 py-4",children:"No sources configured"})]}),x.jsx(oNe,{swpc:c,ducting:h}),x.jsx(uNe,{events:l,envStatus:o})]})]})}/*! ***************************************************************************** + A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*v," Z")}else c="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return c},zke=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),c=Math.max(a,a+s),f=Math.min(o,o+l),h=Math.max(o,o+l);return n>=u&&n<=c&&i>=f&&i<=h}return!1},$ke={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},oN=function(t){var r=x$(x$({},$ke),t),n=W.useRef(),i=W.useState(-1),a=Ike(i,2),o=a[0],s=a[1];W.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,c=r.width,f=r.height,h=r.radius,d=r.className,v=r.animationEasing,g=r.animationDuration,m=r.animationBegin,x=r.isAnimationActive,_=r.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||c===0||f===0)return null;var b=_t("recharts-rectangle",d);return _?Q.createElement(Fo,{canBegin:o>0,from:{width:c,height:f,x:l,y:u},to:{width:c,height:f,x:l,y:u},duration:g,animationEasing:v,isActive:_},function(S){var T=S.width,C=S.height,A=S.x,P=S.y;return Q.createElement(Fo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,isActive:x,easing:v},Q.createElement("path",R1({},ct(r,!0),{className:b,d:_$(A,P,T,C,h),ref:n})))}):Q.createElement("path",R1({},ct(r,!0),{className:b,d:_$(l,u,c,f,h)}))};function bL(){return bL=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 Zke(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 Yke=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},Xke=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,c=t.width,f=c===void 0?0:c,h=t.height,d=h===void 0?0:h,v=t.className,g=Uke(t,Fke),m=Vke({x:n,y:a,top:s,left:u,width:f,height:d},g);return!we(n)||!we(a)||!we(f)||!we(d)||!we(s)||!we(u)?null:Q.createElement("path",wL({},ct(m,!0),{className:_t("recharts-cross",v),d:Yke(n,a,f,d,s,u)}))},qke=WY,Kke=qke(Object.getPrototypeOf,Object),Jke=Kke,Qke=qs,eLe=Jke,tLe=Ks,rLe="[object Object]",nLe=Function.prototype,iLe=Object.prototype,kq=nLe.toString,aLe=iLe.hasOwnProperty,oLe=kq.call(Object);function sLe(e){if(!tLe(e)||Qke(e)!=rLe)return!1;var t=eLe(e);if(t===null)return!0;var r=aLe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&kq.call(r)==oLe}var lLe=sLe;const uLe=$t(lLe);var cLe=qs,fLe=Ks,hLe="[object Boolean]";function dLe(e){return e===!0||e===!1||fLe(e)&&cLe(e)==hLe}var vLe=dLe;const pLe=$t(vLe);function ny(e){"@babel/helpers - typeof";return ny=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},ny(e)}function B1(){return B1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:c,lowerWidth:f,height:h,x:l,y:u},duration:g,animationEasing:v,isActive:x},function(b){var S=b.upperWidth,T=b.lowerWidth,C=b.height,A=b.x,P=b.y;return Q.createElement(Fo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,easing:v},Q.createElement("path",B1({},ct(r,!0),{className:_,d:C$(A,P,S,T,C),ref:n})))}):Q.createElement("g",null,Q.createElement("path",B1({},ct(r,!0),{className:_,d:C$(l,u,c,f,h)})))},ALe=["option","shapeType","propTransformer","activeClassName","isActive"];function iy(e){"@babel/helpers - typeof";return iy=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},iy(e)}function MLe(e,t){if(e==null)return{};var r=PLe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PLe(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 A$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function z1(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),gi(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),gi(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),gi(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),gi(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),gi(n,"handleSlideDragStart",function(i){var a=E$(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return dIe(t,e),uIe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,c=u.length-1,f=Math.min(i,a),h=Math.max(i,a),d=t.getIndexInRange(o,f),v=t.getIndexInRange(o,h);return{startIndex:d-d%l,endIndex:v===c?c:v-v%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=Hn(a[n],s,n);return ft(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,c=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,v=l.onChange,g=n.pageX-a;g>0?g=Math.min(g,u+c-f-s,u+c-f-o):g<0&&(g=Math.max(g,u-o,u-s));var m=this.getIndex({startX:o+g,endX:s+g});(m.startIndex!==h||m.endIndex!==d)&&v&&v(m),this.setState({startX:o+g,endX:s+g,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=E$(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],c=this.props,f=c.x,h=c.width,d=c.travellerWidth,v=c.onChange,g=c.gap,m=c.data,x={startX:this.state.startX,endX:this.state.endX},_=n.pageX-a;_>0?_=Math.min(_,f+h-d-u):_<0&&(_=Math.max(_,f-u)),x[o]=u+_;var b=this.getIndex(x),S=b.startIndex,T=b.endIndex,C=function(){var P=m.length-1;return o==="startX"&&(s>l?S%g===0:T%g===0)||sl?T%g===0:S%g===0)||s>l&&T===P};this.setState(gi(gi({},o,u+_),"brushMoveStartX",n.pageX),function(){v&&C()&&v(b)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,c=this.state[i],f=s.indexOf(c);if(f!==-1){var h=f+n;if(!(h===-1||h>=s.length)){var d=s[h];i==="startX"&&d>=u||i==="endX"&&d<=l||this.setState(gi({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return Q.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,c=n.padding,f=W.Children.only(u);return f?Q.cloneElement(f,{x:i,y:a,width:o,height:s,margin:c,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,c=l.travellerWidth,f=l.height,h=l.traveller,d=l.ariaLabel,v=l.data,g=l.startIndex,m=l.endIndex,x=Math.max(n,this.props.x),_=FA(FA({},ct(this.props,!1)),{},{x,y:u,width:c,height:f}),b=d||"Min value: ".concat((a=v[g])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[m])===null||o===void 0?void 0:o.name);return Q.createElement(Yt,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),s.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,_))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,c=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,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:l,fillOpacity:.2,x:c,y:o,width:f,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,c=this.state,f=c.startX,h=c.endX,d=5,v={pointerEvents:"none",fill:u};return Q.createElement(Yt,{className:"recharts-brush-texts"},Q.createElement(v1,F1({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},v),this.getTextOfTick(i)),Q.createElement(v1,F1({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:o+s/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,c=n.height,f=n.alwaysShowText,h=this.state,d=h.startX,v=h.endX,g=h.isTextActive,m=h.isSlideMoving,x=h.isTravellerMoving,_=h.isTravellerFocused;if(!i||!i.length||!we(s)||!we(l)||!we(u)||!we(c)||u<=0||c<=0)return null;var b=_t("recharts-brush",a),S=Q.Children.count(o)===1,T=sIe("userSelect","none");return Q.createElement(Yt,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(d,v),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(v,"endX"),(g||m||x||_||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return Q.createElement(Q.Fragment,null,Q.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),Q.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),Q.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return Q.isValidElement(n)?a=Q.cloneElement(n,i):ft(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,c=n.startIndex,f=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return FA({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?pIe({data:a,width:o,x:s,travellerWidth:l,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(W.PureComponent);gi(Bd,"displayName","Brush");gi(Bd,"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 gIe=OD;function mIe(e,t){var r;return gIe(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var yIe=mIe,xIe=jY,_Ie=Iv,bIe=yIe,wIe=ci,SIe=iT;function TIe(e,t,r){var n=wIe(e)?xIe:bIe;return r&&SIe(e,t,r)&&(t=void 0),n(e,_Ie(t))}var CIe=TIe;const AIe=$t(CIe);var Eo=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},D$=nX;function MIe(e,t,r){t=="__proto__"&&D$?D$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var PIe=MIe,kIe=PIe,LIe=tX,IIe=Iv;function OIe(e,t){var r={};return t=IIe(t),LIe(e,function(n,i,a){kIe(r,i,t(n,i,a))}),r}var EIe=OIe;const DIe=$t(EIe);function NIe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function QIe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function eOe(e,t){var r=e.x,n=e.y,i=JIe(e,YIe),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),c=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return Dp(Dp(Dp(Dp(Dp({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function j$(e){return Q.createElement(NLe,TL({shapeType:"rectangle",propTransformer:eOe,activeClassName:"recharts-active-bar"},e))}var tOe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=we(n)||hve(n);return a?t(n,i):(a||lf(),r)}},rOe=["value","background"],Eq;function zd(e){"@babel/helpers - typeof";return zd=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},zd(e)}function nOe(e,t){if(e==null)return{};var r=iOe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iOe(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 G1(){return G1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(F)0&&Math.abs(z)0&&(N=Math.min((ee||0)-(z[le-1]||0),N))}),Number.isFinite(N)){var F=N/D,$=g.layout==="vertical"?n.height:n.width;if(g.padding==="gap"&&(A=F*$/2),g.padding==="no-gap"){var Z=of(t.barCategoryGap,F*$),j=F*$/2;A=j-Z-(j-Z)/$*Z}}}i==="xAxis"?P=[n.left+(b.left||0)+(A||0),n.left+n.width-(b.right||0)-(A||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(A||0),n.top+n.height-(b.bottom||0)-(A||0)]:P=g.range,T&&(P=[P[1],P[0]]);var U=E2e(g,a,h),G=U.scale,V=U.realScaleType;G.domain(x).range(P),D2e(G);var Y=V2e(G,Da(Da({},g),{},{realScaleType:V}));i==="xAxis"?(E=m==="top"&&!S||m==="bottom"&&S,I=n.left,k=f[C]-E*g.height):i==="yAxis"&&(E=m==="left"&&!S||m==="right"&&S,I=f[C]-E*g.width,k=n.top);var K=Da(Da(Da({},g),Y),{},{realScaleType:V,x:I,y:k,scale:G,width:i==="xAxis"?n.width:g.width,height:i==="yAxis"?n.height:g.height});return K.bandSize=L1(K,Y),!g.hide&&i==="xAxis"?f[C]+=(E?-1:1)*K.height:g.hide||(f[C]+=(E?-1:1)*K.width),Da(Da({},d),{},mT({},v,K))},{})},Bq=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},pOe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return Bq({x:r,y:n},{x:i,y:a})},zq=function(){function e(t){hOe(this,e),this.scale=t}return dOe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();mT(zq,"EPS",1e-4);var sN=function(t){var r=Object.keys(t).reduce(function(n,i){return Da(Da({},n),{},mT({},i,zq.create(t[i])))},{});return Da(Da({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return DIe(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return ZIe(i,function(a,o){return r[o].isInRange(a)})}})};function gOe(e){return(e%180+180)%180}var mOe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=gOe(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&oe.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function iEe(e,t){return rK(e,t+1)}function aEe(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,c=o,f=function(){var v=n==null?void 0:n[l];if(v===void 0)return{v:rK(n,u)};var g=l,m,x=function(){return m===void 0&&(m=r(v,g)),m},_=v.coordinate,b=l===0||Y1(e,_,x,c,s);b||(l=0,c=o,u+=1),b&&(c=_+e*(x()/2+i),l+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function cy(e){"@babel/helpers - typeof";return cy=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},cy(e)}function X$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function An(e){for(var t=1;t0?d.coordinate-m*e:d.coordinate})}else a[h]=d=An(An({},d),{},{tickCoord:d.coordinate});var x=Y1(e,d.tickCoord,g,s,l);x&&(l=d.tickCoord-e*(g()/2+i),a[h]=An(An({},d),{},{isShow:!0}))},c=o-1;c>=0;c--)u(c);return a}function cEe(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var c=n[s-1],f=r(c,s-1),h=e*(c.coordinate+e*f/2-u);o[s-1]=c=An(An({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var d=Y1(e,c.tickCoord,function(){return f},l,u);d&&(u=c.tickCoord-e*(f/2+i),o[s-1]=An(An({},c),{},{isShow:!0}))}for(var v=a?s-1:s,g=function(_){var b=o[_],S,T=function(){return S===void 0&&(S=r(b,_)),S};if(_===0){var C=e*(b.coordinate-e*T()/2-l);o[_]=b=An(An({},b),{},{tickCoord:C<0?b.coordinate-C*e:b.coordinate})}else o[_]=b=An(An({},b),{},{tickCoord:b.coordinate});var A=Y1(e,b.tickCoord,T,l,u);A&&(l=b.tickCoord+e*(T()/2+i),o[_]=An(An({},b),{},{isShow:!0}))},m=0;m=2?Ba(i[1].coordinate-i[0].coordinate):1,x=nEe(a,m,d);return l==="equidistantPreserveStart"?aEe(m,x,g,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=cEe(m,x,g,i,o,l==="preserveStartEnd"):h=uEe(m,x,g,i,o),h.filter(function(_){return _.isShow}))}var hEe=["viewBox"],dEe=["viewBox"],vEe=["ticks"];function Gd(e){"@babel/helpers - typeof";return Gd=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},Gd(e)}function Wh(){return Wh=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 pEe(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 gEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K$(e,t){for(var r=0;r0?l(this.props):l(d)),o<=0||s<=0||!v||!v.length?null:Q.createElement(Yt,{className:_t("recharts-cartesian-axis",u),ref:function(m){n.layerReference=m}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Ln.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=_t(i.className,"recharts-cartesian-axis-tick-value");return Q.isValidElement(n)?o=Q.cloneElement(n,Rr(Rr({},i),{},{className:s})):ft(n)?o=n(Rr(Rr({},i),{},{className:s})):o=Q.createElement(v1,Wh({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(W.Component);uN(wT,"displayName","CartesianAxis");uN(wT,"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 SEe=["type","layout","connectNulls","ref"],TEe=["key"];function Wd(e){"@babel/helpers - typeof";return Wd=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},Wd(e)}function J$(e,t){if(e==null)return{};var r=CEe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function CEe(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 Hg(){return Hg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rf){d=[].concat(Jf(l.slice(0,v)),[f-g]);break}var m=d.length%2===0?[0,h]:[h];return[].concat(Jf(t.repeat(l,c)),Jf(d),m).map(function(x){return"".concat(x,"px")}).join(", ")}),Na(r,"id",Mv("recharts-line-")),Na(r,"pathRef",function(o){r.mainCurve=o}),Na(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Na(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return NEe(t,e),IEe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,c=a.children,f=sa(c,i0);if(!f)return null;var h=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Hn(g.payload,m)}},d={clipPath:n?"url(#clipPath-".concat(i,")"):null};return Q.createElement(Yt,d,f.map(function(v){return Q.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,c=s.dataKey,f=ct(this.props,!1),h=ct(l,!0),d=u.map(function(g,m){var x=pi(pi(pi({key:"dot-".concat(m),r:3},f),h),{},{index:m,cx:g.x,cy:g.y,value:g.value,dataKey:c,payload:g.payload,points:u});return t.renderDotItem(l,x)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return Q.createElement(Yt,Hg({className:"recharts-line-dots",key:"dots"},v),d)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,c=s.connectNulls;s.ref;var f=J$(s,SEe),h=pi(pi(pi({},ct(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:c});return Q.createElement(cd,Hg({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,c=o.animationBegin,f=o.animationDuration,h=o.animationEasing,d=o.animationId,v=o.animateNewValues,g=o.width,m=o.height,x=this.state,_=x.prevPoints,b=x.totalLength;return Q.createElement(Fo,{begin:c,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var T=S.t;if(_){var C=_.length/s.length,A=s.map(function(D,N){var z=Math.floor(N*C);if(_[z]){var F=_[z],$=dn(F.x,D.x),Z=dn(F.y,D.y);return pi(pi({},D),{},{x:$(T),y:Z(T)})}if(v){var j=dn(g*2,D.x),U=dn(m/2,D.y);return pi(pi({},D),{},{x:j(T),y:U(T)})}return pi(pi({},D),{},{x:D.x,y:D.y})});return a.renderCurveStatically(A,n,i)}var P=dn(0,b),I=P(T),k;if(l){var E="".concat(l).split(/[,\s]+/gim).map(function(D){return parseFloat(D)});k=a.getStrokeDasharray(I,b,E)}else k=a.generateSimpleStrokeDasharray(b,I);return a.renderCurveStatically(s,n,i,{strokeDasharray:k})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,c=l.totalLength;return s&&o&&o.length&&(!u&&c>0||!Dd(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.xAxis,c=i.yAxis,f=i.top,h=i.left,d=i.width,v=i.height,g=i.isAnimationActive,m=i.id;if(a||!s||!s.length)return null;var x=this.state.isAnimationFinished,_=s.length===1,b=_t("recharts-line",l),S=u&&u.allowDataOverflow,T=c&&c.allowDataOverflow,C=S||T,A=dt(m)?this.id:m,P=(n=ct(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=P.r,k=I===void 0?3:I,E=P.strokeWidth,D=E===void 0?2:E,N=sY(o)?o:{},z=N.clipDot,F=z===void 0?!0:z,$=k*2+D;return Q.createElement(Yt,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(A)},Q.createElement("rect",{x:S?h:h-d/2,y:T?f:f-v/2,width:S?d:d*2,height:T?v:v*2})),!F&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(A)},Q.createElement("rect",{x:h-$/2,y:f-$/2,width:d+$,height:v+$}))):null,!_&&this.renderCurve(C,A),this.renderErrorBar(C,A),(_||o)&&this.renderDots(C,F,A),(!g||x)&&Ms.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Jf(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zEe(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 Ic(){return Ic=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Dd(c,o)||!Dd(f,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,c=i.left,f=i.xAxis,h=i.yAxis,d=i.width,v=i.height,g=i.isAnimationActive,m=i.id;if(a||!s||!s.length)return null;var x=this.state.isAnimationFinished,_=s.length===1,b=_t("recharts-area",l),S=f&&f.allowDataOverflow,T=h&&h.allowDataOverflow,C=S||T,A=dt(m)?this.id:m,P=(n=ct(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=P.r,k=I===void 0?3:I,E=P.strokeWidth,D=E===void 0?2:E,N=sY(o)?o:{},z=N.clipDot,F=z===void 0?!0:z,$=k*2+D;return Q.createElement(Yt,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(A)},Q.createElement("rect",{x:S?c:c-d/2,y:T?u:u-v/2,width:S?d:d*2,height:T?v:v*2})),!F&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(A)},Q.createElement("rect",{x:c-$/2,y:u-$/2,width:d+$,height:v+$}))):null,_?null:this.renderArea(C,A),(o||_)&&this.renderDots(C,F,A),(!g||x)&&Ms.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(W.PureComponent);sK=Su;So(Su,"displayName","Area");So(Su,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Cf.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});So(Su,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(we(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var c=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});So(Su,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,c=e.dataStartIndex,f=e.displayedData,h=e.offset,d=t.layout,v=u&&u.length,g=sK.getBaseValue(t,r,n,i),m=d==="horizontal",x=!1,_=f.map(function(S,T){var C;v?C=u[c+T]:(C=Hn(S,l),Array.isArray(C)?x=!0:C=[g,C]);var A=C[1]==null||v&&Hn(S,l)==null;return m?{x:k1({axis:n,ticks:a,bandSize:s,entry:S,index:T}),y:A?null:i.scale(C[1]),value:C,payload:S}:{x:A?null:n.scale(C[1]),y:k1({axis:i,ticks:o,bandSize:s,entry:S,index:T}),value:C,payload:S}}),b;return v||x?b=_.map(function(S){var T=Array.isArray(S.value)?S.value[0]:null;return m?{x:S.x,y:T!=null&&S.y!=null?i.scale(T):null}:{x:T!=null?n.scale(T):null,y:S.y}}):b=m?i.scale(g):n.scale(g),pl({points:_,baseLine:b,layout:d,isRange:x},h)});So(Su,"renderDotItem",function(e,t){var r;if(Q.isValidElement(e))r=Q.cloneElement(e,t);else if(ft(e))r=e(t);else{var n=_t("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=lK(t,BEe);r=Q.createElement(vT,Ic({},a,{key:i,className:n}))}return r});function Ud(e){"@babel/helpers - typeof";return Ud=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},Ud(e)}function ZEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YEe(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 DDe(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 NDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jDe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&we(i)&&we(a)?t.slice(i,a+1):[]};function TK(e){return e==="number"?[0,"auto"]:void 0}var WL=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=ST(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=f===void 0?s:f;h=Jb(d,o.dataKey,i)}else h=f&&f[n]||s[n];return h?[].concat(Xd(l),[pq(u,h)]):l},[])},lF=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=YDe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=M2e(o,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,h=WL(t,r,c,f),d=XDe(n,s,c,a);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},qDe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,d=dq(c,a);return n.reduce(function(v,g){var m,x=g.type.defaultProps!==void 0?ce(ce({},g.type.defaultProps),g.props):g.props,_=x.type,b=x.dataKey,S=x.allowDataOverflow,T=x.allowDuplicatedCategory,C=x.scale,A=x.ticks,P=x.includeHidden,I=x[o];if(v[I])return v;var k=ST(t.data,{graphicalItems:i.filter(function(Y){var K,ee=o in Y.props?Y.props[o]:(K=Y.type.defaultProps)===null||K===void 0?void 0:K[o];return ee===I}),dataStartIndex:l,dataEndIndex:u}),E=k.length,D,N,z;wDe(x.domain,S,_)&&(D=sL(x.domain,null,S),d&&(_==="number"||C!=="auto")&&(z=Gg(k,b,"category")));var F=TK(_);if(!D||D.length===0){var $,Z=($=x.domain)!==null&&$!==void 0?$:F;if(b){if(D=Gg(k,b,_),_==="category"&&d){var j=vve(D);T&&j?(N=D,D=$1(0,E)):T||(D=G4(Z,D,g).reduce(function(Y,K){return Y.indexOf(K)>=0?Y:[].concat(Xd(Y),[K])},[]))}else if(_==="category")T?D=D.filter(function(Y){return Y!==""&&!dt(Y)}):D=G4(Z,D,g).reduce(function(Y,K){return Y.indexOf(K)>=0||K===""||dt(K)?Y:[].concat(Xd(Y),[K])},[]);else if(_==="number"){var U=O2e(k,i.filter(function(Y){var K,ee,le=o in Y.props?Y.props[o]:(K=Y.type.defaultProps)===null||K===void 0?void 0:K[o],he="hide"in Y.props?Y.props.hide:(ee=Y.type.defaultProps)===null||ee===void 0?void 0:ee.hide;return le===I&&(P||!he)}),b,a,c);U&&(D=U)}d&&(_==="number"||C!=="auto")&&(z=Gg(k,b,"category"))}else d?D=$1(0,E):s&&s[I]&&s[I].hasStack&&_==="number"?D=h==="expand"?[0,1]:vq(s[I].stackGroups,l,u):D=hq(k,i.filter(function(Y){var K=o in Y.props?Y.props[o]:Y.type.defaultProps[o],ee="hide"in Y.props?Y.props.hide:Y.type.defaultProps.hide;return K===I&&(P||!ee)}),_,c,!0);if(_==="number")D=FL(f,D,I,a,A),Z&&(D=sL(Z,D,S));else if(_==="category"&&Z){var G=Z,V=D.every(function(Y){return G.indexOf(Y)>=0});V&&(D=G)}}return ce(ce({},v),{},qe({},I,ce(ce({},x),{},{axisType:a,domain:D,categoricalDomain:z,duplicateDomain:N,originalDomain:(m=x.domain)!==null&&m!==void 0?m:F,isCategorical:d,layout:c})))},{})},KDe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,f=t.children,h=ST(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),d=h.length,v=dq(c,a),g=-1;return n.reduce(function(m,x){var _=x.type.defaultProps!==void 0?ce(ce({},x.type.defaultProps),x.props):x.props,b=_[o],S=TK("number");if(!m[b]){g++;var T;return v?T=$1(0,d):s&&s[b]&&s[b].hasStack?(T=vq(s[b].stackGroups,l,u),T=FL(f,T,b,a)):(T=sL(S,hq(h,n.filter(function(C){var A,P,I=o in C.props?C.props[o]:(A=C.type.defaultProps)===null||A===void 0?void 0:A[o],k="hide"in C.props?C.props.hide:(P=C.type.defaultProps)===null||P===void 0?void 0:P.hide;return I===b&&!k}),"number",c),i.defaultProps.allowDataOverflow),T=FL(f,T,b,a)),ce(ce({},m),{},qe({},b,ce(ce({axisType:a},i.defaultProps),{},{hide:!0,orientation:oa(UDe,"".concat(a,".").concat(g%2),null),domain:T,originalDomain:S,isCategorical:v,layout:c})))}return m},{})},JDe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=sa(c,a),d={};return h&&h.length?d=qDe(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(d=KDe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),d},QDe=function(t){var r=Ah(t),n=Lc(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:ED(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:L1(r,n)}},uF=function(t){var r=t.children,n=t.defaultShowTooltip,i=yi(r,Bd),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},eNe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Cs(r&&r.type);return n&&n.indexOf("Bar")>=0})},cF=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"}},tNe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,c=n.height,f=n.children,h=n.margin||{},d=yi(f,Bd),v=yi(f,sd),g=Object.keys(l).reduce(function(T,C){var A=l[C],P=A.orientation;return!A.mirror&&!A.hide?ce(ce({},T),{},qe({},P,T[P]+A.width)):T},{left:h.left||0,right:h.right||0}),m=Object.keys(o).reduce(function(T,C){var A=o[C],P=A.orientation;return!A.mirror&&!A.hide?ce(ce({},T),{},qe({},P,oa(T,"".concat(P))+A.height)):T},{top:h.top||0,bottom:h.bottom||0}),x=ce(ce({},m),g),_=x.bottom;d&&(x.bottom+=d.props.height||Bd.defaultProps.height),v&&r&&(x=L2e(x,i,n,r));var b=u-x.left-x.right,S=c-x.top-x.bottom;return ce(ce({brushBottom:_},x),{},{width:Math.max(b,0),height:Math.max(S,0)})},rNe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},CK=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(x,_){var b=_.graphicalItems,S=_.stackGroups,T=_.offset,C=_.updateId,A=_.dataStartIndex,P=_.dataEndIndex,I=x.barSize,k=x.layout,E=x.barGap,D=x.barCategoryGap,N=x.maxBarSize,z=cF(k),F=z.numericAxisName,$=z.cateAxisName,Z=eNe(b),j=[];return b.forEach(function(U,G){var V=ST(x.data,{graphicalItems:[U],dataStartIndex:A,dataEndIndex:P}),Y=U.type.defaultProps!==void 0?ce(ce({},U.type.defaultProps),U.props):U.props,K=Y.dataKey,ee=Y.maxBarSize,le=Y["".concat(F,"Id")],he=Y["".concat($,"Id")],Re={},ge=l.reduce(function(Xr,qn){var zf=_["".concat(qn.axisType,"Map")],k0=Y["".concat(qn.axisType,"Id")];zf&&zf[k0]||qn.axisType==="zAxis"||lf();var L0=zf[k0];return ce(ce({},Xr),{},qe(qe({},qn.axisType,L0),"".concat(qn.axisType,"Ticks"),Lc(L0)))},Re),ne=ge[$],fe=ge["".concat($,"Ticks")],ue=S&&S[le]&&S[le].hasStack&&W2e(U,S[le].stackGroups),te=Cs(U.type).indexOf("Bar")>=0,Ve=L1(ne,fe),Se=[],Ge=Z&&P2e({barSize:I,stackGroups:S,totalSize:rNe(ge,$)});if(te){var Ye,vt,Ft=dt(ee)?N:ee,rr=(Ye=(vt=L1(ne,fe,!0))!==null&&vt!==void 0?vt:Ft)!==null&&Ye!==void 0?Ye:0;Se=k2e({barGap:E,barCategoryGap:D,bandSize:rr!==Ve?rr:Ve,sizeList:Ge[he],maxBarSize:Ft}),rr!==Ve&&(Se=Se.map(function(Xr){return ce(ce({},Xr),{},{position:ce(ce({},Xr.position),{},{offset:Xr.position.offset-rr/2})})}))}var Nn=U&&U.type&&U.type.getComposedData;Nn&&j.push({props:ce(ce({},Nn(ce(ce({},ge),{},{displayedData:V,props:x,dataKey:K,item:U,bandSize:Ve,barPosition:Se,offset:T,stackedData:ue,layout:k,dataStartIndex:A,dataEndIndex:P}))),{},qe(qe(qe({key:U.key||"item-".concat(G)},F,ge[F]),$,ge[$]),"animationId",C)),childIndex:Ave(U,x.children),item:U})}),j},d=function(x,_){var b=x.props,S=x.dataStartIndex,T=x.dataEndIndex,C=x.updateId;if(!RB({props:b}))return null;var A=b.children,P=b.layout,I=b.stackOffset,k=b.data,E=b.reverseStackOrder,D=cF(P),N=D.numericAxisName,z=D.cateAxisName,F=sa(A,n),$=F2e(k,F,"".concat(N,"Id"),"".concat(z,"Id"),I,E),Z=l.reduce(function(Y,K){var ee="".concat(K.axisType,"Map");return ce(ce({},Y),{},qe({},ee,JDe(b,ce(ce({},K),{},{graphicalItems:F,stackGroups:K.axisType===N&&$,dataStartIndex:S,dataEndIndex:T}))))},{}),j=tNe(ce(ce({},Z),{},{props:b,graphicalItems:F}),_==null?void 0:_.legendBBox);Object.keys(Z).forEach(function(Y){Z[Y]=c(b,Z[Y],j,Y.replace("Map",""),r)});var U=Z["".concat(z,"Map")],G=QDe(U),V=h(b,ce(ce({},Z),{},{dataStartIndex:S,dataEndIndex:T,updateId:C,graphicalItems:F,stackGroups:$,offset:j}));return ce(ce({formattedGraphicalItems:V,graphicalItems:F,offset:j,stackGroups:$},G),Z)},v=function(m){function x(_){var b,S,T;return NDe(this,x),T=BDe(this,x,[_]),qe(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),qe(T,"accessibilityManager",new bDe),qe(T,"handleLegendBBoxUpdate",function(C){if(C){var A=T.state,P=A.dataStartIndex,I=A.dataEndIndex,k=A.updateId;T.setState(ce({legendBBox:C},d({props:T.props,dataStartIndex:P,dataEndIndex:I,updateId:k},ce(ce({},T.state),{},{legendBBox:C}))))}}),qe(T,"handleReceiveSyncEvent",function(C,A,P){if(T.props.syncId===C){if(P===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(A)}}),qe(T,"handleBrushChange",function(C){var A=C.startIndex,P=C.endIndex;if(A!==T.state.dataStartIndex||P!==T.state.dataEndIndex){var I=T.state.updateId;T.setState(function(){return ce({dataStartIndex:A,dataEndIndex:P},d({props:T.props,dataStartIndex:A,dataEndIndex:P,updateId:I},T.state))}),T.triggerSyncEvent({dataStartIndex:A,dataEndIndex:P})}}),qe(T,"handleMouseEnter",function(C){var A=T.getMouseInfo(C);if(A){var P=ce(ce({},A),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var I=T.props.onMouseEnter;ft(I)&&I(P,C)}}),qe(T,"triggeredAfterMouseMove",function(C){var A=T.getMouseInfo(C),P=A?ce(ce({},A),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(P),T.triggerSyncEvent(P);var I=T.props.onMouseMove;ft(I)&&I(P,C)}),qe(T,"handleItemMouseEnter",function(C){T.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),qe(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),qe(T,"handleMouseMove",function(C){C.persist(),T.throttleTriggeredAfterMouseMove(C)}),qe(T,"handleMouseLeave",function(C){T.throttleTriggeredAfterMouseMove.cancel();var A={isTooltipActive:!1};T.setState(A),T.triggerSyncEvent(A);var P=T.props.onMouseLeave;ft(P)&&P(A,C)}),qe(T,"handleOuterEvent",function(C){var A=Cve(C),P=oa(T.props,"".concat(A));if(A&&ft(P)){var I,k;/.*touch.*/i.test(A)?k=T.getMouseInfo(C.changedTouches[0]):k=T.getMouseInfo(C),P((I=k)!==null&&I!==void 0?I:{},C)}}),qe(T,"handleClick",function(C){var A=T.getMouseInfo(C);if(A){var P=ce(ce({},A),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var I=T.props.onClick;ft(I)&&I(P,C)}}),qe(T,"handleMouseDown",function(C){var A=T.props.onMouseDown;if(ft(A)){var P=T.getMouseInfo(C);A(P,C)}}),qe(T,"handleMouseUp",function(C){var A=T.props.onMouseUp;if(ft(A)){var P=T.getMouseInfo(C);A(P,C)}}),qe(T,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),qe(T,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseDown(C.changedTouches[0])}),qe(T,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseUp(C.changedTouches[0])}),qe(T,"handleDoubleClick",function(C){var A=T.props.onDoubleClick;if(ft(A)){var P=T.getMouseInfo(C);A(P,C)}}),qe(T,"handleContextMenu",function(C){var A=T.props.onContextMenu;if(ft(A)){var P=T.getMouseInfo(C);A(P,C)}}),qe(T,"triggerSyncEvent",function(C){T.props.syncId!==void 0&&GA.emit(WA,T.props.syncId,C,T.eventEmitterSymbol)}),qe(T,"applySyncEvent",function(C){var A=T.props,P=A.layout,I=A.syncMethod,k=T.state.updateId,E=C.dataStartIndex,D=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)T.setState(ce({dataStartIndex:E,dataEndIndex:D},d({props:T.props,dataStartIndex:E,dataEndIndex:D,updateId:k},T.state)));else if(C.activeTooltipIndex!==void 0){var N=C.chartX,z=C.chartY,F=C.activeTooltipIndex,$=T.state,Z=$.offset,j=$.tooltipTicks;if(!Z)return;if(typeof I=="function")F=I(j,C);else if(I==="value"){F=-1;for(var U=0;U=0){var ue,te;if(N.dataKey&&!N.allowDuplicatedCategory){var Ve=typeof N.dataKey=="function"?fe:"payload.".concat(N.dataKey.toString());ue=Jb(U,Ve,F),te=G&&V&&Jb(V,Ve,F)}else ue=U==null?void 0:U[z],te=G&&V&&V[z];if(he||le){var Se=C.props.activeIndex!==void 0?C.props.activeIndex:z;return[W.cloneElement(C,ce(ce(ce({},I.props),ge),{},{activeIndex:Se})),null,null]}if(!dt(ue))return[ne].concat(Xd(T.renderActivePoints({item:I,activePoint:ue,basePoint:te,childIndex:z,isRange:G})))}else{var Ge,Ye=(Ge=T.getItemByXY(T.state.activeCoordinate))!==null&&Ge!==void 0?Ge:{graphicalItem:ne},vt=Ye.graphicalItem,Ft=vt.item,rr=Ft===void 0?C:Ft,Nn=vt.childIndex,Xr=ce(ce(ce({},I.props),ge),{},{activeIndex:Nn});return[W.cloneElement(rr,Xr),null,null]}return G?[ne,null,null]:[ne,null]}),qe(T,"renderCustomized",function(C,A,P){return W.cloneElement(C,ce(ce({key:"recharts-customized-".concat(P)},T.props),T.state))}),qe(T,"renderMap",{CartesianGrid:{handler:Ax,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:Ax},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:Ax},YAxis:{handler:Ax},Brush:{handler:T.renderBrush,once:!0},Bar:{handler:T.renderGraphicChild},Line:{handler:T.renderGraphicChild},Area:{handler:T.renderGraphicChild},Radar:{handler:T.renderGraphicChild},RadialBar:{handler:T.renderGraphicChild},Scatter:{handler:T.renderGraphicChild},Pie:{handler:T.renderGraphicChild},Funnel:{handler:T.renderGraphicChild},Tooltip:{handler:T.renderCursor,once:!0},PolarGrid:{handler:T.renderPolarGrid,once:!0},PolarAngleAxis:{handler:T.renderPolarAxis},PolarRadiusAxis:{handler:T.renderPolarAxis},Customized:{handler:T.renderCustomized}}),T.clipPathId="".concat((b=_.id)!==null&&b!==void 0?b:Mv("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=uX(T.triggeredAfterMouseMove,(S=_.throttleDelay)!==null&&S!==void 0?S:1e3/60),T.state={},T}return FDe(x,m),RDe(x,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,T=b.data,C=b.height,A=b.layout,P=yi(S,cs);if(P){var I=P.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,E=WL(this.state,T,I,k),D=this.state.tooltipTicks[I].coordinate,N=(this.state.offset.top+C)/2,z=A==="horizontal",F=z?{x:D,y:N}:{y:D,x:N},$=this.state.formattedGraphicalItems.find(function(j){var U=j.item;return U.type.name==="Scatter"});$&&(F=ce(ce({},F),$.props.points[I].tooltipPosition),E=$.props.points[I].tooltipPayload);var Z={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:F};this.setState(Z),this.renderCursor(P),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var T,C;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(b){wk([yi(b.children,cs)],[yi(this.props.children,cs)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=yi(this.props.children,cs);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,T=S.getBoundingClientRect(),C=Qwe(T),A={chartX:Math.round(b.pageX-C.left),chartY:Math.round(b.pageY-C.top)},P=T.width/S.offsetWidth||1,I=this.inRange(A.chartX,A.chartY,P);if(!I)return null;var k=this.state,E=k.xAxisMap,D=k.yAxisMap,N=this.getTooltipEventType(),z=lF(this.state,this.props.data,this.props.layout,I);if(N!=="axis"&&E&&D){var F=Ah(E).scale,$=Ah(D).scale,Z=F&&F.invert?F.invert(A.chartX):null,j=$&&$.invert?$.invert(A.chartY):null;return ce(ce({},A),{},{xValue:Z,yValue:j},z)}return z?ce(ce({},A),z):null}},{key:"inRange",value:function(b,S){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,A=b/T,P=S/T;if(C==="horizontal"||C==="vertical"){var I=this.state.offset,k=A>=I.left&&A<=I.left+I.width&&P>=I.top&&P<=I.top+I.height;return k?{x:A,y:P}:null}var E=this.state,D=E.angleAxisMap,N=E.radiusAxisMap;if(D&&N){var z=Ah(D);return U4({x:A,y:P},z)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),T=yi(b,cs),C={};T&&S==="axis"&&(T.props.trigger==="click"?C={onClick:this.handleClick}:C={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 A=Qb(this.props,this.handleOuterEvent);return ce(ce({},A),C)}},{key:"addListener",value:function(){GA.on(WA,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){GA.removeListener(WA,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,T){for(var C=this.state.formattedGraphicalItems,A=0,P=C.length;As>=80?"#22c55e":s>=60?"#f59e0b":"#ef4444")(t),a=2*Math.PI*45,o=t/100*a;return y.jsx("div",{className:"flex flex-col items-center",children:y.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[y.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e2a3a",strokeWidth:"8"}),y.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:i,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:a-o,transform:"rotate(-90 50 50)",className:"transition-all duration-500"}),y.jsx("text",{x:"50",y:"46",textAnchor:"middle",className:"fill-slate-100 font-mono text-2xl font-bold",style:{fontSize:"24px"},children:t.toFixed(1)}),y.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"fill-slate-400 text-xs",style:{fontSize:"10px"},children:r})]})})}function Mx({label:e,value:t}){const r=n=>n>=80?"bg-green-500":n>=60?"bg-amber-500":"bg-red-500";return y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("div",{className:"w-24 text-xs text-slate-400 truncate",children:e}),y.jsx("div",{className:"flex-1 h-2 bg-border rounded-full overflow-hidden",children:y.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),y.jsx("div",{className:"w-12 text-right text-xs font-mono text-slate-300",children:t.toFixed(1)})]})}function oNe({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",icon:ou,iconColor:"text-red-500"};case"warning":case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:lu,iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:IS,iconColor:"text-blue-500"}}})(e.severity),n=r.icon;return y.jsxs("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[y.jsx(n,{size:16,className:r.iconColor}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"text-sm text-slate-200",children:e.message}),y.jsx("div",{className:"text-xs text-slate-500 mt-1",children:e.timestamp||"Just now"})]})]})}function sNe({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-amber-500":"bg-green-500":"bg-red-500";return y.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-hover",children:[y.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.name}),y.jsxs("div",{className:"text-xs text-slate-500",children:[e.node_count," nodes · ",e.type]})]})]})}function Px({icon:e,label:t,value:r,subvalue:n}){return y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4",children:[y.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[y.jsx(e,{size:14}),y.jsx("span",{className:"text-xs",children:t})]}),y.jsx("div",{className:"font-mono text-xl text-slate-100",children:r}),n&&y.jsx("div",{className:"text-xs text-slate-500 mt-1",children:n})]})}function UA({label:e,value:t}){const r=()=>t===0?"bg-green-500/20 text-green-400 border-green-500/50":t<=2?"bg-amber-500/20 text-amber-400 border-amber-500/50":"bg-red-500/20 text-red-400 border-red-500/50";return y.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-medium border ${r()}`,children:[e,t]})}function fF({label:e,value:t,unit:r,getColor:n}){const i=t!==void 0?n(t):"text-slate-400";return y.jsxs("div",{className:"text-center",children:[y.jsx("div",{className:"text-xs text-slate-500 mb-1",children:e}),y.jsx("div",{className:`font-mono text-3xl font-bold ${i}`,children:(t==null?void 0:t.toFixed(0))??"—"}),r&&y.jsx("div",{className:"text-xs text-slate-500",children:r})]})}function lNe({history:e}){var a;const t=W.useMemo(()=>!e||e.length===0?[]:e.slice(-16).map((o,s)=>({idx:s,value:o.value,time:o.time})),[e]);if(t.length===0)return null;const r=Math.max(...t.map(o=>o.value),5),n=((a=t[t.length-1])==null?void 0:a.value)??0,i=()=>r>5?"kpGradientRed":r>3?"kpGradientAmber":"kpGradientGreen";return y.jsxs("div",{className:"h-20 w-full",children:[y.jsx(cX,{width:"100%",height:"100%",children:y.jsxs(iNe,{data:t,margin:{top:5,right:5,bottom:5,left:5},children:[y.jsxs("defs",{children:[y.jsxs("linearGradient",{id:"kpGradientGreen",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#22c55e",stopOpacity:.4}),y.jsx("stop",{offset:"100%",stopColor:"#22c55e",stopOpacity:.05})]}),y.jsxs("linearGradient",{id:"kpGradientAmber",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#f59e0b",stopOpacity:.4}),y.jsx("stop",{offset:"100%",stopColor:"#f59e0b",stopOpacity:.05})]}),y.jsxs("linearGradient",{id:"kpGradientRed",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#ef4444",stopOpacity:.4}),y.jsx("stop",{offset:"100%",stopColor:"#ef4444",stopOpacity:.05})]})]}),y.jsx(jv,{domain:[0,Math.ceil(r)],hide:!0}),y.jsx(Nv,{dataKey:"idx",hide:!0}),y.jsx(uy,{y:3,stroke:"#f59e0b",strokeDasharray:"3 3",strokeOpacity:.5}),y.jsx(uy,{y:5,stroke:"#ef4444",strokeDasharray:"3 3",strokeOpacity:.5}),y.jsx(Su,{type:"monotone",dataKey:"value",stroke:n>5?"#ef4444":n>3?"#f59e0b":"#22c55e",fill:`url(#${i()})`,strokeWidth:2})]})}),y.jsxs("div",{className:"flex justify-between text-xs text-slate-600 px-1",children:[y.jsx("span",{children:"48h ago"}),y.jsx("span",{children:"now"})]})]})}function uNe({profile:e}){const t=W.useMemo(()=>!e||e.length===0?[]:[...e].sort((r,n)=>r.height_m-n.height_m).map(r=>({height:r.height_m,M:r.M})),[e]);return t.length===0?null:y.jsxs("div",{className:"h-24 w-full",children:[y.jsx(cX,{width:"100%",height:"100%",children:y.jsxs(nNe,{data:t,margin:{top:5,right:10,bottom:5,left:5},children:[y.jsx(Nv,{dataKey:"M",type:"number",domain:["dataMin - 20","dataMax + 20"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"}}),y.jsx(jv,{dataKey:"height",type:"number",domain:[0,"dataMax"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"},tickFormatter:r=>`${(r/1e3).toFixed(1)}k`}),y.jsx(o0,{type:"monotone",dataKey:"M",stroke:"#3b82f6",strokeWidth:2,dot:{r:3,fill:"#3b82f6"}})]})}),y.jsx("div",{className:"text-center text-xs text-slate-600",children:"M-units vs Height (km)"})]})}function cNe({swpc:e,ducting:t}){const r=a=>a>=120?"text-green-400":a>=80?"text-amber-400":"text-red-400",n=a=>a<=3?"text-green-400":a<=5?"text-amber-400":"text-red-400",i=a=>{if(!a)return null;const o={normal:"bg-green-500/20 text-green-400 border-green-500/50",super_refraction:"bg-amber-500/20 text-amber-400 border-amber-500/50",surface_duct:"bg-blue-500/20 text-blue-400 border-blue-500/50",elevated_duct:"bg-blue-500/20 text-blue-400 border-blue-500/50"},s={normal:"Normal",super_refraction:"Super Refraction",surface_duct:"Surface Duct",elevated_duct:"Elevated Duct"};return y.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium border ${o[a]||o.normal}`,children:s[a]||a})};return y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[y.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[y.jsx(Lm,{size:14}),"RF Propagation"]}),y.jsxs("div",{className:"flex justify-around mb-4",children:[y.jsx(fF,{label:"SFI",value:e==null?void 0:e.sfi,getColor:r}),y.jsx("div",{className:"w-px bg-border"}),y.jsx(fF,{label:"Kp",value:e==null?void 0:e.kp_current,getColor:n})]}),y.jsxs("div",{className:"flex justify-center gap-2 mb-4",children:[y.jsx(UA,{label:"R",value:(e==null?void 0:e.r_scale)??0}),y.jsx(UA,{label:"S",value:(e==null?void 0:e.s_scale)??0}),y.jsx(UA,{label:"G",value:(e==null?void 0:e.g_scale)??0})]}),(e==null?void 0:e.kp_history)&&e.kp_history.length>0&&y.jsxs("div",{className:"mb-4",children:[y.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Kp Trend (48h)"}),y.jsx(lNe,{history:e.kp_history})]}),y.jsx("div",{className:"border-t border-border my-3"}),y.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[y.jsx(su,{size:14,className:"text-slate-400"}),y.jsx("span",{className:"text-xs text-slate-500",children:"Tropospheric"}),i(t==null?void 0:t.condition)]}),(t==null?void 0:t.min_gradient)!==void 0&&y.jsxs("div",{className:"text-xs text-slate-400 font-mono mb-2",children:["dM/dz: ",t.min_gradient.toFixed(1)," M-units/km"]}),(t==null?void 0:t.profile)&&t.profile.length>0&&y.jsx(uNe,{profile:t.profile}),(e==null?void 0:e.active_warnings)&&e.active_warnings.length>0&&y.jsxs("div",{className:"mt-auto pt-3 border-t border-border",children:[y.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"SWPC Alerts"}),y.jsx("div",{className:"flex flex-wrap gap-1",children:e.active_warnings.slice(0,3).map((a,o)=>y.jsx("span",{className:"px-2 py-0.5 rounded text-xs bg-amber-500/20 text-amber-400 border border-amber-500/30 truncate max-w-full",children:a.replace("Space Weather Message Code: ","")},o))})]})]})}const fNe={nws:{icon:su,color:"text-blue-400",label:"NWS"},swpc:{icon:$Z,color:"text-yellow-400",label:"SWPC"},ducting:{icon:Ya,color:"text-cyan-400",label:"Tropo"},nifc:{icon:LS,color:"text-orange-400",label:"NIFC"},firms:{icon:NS,color:"text-red-400",label:"FIRMS"},avalanche:{icon:ES,color:"text-slate-300",label:"Avy"},usgs:{icon:kS,color:"text-blue-300",label:"USGS"},traffic:{icon:PS,color:"text-purple-400",label:"Traffic"},roads:{icon:OZ,color:"text-amber-400",label:"511"}},hF={routine:"bg-blue-500/20 text-blue-400 border-blue-500/30",priority:"bg-amber-500/20 text-amber-400 border-amber-500/30",immediate:"bg-red-600/20 text-red-300 border-red-600/30",info:"bg-blue-500/20 text-blue-400 border-blue-500/30",advisory:"bg-blue-500/20 text-blue-400 border-blue-500/30",moderate:"bg-amber-500/20 text-amber-400 border-amber-500/30",watch:"bg-amber-500/20 text-amber-400 border-amber-500/30",warning:"bg-amber-500/20 text-amber-400 border-amber-500/30",severe:"bg-red-500/20 text-red-400 border-red-500/30",extreme:"bg-red-600/20 text-red-300 border-red-600/30",critical:"bg-red-600/20 text-red-300 border-red-600/30",emergency:"bg-red-700/20 text-red-200 border-red-700/30"};function hNe({event:e,isLocal:t}){var f;const r=fNe[e.source]||{icon:IS,color:"text-slate-400",label:e.source},n=r.icon,i=hF[(f=e.severity)==null?void 0:f.toLowerCase()]||hF.info,a=h=>{const d=new Date(h*1e3),g=new Date().getTime()-d.getTime(),m=Math.floor(g/6e4);return m<1?"just now":m<60?`${m}m ago`:m<1440?`${Math.floor(m/60)}h ago`:d.toLocaleDateString(void 0,{month:"short",day:"numeric"})},o=e.event_type,s=e.area_desc,l=e.description;let u=e.headline;if(o&&s){const h=s.replace(/ County/g,"").split(";")[0];u=`${o} — ${h}`}else o&&(u=o);const c=l?l.split(". ")[0]:null;return y.jsxs("div",{className:`flex items-start gap-2 py-2 border-b border-border/50 last:border-0 ${t?"border-l-2 border-l-blue-500 pl-2 -ml-2":""}`,children:[y.jsx(n,{size:14,className:`mt-0.5 flex-shrink-0 ${r.color}`}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[y.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs border ${i}`,children:e.severity||"info"}),t&&y.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-blue-500/20 text-blue-400 border border-blue-500/30",children:"LOCAL"}),y.jsx("span",{className:"text-xs text-slate-500",children:r.label}),y.jsx("span",{className:"text-xs text-slate-600 ml-auto",children:a(e.fetched_at)})]}),y.jsx("div",{className:`text-sm truncate ${t?"text-slate-100":"text-slate-300"}`,children:u}),c&&y.jsx("div",{className:"text-xs text-slate-500 truncate mt-0.5",children:c})]})]})}function dNe({events:e,envStatus:t}){const r={immediate:0,priority:1,routine:2},n=W.useMemo(()=>{const a=new Set;return e.filter(s=>s.event_id?a.has(s.event_id)?!1:(a.add(s.event_id),!0):!0).sort((s,l)=>{var d,v;const u=s.is_local?1:0,c=l.is_local?1:0;if(u!==c)return c-u;const f=r[((d=s.severity)==null?void 0:d.toLowerCase())||"routine"]??2,h=r[((v=l.severity)==null?void 0:v.toLowerCase())||"routine"]??2;return f!==h?f-h:(l.fetched_at||0)-(s.fetched_at||0)})},[e]),i=W.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const a=t.feeds.length,o=t.feeds.filter(c=>c.is_loaded&&!c.last_error).length,s=t.feeds.filter(c=>c.last_error).map(c=>c.source),l=Math.max(...t.feeds.map(c=>c.last_fetch||0)),u=l?Math.floor(Date.now()/1e3-l):null;return{total:a,active:o,errors:s,secAgo:u}},[t]);return y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[y.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-3 flex items-center gap-2",children:[y.jsx(yv,{size:14}),"Live Event Feed"]}),n.length>0?y.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:n.map((a,o)=>y.jsx(hNe,{event:a,isLocal:a.is_local},a.event_id||o))}):y.jsx("div",{className:"flex-1 flex items-center justify-center",children:y.jsxs("div",{className:"text-center py-8",children:[y.jsx(nD,{size:24,className:"text-green-500 mx-auto mb-2"}),y.jsx("div",{className:"text-slate-400",children:"No active events"}),y.jsx("div",{className:"text-xs text-slate-500",children:"All clear"})]})}),i&&y.jsxs("div",{className:`text-xs mt-3 pt-3 border-t border-border ${i.errors.length>0?"text-amber-400":"text-slate-500"}`,children:[i.active," of ",i.total," feeds active",i.secAgo!==null&&` · Last update ${i.secAgo}s ago`,i.errors.length>0&&y.jsxs("span",{className:"text-amber-400",children:[" · ",i.errors.join(", "),": error"]})]})]})}function vNe(){var S,T,C,A,P;const[e,t]=W.useState(null),[r,n]=W.useState([]),[i,a]=W.useState([]),[o,s]=W.useState(null),[l,u]=W.useState([]),[c,f]=W.useState(null),[h,d]=W.useState(null),[v,g]=W.useState(!0),[m,x]=W.useState(null),{lastHealth:_,lastMessage:b}=lD();return W.useEffect(()=>{Promise.all([bce(),Tce(),GZ(),WZ(),HZ().catch(()=>[]),Ace().catch(()=>null),Mce().catch(()=>null)]).then(([I,k,E,D,N,z,F])=>{t(I),n(k),a(E),s(D),u(N),f(z),d(F),g(!1),document.title="Dashboard — MeshAI"}).catch(I=>{x(I.message),g(!1),document.title="Dashboard — MeshAI"})},[]),W.useEffect(()=>{_&&t(_)},[_]),W.useEffect(()=>{(b==null?void 0:b.type)==="env_update"&&b.event&&u(I=>{const k=b.event,E=I.filter(D=>D.event_id!==k.event_id);return[k,...E].slice(0,100)})},[b]),v?y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsx("div",{className:"text-slate-400",children:"Loading..."})}):m?y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsxs("div",{className:"text-red-400",children:["Error: ",m]})}):y.jsxs("div",{className:"space-y-6",children:[y.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[y.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Mesh Health"}),e&&y.jsxs(y.Fragment,{children:[y.jsx(aNe,{health:e}),y.jsxs("div",{className:"mt-6 space-y-3",children:[y.jsx(Mx,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),y.jsx(Mx,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),y.jsx(Mx,{label:"Behavior",value:((C=e.pillars)==null?void 0:C.behavior)??0}),y.jsx(Mx,{label:"Power",value:((A=e.pillars)==null?void 0:A.power)??0})]})]})]}),y.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[y.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Active Alerts"}),i.length>0?y.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:i.map((I,k)=>y.jsx(oNe,{alert:I},k))}):y.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[y.jsx(nD,{size:16,className:"text-green-500"}),y.jsx("span",{children:"No active alerts"})]})]}),y.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[y.jsx(Px,{icon:Ya,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),y.jsx(Px,{icon:EZ,label:"Infrastructure",value:`${(e==null?void 0:e.infra_online)||0}/${(e==null?void 0:e.infra_total)||0}`,subvalue:(e==null?void 0:e.infra_online)===(e==null?void 0:e.infra_total)?"All online":"Some offline"}),y.jsx(Px,{icon:yv,label:"Utilization",value:`${((P=e==null?void 0:e.util_percent)==null?void 0:P.toFixed(1))||0}%`,subvalue:`${(e==null?void 0:e.flagged_nodes)||0} flagged`}),y.jsx(Px,{icon:xv,label:"Regions",value:(e==null?void 0:e.total_regions)||0,subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),y.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[y.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:["Mesh Sources (",r.length,")"]}),r.length>0?y.jsx("div",{className:"space-y-2",children:r.map((I,k)=>y.jsx(sNe,{source:I},k))}):y.jsx("div",{className:"text-slate-500 py-4",children:"No sources configured"})]}),y.jsx(cNe,{swpc:c,ducting:h}),y.jsx(dNe,{events:l,envStatus:o})]})]})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -475,8 +475,8 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var $L=function(e,t){return $L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},$L(e,t)};function q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");$L(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Wg=function(){return Wg=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]"u"&&typeof self<"u"?nt.worker=!0:!nt.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(nt.node=!0,nt.svgSupported=!0):vNe(navigator.userAgent,nt);function vNe(e,t){var r=t.browser,n=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=t.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}}var oN=12,wK="sans-serif",zs=oN+"px "+wK,pNe=20,gNe=100,mNe="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function yNe(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r=0)s=o*r.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),e.appendChild(o),r.push(o)}return t.clearMarkers=function(){B(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function VNe(e,t,r){for(var n=r?"invTrans":"trans",i=t[n],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),f=2*u,h=c.left,d=c.top;o.push(h,d),l=l&&a&&h===a[f]&&d===a[f+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?hF(s,o):hF(o,s))}function OK(e){return e.nodeName.toUpperCase()==="CANVAS"}var GNe=/([&<>"'])/g,WNe={"&":"&","<":"<",">":">",'"':""","'":"'"};function In(e){return e==null?"":(e+"").replace(GNe,function(t,r){return WNe[r]})}var HNe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,HA=[],UNe=nt.browser.firefox&&+nt.browser.version.split(".")[0]<39;function HL(e,t,r,n){return r=r||{},n?dF(e,t,r):UNe&&t.layerX!=null&&t.layerX!==t.offsetX?(r.zrX=t.layerX,r.zrY=t.layerY):t.offsetX!=null?(r.zrX=t.offsetX,r.zrY=t.offsetY):dF(e,t,r),r}function dF(e,t,r){if(nt.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(OK(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(WL(HA,e,n,i)){r.zrX=HA[0],r.zrY=HA[1];return}}r.zrX=r.zrY=0}function dN(e){return e||window.event}function Zi(e,t,r){if(t=dN(t),t.zrX!=null)return t;var n=t.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&HL(e,o,t,r)}else{HL(e,t,t,r);var a=ZNe(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&HNe.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function ZNe(e){var t=e.wheelDelta;if(t)return t;var r=e.deltaX,n=e.deltaY;if(r==null||n==null)return t;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function UL(e,t,r,n){e.addEventListener(t,r,n)}function YNe(e,t,r,n){e.removeEventListener(t,r,n)}var $s=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function vF(e){return e.which===2||e.which===3}var XNe=function(){function e(){this._track=[]}return e.prototype.recognize=function(t,r,n){return this._doTrack(t,r,n),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,r,n){var i=t.touches;if(i){for(var a={points:[],touches:[],target:r,event:t},o=0,s=i.length;o1&&n&&n.length>1){var a=pF(n)/pF(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=qNe(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function Wr(){return[1,0,0,1,0,0]}function s0(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function l0(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Va(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],l=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function Ya(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function Ks(e,t,r,n){n===void 0&&(n=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(r),f=Math.cos(r);return e[0]=i*f+s*c,e[1]=-i*c+s*f,e[2]=a*f+l*c,e[3]=-a*c+f*l,e[4]=f*(o-n[0])+c*(u-n[1])+n[0],e[5]=f*(u-n[1])-c*(o-n[0])+n[1],e}function AT(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e}function va(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],l=r*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*s-o*i)*l,e[5]=(a*i-r*s)*l,e):null}function EK(e){var t=Wr();return l0(t,e),t}const KNe=Object.freeze(Object.defineProperty({__proto__:null,clone:EK,copy:l0,create:Wr,identity:s0,invert:va,mul:Va,rotate:Ks,scale:AT,translate:Ya},Symbol.toStringTag,{value:"Module"}));var Ie=function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,n=this.y-t.y;return Math.sqrt(r*r+n*n)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,n=this.y-t.y;return r*r+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,n=this.y;return this.x=t[0]*r+t[2]*n+t[4],this.y=t[1]*r+t[3]*n+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,n){t.x=r,t.y=n},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,n){t.x=r.x+n.x,t.y=r.y+n.y},e.sub=function(t,r,n){t.x=r.x-n.x,t.y=r.y-n.y},e.scale=function(t,r,n){t.x=r.x*n,t.y=r.y*n},e.scaleAndAdd=function(t,r,n,i){t.x=r.x+n.x*i,t.y=r.y+n.y*i},e.lerp=function(t,r,n,i){var a=1-i;t.x=a*r.x+i*n.x,t.y=a*r.y+i*n.y},e}(),Oc=Math.min,Uh=Math.max,ZL=Math.abs,gF=["x","y"],JNe=["width","height"],ju=new Ie,Ru=new Ie,Bu=new Ie,zu=new Ie,_i=DK(),mg=_i.minTv,YL=_i.maxTv,Yg=[0,0],Oe=function(){function e(t,r,n,i){e.set(this,t,r,n,i)}return e.set=function(t,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),t.x=r,t.y=n,t.width=i,t.height=a,t},e.prototype.union=function(t){var r=Oc(t.x,this.x),n=Oc(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Uh(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Uh(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=r,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){var r=this,n=t.width/r.width,i=t.height/r.height,a=Wr();return Ya(a,a,[-r.x,-r.y]),AT(a,a,[n,i]),Ya(a,a,[t.x,t.y]),a},e.prototype.intersect=function(t,r,n){return e.intersect(this,t,r,n)},e.intersect=function(t,r,n,i){n&&Ie.set(n,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!r)return!1;t instanceof e||(t=e.set(QNe,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(eje,r.x,r.y,r.width,r.height));var s=!!n;_i.reset(i,s);var l=_i.touchThreshold,u=t.x+l,c=t.x+t.width-l,f=t.y+l,h=t.y+t.height-l,d=r.x+l,v=r.x+r.width-l,g=r.y+l,m=r.y+r.height-l;if(u>c||f>h||d>v||g>m)return!1;var y=!(c=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&e.copy(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}ju.x=Bu.x=r.x,ju.y=zu.y=r.y,Ru.x=zu.x=r.x+r.width,Ru.y=Bu.y=r.y+r.height,ju.transform(n),zu.transform(n),Ru.transform(n),Bu.transform(n),t.x=Oc(ju.x,Ru.x,Bu.x,zu.x),t.y=Oc(ju.y,Ru.y,Bu.y,zu.y);var l=Uh(ju.x,Ru.x,Bu.x,zu.x),u=Uh(ju.y,Ru.y,Bu.y,zu.y);t.width=l-t.x,t.height=u-t.y},e}(),QNe=new Oe(0,0,0,0),eje=new Oe(0,0,0,0);function mF(e,t,r,n,i,a,o,s){var l=ZL(t-r),u=ZL(n-e),c=Oc(l,u),f=gF[i],h=gF[1-i],d=JNe[i];t=u||!_i.bidirectional)&&(mg[f]=-u,mg[h]=0,_i.useDir&&_i.calcDirMTV())))}function DK(){var e=0,t=new Ie,r=new Ie,n={minTv:new Ie,maxTv:new Ie,useDir:!1,dirMinTv:new Ie,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=Uh(0,a.touchThreshold)),n.negativeSize=!1,o&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),e=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=n.minTv,o=n.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(e),u=Math.cos(e),c=l*a.y+u*a.x;if(i(c)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(r.x=s*u/c,r.y=s*l/c,i(r.x)&&i(r.y)){o.set(0,0);return}(n.bidirectional||t.dot(r)>0)&&r.len()=0;f--){var h=a[f];h!==i&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(ZA.copy(h.getBoundingRect()),h.transform&&ZA.applyTransform(h.transform),ZA.intersect(c)&&s.push(h))}if(s.length)for(var d=4,v=Math.PI/12,g=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function aje(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){for(var n=e,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(t,r))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s?n.ignoreHostSilent?null:s:n.parent}return i?NK:!0}return!1}function yF(e,t,r,n,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=aje(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==NK)){t.target=o;break}}}function RK(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var BK=32,Dp=7;function oje(e){for(var t=0;e>=BK;)t|=e&1,e>>=1;return e+t}function xF(e,t,r,n){var i=t+1;if(i===r)return 1;if(n(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function sje(e,t,r){for(r--;t>>1,i(a,e[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;u>0;)e[o+u]=e[o+u-1],u--}e[o]=a}}function YA(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(e,t[r+c])>0?o=c+1:l=c}return l}function XA(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(e,t[r+c])<0?l=c:o=c+1}return l}function lje(e,t){var r=Dp,n,i,a=0,o=[];n=[],i=[];function s(d,v){n[a]=d,i[a]=v,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&i[d-1]<=i[d]+i[d+1]||d>=2&&i[d-2]<=i[d]+i[d-1])i[d-1]i[d+1])break;c(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]=Dp||A>=Dp);if(P)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),v===1){for(y=0;y=0;y--)e[C+y]=e[T+y];e[S]=o[b];return}for(var A=r;;){var P=0,I=0,k=!1;do if(t(o[b],e[_])<0){if(e[S--]=e[_--],P++,I=0,--v===0){k=!0;break}}else if(e[S--]=o[b--],I++,P=0,--m===1){k=!0;break}while((P|I)=0;y--)e[C+y]=e[T+y];if(v===0){k=!0;break}}if(e[S--]=o[b--],--m===1){k=!0;break}if(I=m-YA(e[_],o,0,m,m-1,t),I!==0){for(S-=I,b-=I,m-=I,C=S+1,T=b+1,y=0;y=Dp||I>=Dp);if(k)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),m===1){for(S-=v,_-=v,C=S+1,T=_+1,y=v-1;y>=0;y--)e[C+y]=e[T+y];e[S]=o[b]}else{if(m===0)throw new Error;for(T=S-(m-1),y=0;ys&&(l=s),_F(e,r,r+l,r+a,t),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var wi=1,yg=2,Mh=4,bF=!1;function qA(){bF||(bF=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function wF(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var uje=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=wF}return e.prototype.traverse=function(t,r){for(var n=0;n=0&&this._roots.splice(i,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),rw;rw=nt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var Xg={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)))},elasticOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},elasticInOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-Xg.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?Xg.bounceIn(e*2)*.5:Xg.bounceOut(e*2-1)*.5+.5}},Mx=Math.pow,Zl=Math.sqrt,nw=1e-8,zK=1e-4,SF=Zl(3),Px=1/3,yo=Cu(),Qi=Cu(),hd=Cu();function Ll(e){return e>-nw&&enw||e<-nw}function $r(e,t,r,n,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*n+3*a*r)}function TF(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function iw(e,t,r,n,i,a){var o=n+3*(t-r)-e,s=3*(r-t*2+e),l=3*(t-e),u=e-i,c=s*s-3*o*l,f=s*l-9*o*u,h=l*l-3*s*u,d=0;if(Ll(c)&&Ll(f))if(Ll(s))a[0]=0;else{var v=-l/s;v>=0&&v<=1&&(a[d++]=v)}else{var g=f*f-4*c*h;if(Ll(g)){var m=f/c,v=-s/o+m,y=-m/2;v>=0&&v<=1&&(a[d++]=v),y>=0&&y<=1&&(a[d++]=y)}else if(g>0){var _=Zl(g),b=c*s+1.5*o*(-f+_),S=c*s+1.5*o*(-f-_);b<0?b=-Mx(-b,Px):b=Mx(b,Px),S<0?S=-Mx(-S,Px):S=Mx(S,Px);var v=(-s-(b+S))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var T=(2*c*s-3*o*f)/(2*Zl(c*c*c)),C=Math.acos(T)/3,A=Zl(c),P=Math.cos(C),v=(-s-2*A*P)/(3*o),y=(-s+A*(P+SF*Math.sin(C)))/(3*o),I=(-s+A*(P-SF*Math.sin(C)))/(3*o);v>=0&&v<=1&&(a[d++]=v),y>=0&&y<=1&&(a[d++]=y),I>=0&&I<=1&&(a[d++]=I)}}return d}function FK(e,t,r,n,i){var a=6*r-12*t+6*e,o=9*t+3*n-3*e-9*r,s=3*t-3*e,l=0;if(Ll(o)){if($K(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Ll(c))i[0]=-a/(2*o);else if(c>0){var f=Zl(c),u=(-a+f)/(2*o),h=(-a-f)/(2*o);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function uu(e,t,r,n,i,a){var o=(t-e)*i+e,s=(r-t)*i+t,l=(n-r)*i+r,u=(s-o)*i+o,c=(l-s)*i+s,f=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=f,a[4]=f,a[5]=c,a[6]=l,a[7]=n}function VK(e,t,r,n,i,a,o,s,l,u,c){var f,h=.005,d=1/0,v,g,m,y;yo[0]=l,yo[1]=u;for(var _=0;_<1;_+=.05)Qi[0]=$r(e,r,i,o,_),Qi[1]=$r(t,n,a,s,_),m=Ul(yo,Qi),m=0&&m=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Ll(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var f=Zl(c),u=(-o+f)/(2*a),h=(-o-f)/(2*a);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function GK(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function dy(e,t,r,n,i){var a=(t-e)*n+e,o=(r-t)*n+t,s=(o-a)*n+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function WK(e,t,r,n,i,a,o,s,l){var u,c=.005,f=1/0;yo[0]=o,yo[1]=s;for(var h=0;h<1;h+=.05){Qi[0]=tn(e,r,i,h),Qi[1]=tn(t,n,a,h);var d=Ul(yo,Qi);d=0&&d=1?1:iw(0,n,a,1,l,s)&&$r(0,i,o,1,s[0])}}}var vje=function(){function e(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||sr,this.ondestroy=t.ondestroy||sr,this.onrestart=t.onrestart||sr,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,r){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,i=t-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Ce(t)?t:Xg[t]||vN(t)},e}(),HK=function(){function e(t){this.value=t}return e}(),pje=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new HK(t);return this.insertEntry(r),r},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var r=t.prev,n=t.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Kd=function(){function e(t){this._list=new pje,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var n=this._list,i=this._map,a=null;if(i[t]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new HK(r),s.key=t,n.insertEntry(s),i[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),CF={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ga(e){return e=Math.round(e),e<0?0:e>255?255:e}function gje(e){return e=Math.round(e),e<0?0:e>360?360:e}function vy(e){return e<0?0:e>1?1:e}function tb(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Ga(parseFloat(t)/100*255):Ga(parseInt(t,10))}function As(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?vy(parseFloat(t)/100):vy(parseFloat(t))}function KA(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function Il(e,t,r){return e+(t-e)*r}function Ui(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function qL(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var UK=new Kd(20),kx=null;function eh(e,t){kx&&qL(kx,t),kx=UK.put(e,kx||t.slice())}function On(e,t){if(e){t=t||[];var r=UK.get(e);if(r)return qL(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in CF)return qL(t,CF[n]),eh(e,t),t;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){Ui(t,0,0,0,1);return}return Ui(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),eh(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){Ui(t,0,0,0,1);return}return Ui(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),eh(e,t),t}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Ui(t,+u[0],+u[1],+u[2],1):Ui(t,0,0,0,1);c=As(u.pop());case"rgb":if(u.length>=3)return Ui(t,tb(u[0]),tb(u[1]),tb(u[2]),u.length===3?c:As(u[3])),eh(e,t),t;Ui(t,0,0,0,1);return;case"hsla":if(u.length!==4){Ui(t,0,0,0,1);return}return u[3]=As(u[3]),KL(u,t),eh(e,t),t;case"hsl":if(u.length!==3){Ui(t,0,0,0,1);return}return KL(u,t),eh(e,t),t;default:return}}Ui(t,0,0,0,1)}}function KL(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=As(e[1]),i=As(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],Ui(t,Ga(KA(o,a,r+1/3)*255),Ga(KA(o,a,r)*255),Ga(KA(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function mje(e){if(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var c=((a-t)/6+o/2)/o,f=((a-r)/6+o/2)/o,h=((a-n)/6+o/2)/o;t===a?l=h-f:r===a?l=1/3+c-h:n===a&&(l=2/3+f-c),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return e[3]!=null&&d.push(e[3]),d}}function aw(e,t){var r=On(e);if(r){for(var n=0;n<3;n++)t<0?r[n]=r[n]*(1-t)|0:r[n]=(255-r[n])*t+r[n]|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return la(r,r.length===4?"rgba":"rgb")}}function yje(e){var t=On(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function qg(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){r=r||[];var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=t[i],s=t[a],l=n-i;return r[0]=Ga(Il(o[0],s[0],l)),r[1]=Ga(Il(o[1],s[1],l)),r[2]=Ga(Il(o[2],s[2],l)),r[3]=vy(Il(o[3],s[3],l)),r}}var xje=qg;function pN(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=On(t[i]),s=On(t[a]),l=n-i,u=la([Ga(Il(o[0],s[0],l)),Ga(Il(o[1],s[1],l)),Ga(Il(o[2],s[2],l)),vy(Il(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var _je=pN;function Ms(e,t,r,n){var i=On(e);if(e)return i=mje(i),t!=null&&(i[0]=gje(Ce(t)?t(i[0]):t)),r!=null&&(i[1]=As(Ce(r)?r(i[1]):r)),n!=null&&(i[2]=As(Ce(n)?n(i[2]):n)),la(KL(i),"rgba")}function py(e,t){var r=On(e);if(r&&t!=null)return r[3]=vy(t),la(r,"rgba")}function la(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}}function gy(e,t){var r=On(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function bje(){return la([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var AF=new Kd(100);function ow(e){if(pe(e)){var t=AF.get(e);return t||(t=aw(e,-.1),AF.put(e,t)),t}else if(i0(e)){var r=ie({},e);return r.colorStops=se(e.colorStops,function(n){return{offset:n.offset,color:aw(n.color,-.1)}}),r}return e}const wje=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:qg,fastMapToColor:xje,lerp:pN,lift:aw,liftColor:ow,lum:gy,mapToColor:_je,modifyAlpha:py,modifyHSL:Ms,parse:On,parseCssFloat:As,parseCssInt:tb,random:bje,stringify:la,toHex:yje},Symbol.toStringTag,{value:"Module"}));var sw=Math.round;function my(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=On(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var MF=1e-4;function Ol(e){return e-MF}function Lx(e){return sw(e*1e3)/1e3}function JL(e){return sw(e*1e4)/1e4}function Sje(e){return"matrix("+Lx(e[0])+","+Lx(e[1])+","+Lx(e[2])+","+Lx(e[3])+","+JL(e[4])+","+JL(e[5])+")"}var Tje={left:"start",right:"end",center:"middle",middle:"middle"};function Cje(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function Aje(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function Mje(e){var t=e.style,r=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function ZK(e){return e&&!!e.image}function Pje(e){return e&&!!e.svgElement}function gN(e){return ZK(e)||Pje(e)}function YK(e){return e.type==="linear"}function XK(e){return e.type==="radial"}function qK(e){return e&&(e.type==="linear"||e.type==="radial")}function MT(e){return"url(#"+e+")"}function KK(e){var t=e.getGlobalScale(),r=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function JK(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*Hg,i=be(e.scaleX,1),a=be(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,l=[];return(t||r)&&l.push("translate("+t+"px,"+r+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+sw(o*Hg)+"deg, "+sw(s*Hg)+"deg)"),l.join(" ")}var kje=function(){return nt.hasGlobalWindow&&Ce(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<"u"?function(e){return Buffer.from(e).toString("base64")}:function(e){return null}}(),QL=Array.prototype.slice;function us(e,t,r){return(t-e)*r+e}function JA(e,t,r,n){for(var i=t.length,a=0;an?t:e,a=Math.min(r,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,r,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=kF,l=r;if(yn(r)){var u=Eje(r);s=u,(u===1&&!ot(r[0])||u===2&&!ot(r[0][0]))&&(o=!0)}else if(ot(r)&&!gn(r))s=Ox;else if(pe(r))if(!isNaN(+r))s=Ox;else{var c=On(r);c&&(l=c,s=xg)}else if(i0(r)){var f=ie({},l);f.colorStops=se(r.colorStops,function(d){return{offset:d.offset,color:On(d.color)}}),YK(r)?s=eI:XK(r)&&(s=tI),l=f}a===0?this.valType=s:(s!==this.valType||s===kF)&&(o=!0),this.discrete=this.discrete||o;var h={time:t,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=Ce(n)?n:Xg[n]||vN(n)),i.push(h),h},e.prototype.prepare=function(t,r){var n=this.keyframes;this._needsSort&&n.sort(function(g,m){return g.time-m.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=Ex(i),u=LF(i),c=0;c=0&&!(o[c].percent<=r);c--);c=h(c,s-2)}else{for(c=f;cr);c++);c=h(c-1,s-2)}v=o[c+1],d=o[c]}if(d&&v){this._lastFr=c,this._lastFrP=r;var m=v.percent-d.percent,y=m===0?1:h((r-d.percent)/m,1);v.easingFunc&&(y=v.easingFunc(y));var _=n?this._additiveValue:u?Np:t[l];if((Ex(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[l]=y<1?d.rawValue:v.rawValue;else if(Ex(a))a===nb?JA(_,d[i],v[i],y):Lje(_,d[i],v[i],y);else if(LF(a)){var b=d[i],S=v[i],T=a===eI;t[l]={type:T?"linear":"radial",x:us(b.x,S.x,y),y:us(b.y,S.y,y),colorStops:se(b.colorStops,function(A,P){var I=S.colorStops[P];return{offset:us(A.offset,I.offset,y),color:rb(JA([],A.color,I.color,y))}}),global:S.global},T?(t[l].x2=us(b.x2,S.x2,y),t[l].y2=us(b.y2,S.y2,y)):t[l].r=us(b.r,S.r,y)}else if(u)JA(_,d[i],v[i],y),n||(t[l]=rb(_));else{var C=us(d[i],v[i],y);n?this._additiveValue=C:t[l]=C}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===Ox?t[n]=t[n]+i:r===xg?(On(t[n],Np),Ix(Np,Np,i,1),t[n]=rb(Np)):r===nb?Ix(t[n],t[n],i,1):r===QK&&PF(t[n],t[n],i,1)},e}(),mN=function(){function e(t,r,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=r,r&&i){wT("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,r,n){return this.whenWithKeys(t,r,it(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,Kg(u),i),this._trackKeys.push(s)}l.addKeyframe(t,Kg(r[s]),i)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var r=t.length,n=0;n0)){this._started=1;for(var r=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e}();function Zh(){return new Date().getTime()}var Nje=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return t.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},t.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},t.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},t.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},t.prototype.update=function(r){for(var n=Zh()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,r||(this.trigger("frame",i),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(rw(n),!r._paused&&r.update())}rw(n)},t.prototype.start=function(){this._running||(this._time=Zh(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Zh(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Zh()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(r,n){n=n||{},this.start();var i=new mN(r,n.loop);return this.addAnimator(i),i},t}(xa),jje=300,QA=nt.domSupported,e2=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=se(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}}(),IF={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},OF=!1;function rI(e){var t=e.pointerType;return t==="pen"||t==="touch"}function Rje(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function t2(e){e&&(e.zrByTouch=!0)}function Bje(e,t){return Zi(e.dom,new zje(e,t),!0)}function eJ(e,t){for(var r=t,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==t&&r===e.painterRoot);)r=r.parentNode;return n}var zje=function(){function e(t,r){this.stopPropagation=sr,this.stopImmediatePropagation=sr,this.preventDefault=sr,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),Pa={mousedown:function(e){e=Zi(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=Zi(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=Zi(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=Zi(this.dom,e);var t=e.toElement||e.relatedTarget;eJ(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){OF=!0,e=Zi(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){OF||(e=Zi(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=Zi(this.dom,e),t2(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Pa.mousemove.call(this,e),Pa.mousedown.call(this,e)},touchmove:function(e){e=Zi(this.dom,e),t2(e),this.handler.processGesture(e,"change"),Pa.mousemove.call(this,e)},touchend:function(e){e=Zi(this.dom,e),t2(e),this.handler.processGesture(e,"end"),Pa.mouseup.call(this,e),+new Date-+this.__lastTouchMomentNF||e<-NF}var Fu=[],th=[],n2=Wr(),i2=Math.abs,_s=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return $u(this.rotation)||$u(this.x)||$u(this.y)||$u(this.scaleX-1)||$u(this.scaleY-1)||$u(this.skewX)||$u(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(DF(n),this.invTransform=null);return}n=n||Wr(),r?this.getLocalTransform(n):DF(n),t&&(r?Va(n,t,n):l0(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Fu);var n=Fu[0]<0?-1:1,i=Fu[1]<0?-1:1,a=((Fu[0]-n)*r+n)/Fu[0]||0,o=((Fu[1]-i)*r+i)/Fu[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Wr(),va(this.invTransform,t)},e.prototype.getComputedTransform=function(){for(var t=this,r=[];t;)r.push(t),t=t.parent;for(;t=r.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(t){var r=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),a=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,r=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||Wr(),Va(th,t.invTransform,r),r=th);var n=this.originX,i=this.originY;(n||i)&&(n2[4]=n,n2[5]=i,Va(th,r,n2),th[4]-=n,th[5]-=i,r=th),this.setLocalTransform(r)}},e.prototype.getGlobalScale=function(t){var r=this.transform;return t=t||[],r?(t[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),t[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(t[0]=-t[0]),r[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,r){var n=[t,r],i=this.invTransform;return i&&lr(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&lr(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&i2(t[0]-1)>1e-10&&i2(t[3]-1)>1e-10?Math.sqrt(i2(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){uw(this,t)},e.getLocalTransform=function(t,r){r=r||[];var n=t.originX||0,i=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,c=t.x,f=t.y,h=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var v=n+s,g=i+l;r[4]=-v*a-h*g*o,r[5]=-g*o-d*v*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=h*o,u&&Ks(r,r,u),r[4]+=n+c,r[5]+=i+f,r},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),zo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function uw(e,t){for(var r=0;r=jF)){e=e||zs;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=ui.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?a2=jF:i>2&&a2++,t}}var a2=0,jF=5;function rJ(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=Wje(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function No(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=ui.measureText(t,e.font).width,r.put(t,n)),n}function RF(e,t,r,n){var i=No(Do(t),e),a=u0(t),o=Jd(0,i,r),s=Wc(0,a,n),l=new Oe(o,s,i,a);return l}function PT(e,t,r,n){var i=((e||"")+"").split(` -`),a=i.length;if(a===1)return RF(i[0],t,r,n);for(var o=new Oe(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function cw(e,t,r){var n=t.position||"inside",i=t.distance!=null?t.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,c="left",f="top";if(n instanceof Array)l+=Xa(n[0],r.width),u+=Xa(n[1],r.height),c=null,f=null;else switch(n){case"left":l-=i,u+=s,c="right",f="middle";break;case"right":l+=i+o,u+=s,f="middle";break;case"top":l+=o/2,u-=i,c="center",f="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",f="middle";break;case"insideLeft":l+=i,u+=s,f="middle";break;case"insideRight":l+=o-i,u+=s,c="right",f="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",f="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=a-i,f="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",f="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=c,e.verticalAlign=f,e}var o2="__zr_normal__",s2=zo.concat(["ignore"]),Hje=da(zo,function(e,t){return e[t]=!0,e},{ignore:!1}),rh={},Uje=new Oe(0,0,0,0),Nx=[],kT=function(){function e(t){this.id=uN(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=r,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var r=this._textContent;if(r&&(!r.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;a.copyTransform(r);var c=n.position!=null,f=n.autoOverflowArea,h=void 0;if((f||c)&&(h=Uje,n.layoutRect?h.copy(n.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(rh,n,h):cw(rh,n,h),a.x=rh.x,a.y=rh.y,o=rh.align,s=rh.verticalAlign;var d=n.origin;if(d&&n.rotation!=null){var v=void 0,g=void 0;d==="center"?(v=h.width*.5,g=h.height*.5):(v=Xa(d[0],h.width),g=Xa(d[1],h.height)),u=!0,a.originX=-a.x+v+(i?0:h.x),a.originY=-a.y+g+(i?0:h.y)}}n.rotation!=null&&(a.rotation=n.rotation);var m=n.offset;m&&(a.x+=m[0],a.y+=m[1],u||(a.originX=-m[0],a.originY=-m[1]));var y=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(f){var _=y.overflowRect=y.overflowRect||new Oe(0,0,0,0);a.getLocalTransform(Nx),va(Nx,Nx),Oe.copy(_,h),_.applyTransform(Nx)}else y.overflowRect=null;var b=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,S=void 0,T=void 0,C=void 0;b&&this.canBeInsideText()?(S=n.insideFill,T=n.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(S),C=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),C=!0)),S=S||"#000",(S!==y.fill||T!==y.stroke||C!==y.autoStroke||o!==y.align||s!==y.verticalAlign)&&(l=!0,y.fill=S,y.stroke=T,y.autoStroke=C,y.align=o,y.verticalAlign=s,r.setDefaultTextStyle(y)),r.__dirty|=wi,l&&r.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?oI:aI},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&On(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,la(n,"rgba")},e.prototype.traverse=function(t,r){},e.prototype.attrKV=function(t,r){t==="textConfig"?this.setTextConfig(r):t==="textContent"?this.setTextContent(r):t==="clipPath"?this.setClipPath(r):t==="extra"?(this.extra=this.extra||{},ie(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(ke(t))for(var n=t,i=it(n),a=0;a0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var r=this.states;return r[t]||(r[t]={}),r[t]},e.prototype.clearStates=function(t){this.useState(o2,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===o2,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(We(s,t)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){wT("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||i);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(t,r,n,c),h&&h.useState(t,r,n,c),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~wi),u}}},e.prototype.useStates=function(t,r,n){if(!t.length)this.clearStates();else{var i=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l0,v);var g=this._textContent,m=this._textGuide;g&&g.useStates(t,r,h),m&&m.useStates(t,r,h),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~wi)}},e.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var r=t.__hostTarget;t=r?t.ignoreHostSilent?null:r:t.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},e.prototype.replaceState=function(t,r,n){var i=this.currentStates.slice(),a=We(i,t),o=We(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&i.push(r),this.useStates(i)},e.prototype.toggleState=function(t,r){r?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var r={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,r){for(var n=this.animators,i=n.length,a=[],o=0;o0&&r.during&&a[0].during(function(v,g){r.during(g)});for(var h=0;h0||i.force&&!o.length){var P=void 0,I=void 0,k=void 0;if(s){I={},h&&(P={});for(var S=0;S=0&&(i.splice(a,0,r),this._doAdd(r))}return this},t.prototype.replace=function(r,n){var i=We(this._children,r);return i>=0&&this.replaceAt(n,i),this},t.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},t.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},t.prototype.remove=function(r){var n=this.__zr,i=this._children,a=We(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},t.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]"u"&&typeof self<"u"?nt.worker=!0:!nt.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(nt.node=!0,nt.svgSupported=!0):yNe(navigator.userAgent,nt);function yNe(e,t){var r=t.browser,n=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=t.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}}var cN=12,AK="sans-serif",Fs=cN+"px "+AK,xNe=20,_Ne=100,bNe="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function wNe(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r=0)s=o*r.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),e.appendChild(o),r.push(o)}return t.clearMarkers=function(){B(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function UNe(e,t,r){for(var n=r?"invTrans":"trans",i=t[n],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),f=2*u,h=c.left,d=c.top;o.push(h,d),l=l&&a&&h===a[f]&&d===a[f+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?gF(s,o):gF(o,s))}function jK(e){return e.nodeName.toUpperCase()==="CANVAS"}var ZNe=/([&<>"'])/g,YNe={"&":"&","<":"<",">":">",'"':""","'":"'"};function In(e){return e==null?"":(e+"").replace(ZNe,function(t,r){return YNe[r]})}var XNe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,YA=[],qNe=nt.browser.firefox&&+nt.browser.version.split(".")[0]<39;function qL(e,t,r,n){return r=r||{},n?mF(e,t,r):qNe&&t.layerX!=null&&t.layerX!==t.offsetX?(r.zrX=t.layerX,r.zrY=t.layerY):t.offsetX!=null?(r.zrX=t.offsetX,r.zrY=t.offsetY):mF(e,t,r),r}function mF(e,t,r){if(nt.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(jK(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(XL(YA,e,n,i)){r.zrX=YA[0],r.zrY=YA[1];return}}r.zrX=r.zrY=0}function mN(e){return e||window.event}function Zi(e,t,r){if(t=mN(t),t.zrX!=null)return t;var n=t.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&qL(e,o,t,r)}else{qL(e,t,t,r);var a=KNe(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&XNe.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function KNe(e){var t=e.wheelDelta;if(t)return t;var r=e.deltaX,n=e.deltaY;if(r==null||n==null)return t;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function KL(e,t,r,n){e.addEventListener(t,r,n)}function JNe(e,t,r,n){e.removeEventListener(t,r,n)}var Vs=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function yF(e){return e.which===2||e.which===3}var QNe=function(){function e(){this._track=[]}return e.prototype.recognize=function(t,r,n){return this._doTrack(t,r,n),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,r,n){var i=t.touches;if(i){for(var a={points:[],touches:[],target:r,event:t},o=0,s=i.length;o1&&n&&n.length>1){var a=xF(n)/xF(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=eje(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function Wr(){return[1,0,0,1,0,0]}function c0(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function f0(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Ga(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],l=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function Xa(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function Qs(e,t,r,n){n===void 0&&(n=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(r),f=Math.cos(r);return e[0]=i*f+s*c,e[1]=-i*c+s*f,e[2]=a*f+l*c,e[3]=-a*c+f*l,e[4]=f*(o-n[0])+c*(u-n[1])+n[0],e[5]=f*(u-n[1])-c*(o-n[0])+n[1],e}function kT(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e}function va(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],l=r*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*s-o*i)*l,e[5]=(a*i-r*s)*l,e):null}function RK(e){var t=Wr();return f0(t,e),t}const tje=Object.freeze(Object.defineProperty({__proto__:null,clone:RK,copy:f0,create:Wr,identity:c0,invert:va,mul:Ga,rotate:Qs,scale:kT,translate:Xa},Symbol.toStringTag,{value:"Module"}));var Ie=function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,n=this.y-t.y;return Math.sqrt(r*r+n*n)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,n=this.y-t.y;return r*r+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,n=this.y;return this.x=t[0]*r+t[2]*n+t[4],this.y=t[1]*r+t[3]*n+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,n){t.x=r,t.y=n},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,n){t.x=r.x+n.x,t.y=r.y+n.y},e.sub=function(t,r,n){t.x=r.x-n.x,t.y=r.y-n.y},e.scale=function(t,r,n){t.x=r.x*n,t.y=r.y*n},e.scaleAndAdd=function(t,r,n,i){t.x=r.x+n.x*i,t.y=r.y+n.y*i},e.lerp=function(t,r,n,i){var a=1-i;t.x=a*r.x+i*n.x,t.y=a*r.y+i*n.y},e}(),Oc=Math.min,Uh=Math.max,JL=Math.abs,_F=["x","y"],rje=["width","height"],ju=new Ie,Ru=new Ie,Bu=new Ie,zu=new Ie,_i=BK(),xg=_i.minTv,QL=_i.maxTv,qg=[0,0],Oe=function(){function e(t,r,n,i){e.set(this,t,r,n,i)}return e.set=function(t,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),t.x=r,t.y=n,t.width=i,t.height=a,t},e.prototype.union=function(t){var r=Oc(t.x,this.x),n=Oc(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Uh(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Uh(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=r,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){var r=this,n=t.width/r.width,i=t.height/r.height,a=Wr();return Xa(a,a,[-r.x,-r.y]),kT(a,a,[n,i]),Xa(a,a,[t.x,t.y]),a},e.prototype.intersect=function(t,r,n){return e.intersect(this,t,r,n)},e.intersect=function(t,r,n,i){n&&Ie.set(n,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!r)return!1;t instanceof e||(t=e.set(nje,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(ije,r.x,r.y,r.width,r.height));var s=!!n;_i.reset(i,s);var l=_i.touchThreshold,u=t.x+l,c=t.x+t.width-l,f=t.y+l,h=t.y+t.height-l,d=r.x+l,v=r.x+r.width-l,g=r.y+l,m=r.y+r.height-l;if(u>c||f>h||d>v||g>m)return!1;var x=!(c=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&e.copy(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}ju.x=Bu.x=r.x,ju.y=zu.y=r.y,Ru.x=zu.x=r.x+r.width,Ru.y=Bu.y=r.y+r.height,ju.transform(n),zu.transform(n),Ru.transform(n),Bu.transform(n),t.x=Oc(ju.x,Ru.x,Bu.x,zu.x),t.y=Oc(ju.y,Ru.y,Bu.y,zu.y);var l=Uh(ju.x,Ru.x,Bu.x,zu.x),u=Uh(ju.y,Ru.y,Bu.y,zu.y);t.width=l-t.x,t.height=u-t.y},e}(),nje=new Oe(0,0,0,0),ije=new Oe(0,0,0,0);function bF(e,t,r,n,i,a,o,s){var l=JL(t-r),u=JL(n-e),c=Oc(l,u),f=_F[i],h=_F[1-i],d=rje[i];t=u||!_i.bidirectional)&&(xg[f]=-u,xg[h]=0,_i.useDir&&_i.calcDirMTV())))}function BK(){var e=0,t=new Ie,r=new Ie,n={minTv:new Ie,maxTv:new Ie,useDir:!1,dirMinTv:new Ie,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=Uh(0,a.touchThreshold)),n.negativeSize=!1,o&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),e=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=n.minTv,o=n.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(e),u=Math.cos(e),c=l*a.y+u*a.x;if(i(c)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(r.x=s*u/c,r.y=s*l/c,i(r.x)&&i(r.y)){o.set(0,0);return}(n.bidirectional||t.dot(r)>0)&&r.len()=0;f--){var h=a[f];h!==i&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(qA.copy(h.getBoundingRect()),h.transform&&qA.applyTransform(h.transform),qA.intersect(c)&&s.push(h))}if(s.length)for(var d=4,v=Math.PI/12,g=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function uje(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){for(var n=e,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(t,r))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s?n.ignoreHostSilent?null:s:n.parent}return i?zK:!0}return!1}function wF(e,t,r,n,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=uje(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==zK)){t.target=o;break}}}function FK(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var VK=32,jp=7;function cje(e){for(var t=0;e>=VK;)t|=e&1,e>>=1;return e+t}function SF(e,t,r,n){var i=t+1;if(i===r)return 1;if(n(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function fje(e,t,r){for(r--;t>>1,i(a,e[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;u>0;)e[o+u]=e[o+u-1],u--}e[o]=a}}function KA(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(e,t[r+c])>0?o=c+1:l=c}return l}function JA(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(e,t[r+c])<0?l=c:o=c+1}return l}function hje(e,t){var r=jp,n,i,a=0,o=[];n=[],i=[];function s(d,v){n[a]=d,i[a]=v,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&i[d-1]<=i[d]+i[d+1]||d>=2&&i[d-2]<=i[d]+i[d-1])i[d-1]i[d+1])break;c(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]=jp||A>=jp);if(P)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),v===1){for(x=0;x=0;x--)e[C+x]=e[T+x];e[S]=o[b];return}for(var A=r;;){var P=0,I=0,k=!1;do if(t(o[b],e[_])<0){if(e[S--]=e[_--],P++,I=0,--v===0){k=!0;break}}else if(e[S--]=o[b--],I++,P=0,--m===1){k=!0;break}while((P|I)=0;x--)e[C+x]=e[T+x];if(v===0){k=!0;break}}if(e[S--]=o[b--],--m===1){k=!0;break}if(I=m-KA(e[_],o,0,m,m-1,t),I!==0){for(S-=I,b-=I,m-=I,C=S+1,T=b+1,x=0;x=jp||I>=jp);if(k)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),m===1){for(S-=v,_-=v,C=S+1,T=_+1,x=v-1;x>=0;x--)e[C+x]=e[T+x];e[S]=o[b]}else{if(m===0)throw new Error;for(T=S-(m-1),x=0;xs&&(l=s),TF(e,r,r+l,r+a,t),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var wi=1,_g=2,Mh=4,CF=!1;function QA(){CF||(CF=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function AF(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var dje=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=AF}return e.prototype.traverse=function(t,r){for(var n=0;n=0&&this._roots.splice(i,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),aw;aw=nt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var Kg={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)))},elasticOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},elasticInOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-Kg.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?Kg.bounceIn(e*2)*.5:Kg.bounceOut(e*2-1)*.5+.5}},Lx=Math.pow,Xl=Math.sqrt,ow=1e-8,GK=1e-4,MF=Xl(3),Ix=1/3,xo=Cu(),Qi=Cu(),hd=Cu();function Ol(e){return e>-ow&&eow||e<-ow}function $r(e,t,r,n,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*n+3*a*r)}function PF(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function sw(e,t,r,n,i,a){var o=n+3*(t-r)-e,s=3*(r-t*2+e),l=3*(t-e),u=e-i,c=s*s-3*o*l,f=s*l-9*o*u,h=l*l-3*s*u,d=0;if(Ol(c)&&Ol(f))if(Ol(s))a[0]=0;else{var v=-l/s;v>=0&&v<=1&&(a[d++]=v)}else{var g=f*f-4*c*h;if(Ol(g)){var m=f/c,v=-s/o+m,x=-m/2;v>=0&&v<=1&&(a[d++]=v),x>=0&&x<=1&&(a[d++]=x)}else if(g>0){var _=Xl(g),b=c*s+1.5*o*(-f+_),S=c*s+1.5*o*(-f-_);b<0?b=-Lx(-b,Ix):b=Lx(b,Ix),S<0?S=-Lx(-S,Ix):S=Lx(S,Ix);var v=(-s-(b+S))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var T=(2*c*s-3*o*f)/(2*Xl(c*c*c)),C=Math.acos(T)/3,A=Xl(c),P=Math.cos(C),v=(-s-2*A*P)/(3*o),x=(-s+A*(P+MF*Math.sin(C)))/(3*o),I=(-s+A*(P-MF*Math.sin(C)))/(3*o);v>=0&&v<=1&&(a[d++]=v),x>=0&&x<=1&&(a[d++]=x),I>=0&&I<=1&&(a[d++]=I)}}return d}function HK(e,t,r,n,i){var a=6*r-12*t+6*e,o=9*t+3*n-3*e-9*r,s=3*t-3*e,l=0;if(Ol(o)){if(WK(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Ol(c))i[0]=-a/(2*o);else if(c>0){var f=Xl(c),u=(-a+f)/(2*o),h=(-a-f)/(2*o);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function uu(e,t,r,n,i,a){var o=(t-e)*i+e,s=(r-t)*i+t,l=(n-r)*i+r,u=(s-o)*i+o,c=(l-s)*i+s,f=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=f,a[4]=f,a[5]=c,a[6]=l,a[7]=n}function UK(e,t,r,n,i,a,o,s,l,u,c){var f,h=.005,d=1/0,v,g,m,x;xo[0]=l,xo[1]=u;for(var _=0;_<1;_+=.05)Qi[0]=$r(e,r,i,o,_),Qi[1]=$r(t,n,a,s,_),m=Yl(xo,Qi),m=0&&m=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Ol(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var f=Xl(c),u=(-o+f)/(2*a),h=(-o-f)/(2*a);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function ZK(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function py(e,t,r,n,i){var a=(t-e)*n+e,o=(r-t)*n+t,s=(o-a)*n+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function YK(e,t,r,n,i,a,o,s,l){var u,c=.005,f=1/0;xo[0]=o,xo[1]=s;for(var h=0;h<1;h+=.05){Qi[0]=tn(e,r,i,h),Qi[1]=tn(t,n,a,h);var d=Yl(xo,Qi);d=0&&d=1?1:sw(0,n,a,1,l,s)&&$r(0,i,o,1,s[0])}}}var yje=function(){function e(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||sr,this.ondestroy=t.ondestroy||sr,this.onrestart=t.onrestart||sr,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,r){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,i=t-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Ce(t)?t:Kg[t]||yN(t)},e}(),XK=function(){function e(t){this.value=t}return e}(),xje=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new XK(t);return this.insertEntry(r),r},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var r=t.prev,n=t.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Kd=function(){function e(t){this._list=new xje,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var n=this._list,i=this._map,a=null;if(i[t]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new XK(r),s.key=t,n.insertEntry(s),i[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),kF={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Wa(e){return e=Math.round(e),e<0?0:e>255?255:e}function _je(e){return e=Math.round(e),e<0?0:e>360?360:e}function gy(e){return e<0?0:e>1?1:e}function ib(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Wa(parseFloat(t)/100*255):Wa(parseInt(t,10))}function Ps(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?gy(parseFloat(t)/100):gy(parseFloat(t))}function e2(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function El(e,t,r){return e+(t-e)*r}function Ui(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function tI(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var qK=new Kd(20),Ox=null;function eh(e,t){Ox&&tI(Ox,t),Ox=qK.put(e,Ox||t.slice())}function On(e,t){if(e){t=t||[];var r=qK.get(e);if(r)return tI(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in kF)return tI(t,kF[n]),eh(e,t),t;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){Ui(t,0,0,0,1);return}return Ui(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),eh(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){Ui(t,0,0,0,1);return}return Ui(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),eh(e,t),t}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Ui(t,+u[0],+u[1],+u[2],1):Ui(t,0,0,0,1);c=Ps(u.pop());case"rgb":if(u.length>=3)return Ui(t,ib(u[0]),ib(u[1]),ib(u[2]),u.length===3?c:Ps(u[3])),eh(e,t),t;Ui(t,0,0,0,1);return;case"hsla":if(u.length!==4){Ui(t,0,0,0,1);return}return u[3]=Ps(u[3]),rI(u,t),eh(e,t),t;case"hsl":if(u.length!==3){Ui(t,0,0,0,1);return}return rI(u,t),eh(e,t),t;default:return}}Ui(t,0,0,0,1)}}function rI(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Ps(e[1]),i=Ps(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],Ui(t,Wa(e2(o,a,r+1/3)*255),Wa(e2(o,a,r)*255),Wa(e2(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function bje(e){if(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var c=((a-t)/6+o/2)/o,f=((a-r)/6+o/2)/o,h=((a-n)/6+o/2)/o;t===a?l=h-f:r===a?l=1/3+c-h:n===a&&(l=2/3+f-c),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return e[3]!=null&&d.push(e[3]),d}}function lw(e,t){var r=On(e);if(r){for(var n=0;n<3;n++)t<0?r[n]=r[n]*(1-t)|0:r[n]=(255-r[n])*t+r[n]|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return la(r,r.length===4?"rgba":"rgb")}}function wje(e){var t=On(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function Jg(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){r=r||[];var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=t[i],s=t[a],l=n-i;return r[0]=Wa(El(o[0],s[0],l)),r[1]=Wa(El(o[1],s[1],l)),r[2]=Wa(El(o[2],s[2],l)),r[3]=gy(El(o[3],s[3],l)),r}}var Sje=Jg;function xN(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=On(t[i]),s=On(t[a]),l=n-i,u=la([Wa(El(o[0],s[0],l)),Wa(El(o[1],s[1],l)),Wa(El(o[2],s[2],l)),gy(El(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var Tje=xN;function ks(e,t,r,n){var i=On(e);if(e)return i=bje(i),t!=null&&(i[0]=_je(Ce(t)?t(i[0]):t)),r!=null&&(i[1]=Ps(Ce(r)?r(i[1]):r)),n!=null&&(i[2]=Ps(Ce(n)?n(i[2]):n)),la(rI(i),"rgba")}function my(e,t){var r=On(e);if(r&&t!=null)return r[3]=gy(t),la(r,"rgba")}function la(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}}function yy(e,t){var r=On(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function Cje(){return la([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var LF=new Kd(100);function uw(e){if(pe(e)){var t=LF.get(e);return t||(t=lw(e,-.1),LF.put(e,t)),t}else if(s0(e)){var r=ie({},e);return r.colorStops=se(e.colorStops,function(n){return{offset:n.offset,color:lw(n.color,-.1)}}),r}return e}const Aje=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:Jg,fastMapToColor:Sje,lerp:xN,lift:lw,liftColor:uw,lum:yy,mapToColor:Tje,modifyAlpha:my,modifyHSL:ks,parse:On,parseCssFloat:Ps,parseCssInt:ib,random:Cje,stringify:la,toHex:wje},Symbol.toStringTag,{value:"Module"}));var cw=Math.round;function xy(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=On(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var IF=1e-4;function Dl(e){return e-IF}function Ex(e){return cw(e*1e3)/1e3}function nI(e){return cw(e*1e4)/1e4}function Mje(e){return"matrix("+Ex(e[0])+","+Ex(e[1])+","+Ex(e[2])+","+Ex(e[3])+","+nI(e[4])+","+nI(e[5])+")"}var Pje={left:"start",right:"end",center:"middle",middle:"middle"};function kje(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function Lje(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function Ije(e){var t=e.style,r=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function KK(e){return e&&!!e.image}function Oje(e){return e&&!!e.svgElement}function _N(e){return KK(e)||Oje(e)}function JK(e){return e.type==="linear"}function QK(e){return e.type==="radial"}function eJ(e){return e&&(e.type==="linear"||e.type==="radial")}function LT(e){return"url(#"+e+")"}function tJ(e){var t=e.getGlobalScale(),r=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function rJ(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*Zg,i=be(e.scaleX,1),a=be(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,l=[];return(t||r)&&l.push("translate("+t+"px,"+r+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+cw(o*Zg)+"deg, "+cw(s*Zg)+"deg)"),l.join(" ")}var Eje=function(){return nt.hasGlobalWindow&&Ce(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<"u"?function(e){return Buffer.from(e).toString("base64")}:function(e){return null}}(),iI=Array.prototype.slice;function fs(e,t,r){return(t-e)*r+e}function t2(e,t,r,n){for(var i=t.length,a=0;an?t:e,a=Math.min(r,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,r,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=EF,l=r;if(yn(r)){var u=Rje(r);s=u,(u===1&&!ot(r[0])||u===2&&!ot(r[0][0]))&&(o=!0)}else if(ot(r)&&!gn(r))s=Nx;else if(pe(r))if(!isNaN(+r))s=Nx;else{var c=On(r);c&&(l=c,s=bg)}else if(s0(r)){var f=ie({},l);f.colorStops=se(r.colorStops,function(d){return{offset:d.offset,color:On(d.color)}}),JK(r)?s=aI:QK(r)&&(s=oI),l=f}a===0?this.valType=s:(s!==this.valType||s===EF)&&(o=!0),this.discrete=this.discrete||o;var h={time:t,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=Ce(n)?n:Kg[n]||yN(n)),i.push(h),h},e.prototype.prepare=function(t,r){var n=this.keyframes;this._needsSort&&n.sort(function(g,m){return g.time-m.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=jx(i),u=DF(i),c=0;c=0&&!(o[c].percent<=r);c--);c=h(c,s-2)}else{for(c=f;cr);c++);c=h(c-1,s-2)}v=o[c+1],d=o[c]}if(d&&v){this._lastFr=c,this._lastFrP=r;var m=v.percent-d.percent,x=m===0?1:h((r-d.percent)/m,1);v.easingFunc&&(x=v.easingFunc(x));var _=n?this._additiveValue:u?Rp:t[l];if((jx(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[l]=x<1?d.rawValue:v.rawValue;else if(jx(a))a===ob?t2(_,d[i],v[i],x):Dje(_,d[i],v[i],x);else if(DF(a)){var b=d[i],S=v[i],T=a===aI;t[l]={type:T?"linear":"radial",x:fs(b.x,S.x,x),y:fs(b.y,S.y,x),colorStops:se(b.colorStops,function(A,P){var I=S.colorStops[P];return{offset:fs(A.offset,I.offset,x),color:ab(t2([],A.color,I.color,x))}}),global:S.global},T?(t[l].x2=fs(b.x2,S.x2,x),t[l].y2=fs(b.y2,S.y2,x)):t[l].r=fs(b.r,S.r,x)}else if(u)t2(_,d[i],v[i],x),n||(t[l]=ab(_));else{var C=fs(d[i],v[i],x);n?this._additiveValue=C:t[l]=C}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===Nx?t[n]=t[n]+i:r===bg?(On(t[n],Rp),Dx(Rp,Rp,i,1),t[n]=ab(Rp)):r===ob?Dx(t[n],t[n],i,1):r===nJ&&OF(t[n],t[n],i,1)},e}(),bN=function(){function e(t,r,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=r,r&&i){CT("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,r,n){return this.whenWithKeys(t,r,it(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,Qg(u),i),this._trackKeys.push(s)}l.addKeyframe(t,Qg(r[s]),i)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var r=t.length,n=0;n0)){this._started=1;for(var r=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e}();function Zh(){return new Date().getTime()}var zje=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return t.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},t.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},t.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},t.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},t.prototype.update=function(r){for(var n=Zh()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,r||(this.trigger("frame",i),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(aw(n),!r._paused&&r.update())}aw(n)},t.prototype.start=function(){this._running||(this._time=Zh(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Zh(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Zh()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(r,n){n=n||{},this.start();var i=new bN(r,n.loop);return this.addAnimator(i),i},t}(xa),$je=300,r2=nt.domSupported,n2=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=se(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}}(),NF={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},jF=!1;function sI(e){var t=e.pointerType;return t==="pen"||t==="touch"}function Fje(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function i2(e){e&&(e.zrByTouch=!0)}function Vje(e,t){return Zi(e.dom,new Gje(e,t),!0)}function iJ(e,t){for(var r=t,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==t&&r===e.painterRoot);)r=r.parentNode;return n}var Gje=function(){function e(t,r){this.stopPropagation=sr,this.stopImmediatePropagation=sr,this.preventDefault=sr,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),ka={mousedown:function(e){e=Zi(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=Zi(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=Zi(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=Zi(this.dom,e);var t=e.toElement||e.relatedTarget;iJ(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){jF=!0,e=Zi(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){jF||(e=Zi(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=Zi(this.dom,e),i2(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),ka.mousemove.call(this,e),ka.mousedown.call(this,e)},touchmove:function(e){e=Zi(this.dom,e),i2(e),this.handler.processGesture(e,"change"),ka.mousemove.call(this,e)},touchend:function(e){e=Zi(this.dom,e),i2(e),this.handler.processGesture(e,"end"),ka.mouseup.call(this,e),+new Date-+this.__lastTouchMoment<$je&&ka.click.call(this,e)},pointerdown:function(e){ka.mousedown.call(this,e)},pointermove:function(e){sI(e)||ka.mousemove.call(this,e)},pointerup:function(e){ka.mouseup.call(this,e)},pointerout:function(e){sI(e)||ka.mouseout.call(this,e)}};B(["click","dblclick","contextmenu"],function(e){ka[e]=function(t){t=Zi(this.dom,t),this.trigger(e,t)}});var lI={pointermove:function(e){sI(e)||lI.mousemove.call(this,e)},pointerup:function(e){lI.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function Wje(e,t){var r=t.domHandlers;nt.pointerEventsSupported?B(n2.pointer,function(n){sb(t,n,function(i){r[n].call(e,i)})}):(nt.touchEventsSupported&&B(n2.touch,function(n){sb(t,n,function(i){r[n].call(e,i),Fje(t)})}),B(n2.mouse,function(n){sb(t,n,function(i){i=mN(i),t.touching||r[n].call(e,i)})}))}function Hje(e,t){nt.pointerEventsSupported?B(NF.pointer,r):nt.touchEventsSupported||B(NF.mouse,r);function r(n){function i(a){a=mN(a),iJ(e,a.target)||(a=Vje(e,a),t.domHandlers[n].call(e,a))}sb(t,n,i,{capture:!0})}}function sb(e,t,r,n){e.mounted[t]=r,e.listenerOpts[t]=n,KL(e.domTarget,t,r,n)}function a2(e){var t=e.mounted;for(var r in t)t.hasOwnProperty(r)&&JNe(e.domTarget,r,t[r],e.listenerOpts[r]);e.mounted={}}var RF=function(){function e(t,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=r}return e}(),Uje=function(e){q(t,e);function t(r,n){var i=e.call(this)||this;return i.__pointerCapturing=!1,i.dom=r,i.painterRoot=n,i._localHandlerScope=new RF(r,ka),r2&&(i._globalHandlerScope=new RF(document,lI)),Wje(i,i._localHandlerScope),i}return t.prototype.dispose=function(){a2(this._localHandlerScope),r2&&a2(this._globalHandlerScope)},t.prototype.setCursor=function(r){this.dom.style&&(this.dom.style.cursor=r||"default")},t.prototype.__togglePointerCapture=function(r){if(this.__mayPointerCapture=null,r2&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var n=this._globalHandlerScope;r?Hje(this,n):a2(n)}},t}(xa),aJ=1;nt.hasGlobalWindow&&(aJ=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var fw=aJ,uI=.4,cI="#333",fI="#ccc",Zje="#eee",BF=c0,zF=5e-5;function $u(e){return e>zF||e<-zF}var Fu=[],th=[],o2=Wr(),s2=Math.abs,ws=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return $u(this.rotation)||$u(this.x)||$u(this.y)||$u(this.scaleX-1)||$u(this.scaleY-1)||$u(this.skewX)||$u(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(BF(n),this.invTransform=null);return}n=n||Wr(),r?this.getLocalTransform(n):BF(n),t&&(r?Ga(n,t,n):f0(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Fu);var n=Fu[0]<0?-1:1,i=Fu[1]<0?-1:1,a=((Fu[0]-n)*r+n)/Fu[0]||0,o=((Fu[1]-i)*r+i)/Fu[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Wr(),va(this.invTransform,t)},e.prototype.getComputedTransform=function(){for(var t=this,r=[];t;)r.push(t),t=t.parent;for(;t=r.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(t){var r=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),a=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,r=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||Wr(),Ga(th,t.invTransform,r),r=th);var n=this.originX,i=this.originY;(n||i)&&(o2[4]=n,o2[5]=i,Ga(th,r,o2),th[4]-=n,th[5]-=i,r=th),this.setLocalTransform(r)}},e.prototype.getGlobalScale=function(t){var r=this.transform;return t=t||[],r?(t[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),t[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(t[0]=-t[0]),r[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,r){var n=[t,r],i=this.invTransform;return i&&lr(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&lr(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&s2(t[0]-1)>1e-10&&s2(t[3]-1)>1e-10?Math.sqrt(s2(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){hw(this,t)},e.getLocalTransform=function(t,r){r=r||[];var n=t.originX||0,i=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,c=t.x,f=t.y,h=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var v=n+s,g=i+l;r[4]=-v*a-h*g*o,r[5]=-g*o-d*v*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=h*o,u&&Qs(r,r,u),r[4]+=n+c,r[5]+=i+f,r},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),Vo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function hw(e,t){for(var r=0;r=$F)){e=e||Fs;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=ui.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?l2=$F:i>2&&l2++,t}}var l2=0,$F=5;function oJ(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=Yje(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function jo(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=ui.measureText(t,e.font).width,r.put(t,n)),n}function FF(e,t,r,n){var i=jo(No(t),e),a=h0(t),o=Jd(0,i,r),s=Wc(0,a,n),l=new Oe(o,s,i,a);return l}function IT(e,t,r,n){var i=((e||"")+"").split(` +`),a=i.length;if(a===1)return FF(i[0],t,r,n);for(var o=new Oe(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function dw(e,t,r){var n=t.position||"inside",i=t.distance!=null?t.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,c="left",f="top";if(n instanceof Array)l+=qa(n[0],r.width),u+=qa(n[1],r.height),c=null,f=null;else switch(n){case"left":l-=i,u+=s,c="right",f="middle";break;case"right":l+=i+o,u+=s,f="middle";break;case"top":l+=o/2,u-=i,c="center",f="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",f="middle";break;case"insideLeft":l+=i,u+=s,f="middle";break;case"insideRight":l+=o-i,u+=s,c="right",f="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",f="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=a-i,f="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",f="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=c,e.verticalAlign=f,e}var u2="__zr_normal__",c2=Vo.concat(["ignore"]),Xje=da(Vo,function(e,t){return e[t]=!0,e},{ignore:!1}),rh={},qje=new Oe(0,0,0,0),Bx=[],OT=function(){function e(t){this.id=dN(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=r,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var r=this._textContent;if(r&&(!r.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;a.copyTransform(r);var c=n.position!=null,f=n.autoOverflowArea,h=void 0;if((f||c)&&(h=qje,n.layoutRect?h.copy(n.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(rh,n,h):dw(rh,n,h),a.x=rh.x,a.y=rh.y,o=rh.align,s=rh.verticalAlign;var d=n.origin;if(d&&n.rotation!=null){var v=void 0,g=void 0;d==="center"?(v=h.width*.5,g=h.height*.5):(v=qa(d[0],h.width),g=qa(d[1],h.height)),u=!0,a.originX=-a.x+v+(i?0:h.x),a.originY=-a.y+g+(i?0:h.y)}}n.rotation!=null&&(a.rotation=n.rotation);var m=n.offset;m&&(a.x+=m[0],a.y+=m[1],u||(a.originX=-m[0],a.originY=-m[1]));var x=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(f){var _=x.overflowRect=x.overflowRect||new Oe(0,0,0,0);a.getLocalTransform(Bx),va(Bx,Bx),Oe.copy(_,h),_.applyTransform(Bx)}else x.overflowRect=null;var b=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,S=void 0,T=void 0,C=void 0;b&&this.canBeInsideText()?(S=n.insideFill,T=n.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(S),C=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),C=!0)),S=S||"#000",(S!==x.fill||T!==x.stroke||C!==x.autoStroke||o!==x.align||s!==x.verticalAlign)&&(l=!0,x.fill=S,x.stroke=T,x.autoStroke=C,x.align=o,x.verticalAlign=s,r.setDefaultTextStyle(x)),r.__dirty|=wi,l&&r.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?fI:cI},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&On(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,la(n,"rgba")},e.prototype.traverse=function(t,r){},e.prototype.attrKV=function(t,r){t==="textConfig"?this.setTextConfig(r):t==="textContent"?this.setTextContent(r):t==="clipPath"?this.setClipPath(r):t==="extra"?(this.extra=this.extra||{},ie(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(ke(t))for(var n=t,i=it(n),a=0;a0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var r=this.states;return r[t]||(r[t]={}),r[t]},e.prototype.clearStates=function(t){this.useState(u2,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===u2,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(We(s,t)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){CT("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||i);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(t,r,n,c),h&&h.useState(t,r,n,c),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~wi),u}}},e.prototype.useStates=function(t,r,n){if(!t.length)this.clearStates();else{var i=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l0,v);var g=this._textContent,m=this._textGuide;g&&g.useStates(t,r,h),m&&m.useStates(t,r,h),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~wi)}},e.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var r=t.__hostTarget;t=r?t.ignoreHostSilent?null:r:t.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},e.prototype.replaceState=function(t,r,n){var i=this.currentStates.slice(),a=We(i,t),o=We(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&i.push(r),this.useStates(i)},e.prototype.toggleState=function(t,r){r?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var r={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,r){for(var n=this.animators,i=n.length,a=[],o=0;o0&&r.during&&a[0].during(function(v,g){r.during(g)});for(var h=0;h0||i.force&&!o.length){var P=void 0,I=void 0,k=void 0;if(s){I={},h&&(P={});for(var S=0;S=0&&(i.splice(a,0,r),this._doAdd(r))}return this},t.prototype.replace=function(r,n){var i=We(this._children,r);return i>=0&&this.replaceAt(n,i),this},t.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},t.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},t.prototype.remove=function(r){var n=this.__zr,i=this._children,a=We(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},t.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},e.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,r){if(!this._disposed)return this.handler.findHover(t,r)},e.prototype.on=function(t,r,n){return this._disposed||this.handler.on(t,r,n),this},e.prototype.off=function(t,r){this._disposed||this.handler.off(t,r)},e.prototype.trigger=function(t,r){this._disposed||this.handler.trigger(t,r)},e.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),r=0;r0){if(e<=i)return o;if(e>=a)return s}else{if(e>=i)return o;if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/l*u+o}var ve=oRe;function oRe(e,t,r){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%";break}return fw(e,t,r)}function fw(e,t,r){return pe(e)?aRe(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function gr(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),sJ),e=(+e).toFixed(t),r?e:+e}function Ai(e){return e.sort(function(t,r){return t-r}),e}function Ba(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,r=0;r<15;r++,t*=10)if(Math.round(e*t)/t===e)return r}return lJ(e)}function lJ(e){var t=e.toString().toLowerCase(),r=t.indexOf("e"),n=r>0?+t.slice(r+1):0,i=r>0?r:t.length,a=t.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function yN(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(So(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function sRe(e,t,r){if(!e[t])return 0;var n=uJ(e,r);return n[t]||0}function uJ(e,t){var r=da(e,function(d,v){return d+(isNaN(v)?0:v)},0);if(r===0)return[];for(var n=Math.pow(10,t),i=se(e,function(d){return(isNaN(d)?0:d)/r*n*100}),a=n*100,o=se(i,function(d){return Math.floor(d)}),s=da(o,function(d,v){return d+v},0),l=se(i,function(d,v){return d-o[v]});su&&(u=l[f],c=f);++o[c],l[c]=0,++s}return se(o,function(d){return d/n})}function lRe(e,t){var r=Math.max(Ba(e),Ba(t)),n=e+t;return r>sJ?n:gr(n,r)}var uI=9007199254740991;function xN(e){var t=Math.PI*2;return(e%t+t)%t}function Qd(e){return e>-BF&&e=10&&t++,t}function _N(e,t){var r=LT(e),n=Math.pow(10,r),i=e/n,a;return t?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,e=a*n,r>=-20?+e.toFixed(r<0?-r:0):e}function ob(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),i=+e[n-1],a=r-n;return a?i+a*(e[n]-i):i}function cI(e){e.sort(function(l,u){return s(l,u,0)?-1:1});for(var t=-1/0,r=1,n=0;n0?t.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx=this._end)?(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0):!1},e}();function c2(e){e.option=e.parentModel=e.ecModel=null}var PRe=".",Vu="___EC__COMPONENT__CONTAINER___",_J="___EC__EXTENDED_CLASS___";function To(e){var t={main:"",sub:""};if(e){var r=e.split(PRe);t.main=r[0]||"",t.sub=r[1]||""}return t}function kRe(e){xn(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function LRe(e){return!!(e&&e[_J])}function TN(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return IRe(n)?i=function(a){q(o,a);function o(){return a.apply(this,arguments)||this}return o}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},cN(i,this)),ie(i.prototype,r),i[_J]=!0,i.extend=this.extend,i.superCall=DRe,i.superApply=NRe,i.superClass=n,i}}function IRe(e){return Ce(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function bJ(e,t){e.extend=t.extend}var ORe=Math.round(Math.random()*10);function ERe(e){var t=["__\0is_clz",ORe++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function DRe(e,t){for(var r=[],n=2;n=0||a&&We(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var jRe=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],RRe=hf(jRe),BRe=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return RRe(this,t,r)},e}(),hI=new Kd(50);function zRe(e){if(typeof e=="string"){var t=hI.get(e);return t&&t.image}else return e}function CN(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=hI.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!OT(t)&&a.pending.push(o)):(t=ui.loadImage(e,VF,VF),t.__zrImageSrc=e,hI.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function VF(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var c=No(o,r);return c>l&&(r="",c=0),l=e-c,i.ellipsis=r,i.ellipsisWidth=c,i.contentWidth=l,i.containerWidth=e,i}function TJ(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=No(a,t);if(o<=n){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){t+=r.ellipsis;break}var l=s===0?FRe(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=No(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function FRe(e,t,r){for(var n=0,i=0,a=e.length;im&&d){var b=Math.floor(m/h);v=v||y.length>b,y=y.slice(0,b),_=y.length*h}if(i&&c&&g!=null)for(var S=SJ(g,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},C=0;Cv&&h2(a,o.substring(v,m),t,d),h2(a,g[2],t,d,g[1]),v=f2.lastIndex}vf){var U=a.lines.length;D>0?(I.tokens=I.tokens.slice(0,D),A(I,E,k),a.lines=a.lines.slice(0,P+1)):a.lines=a.lines.slice(0,P),a.isTruncated=a.isTruncated||a.lines.length0&&v+n.accumWidth>n.width&&(c=t.split(` -`),u=!0),n.accumWidth=v}else{var g=CJ(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=g.accumWidth+d,f=g.linesWidths,c=g.lines}}c||(c=t.split(` -`));for(var m=Do(l),y=0;y=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var ZRe=da(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function YRe(e){return URe(e)?!!ZRe[e]:!0}function CJ(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,f=Do(t),h=0;hr:i+c+v>r){c?(s||l)&&(g?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=d,u+=v,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=d,c=v)):g?(a.push(l),o.push(u),l=d,u=v):(a.push(d),o.push(v));continue}c+=v,g?(l+=d,u+=v):(l&&(s+=l,l="",u=0),s+=d)}return l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=i),{accumWidth:c,lines:a,linesWidths:o}}function WF(e,t,r,n,i,a){if(e.baseX=r,e.baseY=n,e.outerWidth=e.outerHeight=null,!!t){var o=t.width*2,s=t.height*2;Oe.set(HF,Jd(r,o,i),Wc(n,s,a),o,s),Oe.intersect(t,HF,null,UF);var l=UF.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=Jd(l.x,l.width,i,!0),e.baseY=Wc(l.y,l.height,a,!0)}}var HF=new Oe(0,0,0,0),UF={outIntersectRect:{},clamp:!0};function AN(e){return e!=null?e+="":e=""}function XRe(e){var t=AN(e.text),r=e.font,n=No(Do(r),t),i=u0(r);return dI(e,n,i,null)}function dI(e,t,r,n){var i=new Oe(Jd(e.x||0,t,e.textAlign),Wc(e.y||0,r,e.textBaseline),t,r),a=n??(AJ(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function AJ(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var vI="__zr_style_"+Math.round(Math.random()*10),Hc={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},ET={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Hc[vI]=!0;var ZF=["z","z2","invisible"],qRe=["invisible"],pa=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=it(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(jx[0]=g2(i)*r+e,jx[1]=p2(i)*n+t,Rx[0]=g2(a)*r+e,Rx[1]=p2(a)*n+t,u(s,jx,Rx),c(l,jx,Rx),i=i%Gu,i<0&&(i=i+Gu),a=a%Gu,a<0&&(a=a+Gu),i>a&&!o?a+=Gu:ii&&(Bx[0]=g2(d)*r+e,Bx[1]=p2(d)*n+t,u(s,Bx,s),c(l,Bx,l))}var It={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Wu=[],Hu=[],ao=[],nl=[],oo=[],so=[],m2=Math.min,y2=Math.max,Uu=Math.cos,Zu=Math.sin,ts=Math.abs,pI=Math.PI,vl=pI*2,x2=typeof Float32Array<"u",jp=[];function _2(e){var t=Math.round(e/pI*1e8)/1e8;return t%2*pI}function NT(e,t){var r=_2(e[0]);r<0&&(r+=vl);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=vl?i=r+vl:t&&r-i>=vl?i=r-vl:!t&&r>i?i=r+(vl-_2(r-i)):t&&r0&&(this._ux=ts(n/lw/t)||0,this._uy=ts(n/lw/r)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,r){return this._drawPendingPt(),this.addData(It.M,t,r),this._ctx&&this._ctx.moveTo(t,r),this._x0=t,this._y0=r,this._xi=t,this._yi=r,this},e.prototype.lineTo=function(t,r){var n=ts(t-this._xi),i=ts(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(It.L,t,r),this._ctx&&a&&this._ctx.lineTo(t,r),a)this._xi=t,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=r,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){return this._drawPendingPt(),this.addData(It.C,t,r,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(t,r,n,i,a,o),this._xi=a,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,r,n,i){return this._drawPendingPt(),this.addData(It.Q,t,r,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,r,n,i),this._xi=n,this._yi=i,this},e.prototype.arc=function(t,r,n,i,a,o){this._drawPendingPt(),jp[0]=i,jp[1]=a,NT(jp,o),i=jp[0],a=jp[1];var s=a-i;return this.addData(It.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=Uu(a)*n+t,this._yi=Zu(a)*n+r,this},e.prototype.arcTo=function(t,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,r,n,i,a),this},e.prototype.rect=function(t,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,r,n,i),this.addData(It.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(It.Z);var t=this._ctx,r=this._x0,n=this._y0;return t&&t.closePath(),this._xi=r,this._yi=n,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){if(this._saveData){var r=t.length;!(this.data&&this.data.length===r)&&x2&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sc.length&&(this._expandData(),c=this.data);for(var f=0;f0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],r=0;r11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){ao[0]=ao[1]=oo[0]=oo[1]=Number.MAX_VALUE,nl[0]=nl[1]=so[0]=so[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||ts(b)>i||h===r-1)&&(g=Math.sqrt(_*_+b*b),a=m,o=y);break}case It.C:{var S=t[h++],T=t[h++],m=t[h++],y=t[h++],C=t[h++],A=t[h++];g=cje(a,o,S,T,m,y,C,A,10),a=C,o=A;break}case It.Q:{var S=t[h++],T=t[h++],m=t[h++],y=t[h++];g=hje(a,o,S,T,m,y,10),a=m,o=y;break}case It.A:var P=t[h++],I=t[h++],k=t[h++],E=t[h++],D=t[h++],N=t[h++],z=N+D;h+=1,v&&(s=Uu(D)*k+P,l=Zu(D)*E+I),g=y2(k,E)*m2(vl,Math.abs(N)),a=Uu(z)*k+P,o=Zu(z)*E+I;break;case It.R:{s=a=t[h++],l=o=t[h++];var F=t[h++],$=t[h++];g=F*2+$*2;break}case It.Z:{var _=s-a,b=l-o;g=Math.sqrt(_*_+b*b),a=s,o=l;break}}g>=0&&(u[f++]=g,c+=g)}return this._pathLen=c,c},e.prototype.rebuildPath=function(t,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,c,f,h,d=r<1,v,g,m=0,y=0,_,b=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,g=this._pathLen,_=r*g,!_)))e:for(var C=0;C0&&(t.lineTo(S,T),b=0),A){case It.M:s=u=n[C++],l=c=n[C++],t.moveTo(u,c);break;case It.L:{f=n[C++],h=n[C++];var I=ts(f-u),k=ts(h-c);if(I>i||k>a){if(d){var E=v[y++];if(m+E>_){var D=(_-m)/E;t.lineTo(u*(1-D)+f*D,c*(1-D)+h*D);break e}m+=E}t.lineTo(f,h),u=f,c=h,b=0}else{var N=I*I+k*k;N>b&&(S=f,T=h,b=N)}break}case It.C:{var z=n[C++],F=n[C++],$=n[C++],Z=n[C++],j=n[C++],U=n[C++];if(d){var E=v[y++];if(m+E>_){var D=(_-m)/E;uu(u,z,$,j,D,Wu),uu(c,F,Z,U,D,Hu),t.bezierCurveTo(Wu[1],Hu[1],Wu[2],Hu[2],Wu[3],Hu[3]);break e}m+=E}t.bezierCurveTo(z,F,$,Z,j,U),u=j,c=U;break}case It.Q:{var z=n[C++],F=n[C++],$=n[C++],Z=n[C++];if(d){var E=v[y++];if(m+E>_){var D=(_-m)/E;dy(u,z,$,D,Wu),dy(c,F,Z,D,Hu),t.quadraticCurveTo(Wu[1],Hu[1],Wu[2],Hu[2]);break e}m+=E}t.quadraticCurveTo(z,F,$,Z),u=$,c=Z;break}case It.A:var G=n[C++],V=n[C++],Y=n[C++],K=n[C++],ee=n[C++],le=n[C++],he=n[C++],Re=!n[C++],ge=Y>K?Y:K,ne=ts(Y-K)>.001,fe=ee+le,ue=!1;if(d){var E=v[y++];m+E>_&&(fe=ee+le*(_-m)/E,ue=!0),m+=E}if(ne&&t.ellipse?t.ellipse(G,V,Y,K,he,ee,fe,Re):t.arc(G,V,ge,ee,fe,Re),ue)break e;P&&(s=Uu(ee)*Y+G,l=Zu(ee)*K+V),u=Uu(fe)*Y+G,c=Zu(fe)*K+V;break;case It.R:s=u=n[C],l=c=n[C+1],f=n[C++],h=n[C++];var te=n[C++],Ve=n[C++];if(d){var E=v[y++];if(m+E>_){var Se=_-m;t.moveTo(f,h),t.lineTo(f+m2(Se,te),h),Se-=te,Se>0&&t.lineTo(f+te,h+m2(Se,Ve)),Se-=Ve,Se>0&&t.lineTo(f+y2(te-Se,0),h+Ve),Se-=te,Se>0&&t.lineTo(f,h+y2(Ve-Se,0));break e}m+=E}t.rect(f,h,te,Ve);break;case It.Z:if(d){var E=v[y++];if(m+E>_){var D=(_-m)/E;t.lineTo(u*(1-D)+s*D,c*(1-D)+l*D);break e}m+=E}t.closePath(),u=s,c=l}}},e.prototype.clone=function(){var t=new e,r=this.data;return t.data=r.slice?r.slice():Array.prototype.slice.call(r),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=It,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function xl(e,t,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=e;if(o>t+s&&o>n+s||oe+s&&a>r+s||at+f&&c>n+f&&c>a+f&&c>s+f||ce+f&&u>r+f&&u>i+f&&u>o+f||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||c+ui&&(i+=Rp);var h=Math.atan2(l,s);return h<0&&(h+=Rp),h>=n&&h<=i||h+Rp>=n&&h+Rp<=i}function cs(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var il=Fo.CMD,Yu=Math.PI*2,n5e=1e-4;function i5e(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&a5e(),d=$r(t,n,a,s,Xi[0]),h>1&&(v=$r(t,n,a,s,Xi[1]))),h===2?mt&&s>n&&s>a||s=0&&u<=1){for(var c=0,f=tn(t,n,a,u),h=0;hr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);zn[0]=-l,zn[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=Yu-1e-4){n=0,i=Yu;var c=a?1:-1;return o>=zn[0]+e&&o<=zn[1]+e?c:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=Yu,i+=Yu);for(var h=0,d=0;d<2;d++){var v=zn[d];if(v+e>o){var g=Math.atan2(s,v),c=a?1:-1;g<0&&(g=Yu+g),(g>=n&&g<=i||g+Yu>=n&&g+Yu<=i)&&(g>Math.PI/2&&g1&&(r||(s+=cs(l,u,c,f,n,i))),m&&(l=a[v],u=a[v+1],c=l,f=u),g){case il.M:c=a[v++],f=a[v++],l=c,u=f;break;case il.L:if(r){if(xl(l,u,a[v],a[v+1],t,n,i))return!0}else s+=cs(l,u,a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case il.C:if(r){if(t5e(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=o5e(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case il.Q:if(r){if(MJ(l,u,a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=s5e(l,u,a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case il.A:var y=a[v++],_=a[v++],b=a[v++],S=a[v++],T=a[v++],C=a[v++];v+=1;var A=!!(1-a[v++]);h=Math.cos(T)*b+y,d=Math.sin(T)*S+_,m?(c=h,f=d):s+=cs(l,u,h,d,n,i);var P=(n-y)*S/b+y;if(r){if(r5e(y,_,S,T,T+C,A,t,P,i))return!0}else s+=l5e(y,_,S,T,T+C,A,P,i);l=Math.cos(T+C)*b+y,u=Math.sin(T+C)*S+_;break;case il.R:c=l=a[v++],f=u=a[v++];var I=a[v++],k=a[v++];if(h=c+I,d=f+k,r){if(xl(c,f,h,f,t,n,i)||xl(h,f,h,d,t,n,i)||xl(h,d,c,d,t,n,i)||xl(c,d,c,f,t,n,i))return!0}else s+=cs(h,f,h,d,n,i),s+=cs(c,d,c,f,n,i);break;case il.Z:if(r){if(xl(l,u,c,f,t,n,i))return!0}else s+=cs(l,u,c,f,n,i);l=c,u=f;break}}return!r&&!i5e(u,f)&&(s+=cs(l,u,c,f,n,i)||0),s!==0}function u5e(e,t,r){return PJ(e,0,!1,t,r)}function c5e(e,t,r,n){return PJ(e,t,!0,r,n)}var hw=Pe({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Hc),f5e={style:Pe({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},ET.style)},b2=zo.concat(["invisible","culling","z","z2","zlevel","parent"]),tt=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.update=function(){var r=this;e.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?aI:n>.2?Gje:oI}else if(r)return oI}return aI},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(pe(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=gy(r,0)0))},t.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},t.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Mh)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),c5e(s,l/u,r,n)))return!0}if(this.hasFill())return u5e(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Mh,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(r){return this.animate("shape",r)},t.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):e.prototype.attrKV.call(this,r,n)},t.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:ie(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Mh)},t.prototype.createStyle=function(r){return o0(hw,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=ie({},this.shape))},t.prototype._applyStateObj=function(r,n,i,a,o,s){e.prototype._applyStateObj.call(this,r,n,i,a,o,s);var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=ie({},i.shape),ie(u,n.shape)):(u=ie({},a?this.shape:i.shape),ie(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=ie({},this.shape);for(var c={},f=it(u),h=0;hi&&(f=s+l,s*=i/f,l*=i/f),u+c>i&&(f=u+c,u*=i/f,c*=i/f),l+u>a&&(f=l+u,l*=a/f,u*=a/f),s+c>a&&(f=s+c,s*=a/f,c*=a/f),e.moveTo(r+s,n),e.lineTo(r+i-l,n),l!==0&&e.arc(r+i-l,n+l,l,-Math.PI/2,0),e.lineTo(r+i,n+a-u),u!==0&&e.arc(r+i-u,n+a-u,u,0,Math.PI/2),e.lineTo(r+c,n+a),c!==0&&e.arc(r+c,n+a-c,c,Math.PI/2,Math.PI),e.lineTo(r,n+s),s!==0&&e.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var Yh=Math.round;function jT(e,t,r){if(t){var n=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=n,e.x2=i,e.y1=a,e.y2=o;var s=r&&r.lineWidth;return s&&(Yh(n*2)===Yh(i*2)&&(e.x1=e.x2=Pi(n,s,!0)),Yh(a*2)===Yh(o*2)&&(e.y1=e.y2=Pi(a,s,!0))),e}}function kJ(e,t,r){if(t){var n=t.x,i=t.y,a=t.width,o=t.height;e.x=n,e.y=i,e.width=a,e.height=o;var s=r&&r.lineWidth;return s&&(e.x=Pi(n,s,!0),e.y=Pi(i,s,!0),e.width=Math.max(Pi(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Pi(i+o,s,!1)-e.y,o===0?0:1)),e}}function Pi(e,t,r){if(!t)return e;var n=Yh(e*2);return(n+Yh(t))%2===0?n/2:(n+(r?1:-1))/2}var m5e=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),y5e={},Xe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new m5e},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=kJ(y5e,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?g5e(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(tt);Xe.prototype.type="rect";var JF={fill:"#000"},QF=2,lo={},x5e={style:Pe({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},ET.style)},at=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=JF,n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,D=0;D=0&&(z=C[N],z.align==="right");)this._placeToken(z,r,P,y,D,"right",b),I-=z.width,D-=z.width,N--;for(E+=(c-(E-m)-(_-D)-I)/2;k<=N;)z=C[k],this._placeToken(z,r,P,y,E+z.width/2,"center",b),E+=z.width,k++;y+=P}},t.prototype._placeToken=function(r,n,i,a,o,s,l){var u=n.rich[r.styleName]||{};u.text=r.text;var c=r.verticalAlign,f=a+i/2;c==="top"?f=a+r.height/2:c==="bottom"&&(f=a+i-r.height/2);var h=!r.isLineHolder&&w2(u);h&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var d=!!u.backgroundColor,v=r.textPadding;v&&(o=aV(o,s,v),f-=r.height/2-v[0]-r.innerHeight/2);var g=this._getOrCreateChild(ev),m=g.createStyle();g.useStyle(m);var y=this._defaultStyle,_=!1,b=0,S=!1,T=iV("fill"in u?u.fill:"fill"in n?n.fill:(_=!0,y.fill)),C=nV("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!y.autoStroke||_)?(b=QF,S=!0,y.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;m.text=r.text,m.x=o,m.y=f,A&&(m.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,m.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",m.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,m.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),m.textAlign=s,m.textBaseline="middle",m.font=r.font||zs,m.opacity=li(u.opacity,n.opacity,1),tV(m,u),C&&(m.lineWidth=li(u.lineWidth,n.lineWidth,b),m.lineDash=be(u.lineDash,n.lineDash),m.lineDashOffset=n.lineDashOffset||0,m.stroke=C),T&&(m.fill=T),g.setBoundingRect(dI(m,r.contentWidth,r.contentHeight,S?0:null))},t.prototype._renderBackground=function(r,n,i,a,o,s){var l=r.backgroundColor,u=r.borderWidth,c=r.borderColor,f=l&&l.image,h=l&&!f,d=r.borderRadius,v=this,g,m;if(h||r.lineHeight||u&&c){g=this._getOrCreateChild(Xe),g.useStyle(g.createStyle()),g.style.fill=null;var y=g.shape;y.x=i,y.y=a,y.width=o,y.height=s,y.r=d,g.dirtyShape()}if(h){var _=g.style;_.fill=l||null,_.fillOpacity=be(r.fillOpacity,1)}else if(f){m=this._getOrCreateChild(Yr),m.onload=function(){v.dirtyStyle()};var b=m.style;b.image=l.image,b.x=i,b.y=a,b.width=o,b.height=s}if(u&&c){var _=g.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=be(r.strokeOpacity,1),_.lineDash=r.borderDash,_.lineDashOffset=r.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var S=(g||m).style;S.shadowBlur=r.shadowBlur||0,S.shadowColor=r.shadowColor||"transparent",S.shadowOffsetX=r.shadowOffsetX||0,S.shadowOffsetY=r.shadowOffsetY||0,S.opacity=li(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return IJ(r)&&(n=[r.fontStyle,r.fontWeight,LJ(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Ci(n)||r.textFont||r.font},t}(pa),_5e={left:!0,right:1,center:1},b5e={top:1,bottom:1,middle:1},eV=["fontStyle","fontWeight","fontSize","fontFamily"];function LJ(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?oN+"px":e+"px"}function tV(e,t){for(var r=0;r=0,a=!1;if(e instanceof tt){var o=OJ(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(nh(s)||nh(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=ie({},n),u=ie({},u),u.fill=s):!nh(u.fill)&&nh(s)?(a=!0,n=ie({},n),u=ie({},u),u.fill=ow(s)):!nh(u.stroke)&&nh(l)&&(a||(n=ie({},n),u=ie({},u)),u.stroke=ow(l)),n.style=u}}if(n&&n.z2==null){a||(n=ie({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??Bv)}return n}function P5e(e,t,r){if(r&&r.z2==null){r=ie({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??S5e)}return r}function k5e(e,t,r){var n=We(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:A5e(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=ie({},r),o=ie({opacity:n?i:a.opacity*.1},o),r.style=o),r}function S2(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return M5e(this,e,t,r);if(e==="blur")return k5e(this,e,r);if(e==="select")return P5e(this,e,r)}return r}function df(e){e.stateProxy=S2;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=S2),r&&(r.stateProxy=S2)}function cV(e,t){!zJ(e,t)&&!e.__highByOuter&&Js(e,EJ)}function fV(e,t){!zJ(e,t)&&!e.__highByOuter&&Js(e,DJ)}function Fs(e,t){e.__highByOuter|=1<<(t||0),Js(e,EJ)}function Vs(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Js(e,DJ)}function jJ(e){Js(e,LN)}function IN(e){Js(e,NJ)}function RJ(e){Js(e,T5e)}function BJ(e){Js(e,C5e)}function zJ(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function $J(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=MN(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){NJ(u)}),s&&r.push(a)),o.isBlured=!1}),B(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function yI(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,c){for(var f=0;f0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function Xl(e,t,r){Dc(e,!0),Js(e,df),_I(e,t,r)}function N5e(e){Dc(e,!1)}function Gt(e,t,r,n){n?N5e(e):Xl(e,t,r)}function _I(e,t,r){var n=De(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var dV=["emphasis","blur","select"],j5e={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Dr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=T2(v),s*=T2(v));var g=(i===a?-1:1)*T2((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,m=g*o*d/s,y=g*-s*h/o,_=(e+r)/2+$x(f)*m-zx(f)*y,b=(t+n)/2+zx(f)*m+$x(f)*y,S=mV([1,0],[(h-m)/o,(d-y)/s]),T=[(h-m)/o,(d-y)/s],C=[(-1*h-m)/o,(-1*d-y)/s],A=mV(T,C);if(wI(T,C)<=-1&&(A=Bp),wI(T,C)>=1&&(A=0),A<0){var P=Math.round(A/Bp*1e6)/1e6;A=Bp*2+P%2*Bp}c.addData(u,_,b,o,s,S,A,f,a)}var V5e=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,G5e=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function W5e(e){var t=new Fo;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=Fo.CMD,l=e.match(V5e);if(!l)return t;for(var u=0;uz*z+F*F&&(P=k,I=E),{cx:P,cy:I,x0:-c,y0:-f,x1:P*(i/T-1),y1:I*(i/T-1)}}function K5e(e){var t;if(ae(e)){var r=e.length;if(!r)return e;r===1?t=[e[0],e[0],0,0]:r===2?t=[e[0],e[0],e[1],e[1]]:r===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function J5e(e,t){var r,n=_g(t.r,0),i=_g(t.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var c=t.cx,f=t.cy,h=!!t.clockwise,d=xV(u-l),v=d>C2&&d%C2;if(v>Ma&&(d=v),!(n>Ma))e.moveTo(c,f);else if(d>C2-Ma)e.moveTo(c+n*ah(l),f+n*Xu(l)),e.arc(c,f,n,l,u,!h),i>Ma&&(e.moveTo(c+i*ah(u),f+i*Xu(u)),e.arc(c,f,i,u,l,h));else{var g=void 0,m=void 0,y=void 0,_=void 0,b=void 0,S=void 0,T=void 0,C=void 0,A=void 0,P=void 0,I=void 0,k=void 0,E=void 0,D=void 0,N=void 0,z=void 0,F=n*ah(l),$=n*Xu(l),Z=i*ah(u),j=i*Xu(u),U=d>Ma;if(U){var G=t.cornerRadius;G&&(r=K5e(G),g=r[0],m=r[1],y=r[2],_=r[3]);var V=xV(n-i)/2;if(b=uo(V,y),S=uo(V,_),T=uo(V,g),C=uo(V,m),I=A=_g(b,S),k=P=_g(T,C),(A>Ma||P>Ma)&&(E=n*ah(u),D=n*Xu(u),N=i*ah(l),z=i*Xu(l),dMa){var ne=uo(y,I),fe=uo(_,I),ue=Fx(N,z,F,$,n,ne,h),te=Fx(E,D,Z,j,n,fe,h);e.moveTo(c+ue.cx+ue.x0,f+ue.cy+ue.y0),I0&&e.arc(c+ue.cx,f+ue.cy,ne,Tn(ue.y0,ue.x0),Tn(ue.y1,ue.x1),!h),e.arc(c,f,n,Tn(ue.cy+ue.y1,ue.cx+ue.x1),Tn(te.cy+te.y1,te.cx+te.x1),!h),fe>0&&e.arc(c+te.cx,f+te.cy,fe,Tn(te.y1,te.x1),Tn(te.y0,te.x0),!h))}else e.moveTo(c+F,f+$),e.arc(c,f,n,l,u,!h);if(!(i>Ma)||!U)e.lineTo(c+Z,f+j);else if(k>Ma){var ne=uo(g,k),fe=uo(m,k),ue=Fx(Z,j,E,D,i,-fe,h),te=Fx(F,$,N,z,i,-ne,h);e.lineTo(c+ue.cx+ue.x0,f+ue.cy+ue.y0),k0&&e.arc(c+ue.cx,f+ue.cy,fe,Tn(ue.y0,ue.x0),Tn(ue.y1,ue.x1),!h),e.arc(c,f,i,Tn(ue.cy+ue.y1,ue.cx+ue.x1),Tn(te.cy+te.y1,te.cx+te.x1),h),ne>0&&e.arc(c+te.cx,f+te.cy,ne,Tn(te.y1,te.x1),Tn(te.y0,te.x0),!h))}else e.lineTo(c+Z,f+j),e.arc(c,f,i,u,l,h)}e.closePath()}}}var Q5e=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),_n=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Q5e},t.prototype.buildPath=function(r,n){J5e(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(tt);_n.prototype.type="sector";var eBe=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),zv=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new eBe},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,o,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,o,!0)},t}(tt);zv.prototype.type="ring";function tBe(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,c,f;if(n){c=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=e.length;h=2){if(n){var a=tBe(i,n,r,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=i[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,f=i.length;sKu[1]){if(a=!1,Jr.negativeSize||n)return a;var l=Vx(Ku[0]-qu[1]),u=Vx(qu[0]-Ku[1]);A2(l,u)>Wx.len()&&(l=u||!Jr.bidirectional)&&(Ie.scale(Gx,s,-u*i),Jr.useDir&&Jr.calcDirMTV()))}}return a},e.prototype._getProjMinMaxOnAxis=function(t,r,n){for(var i=this._axes[t],a=this._origin,o=r[0].dot(i)+a[t],s=o,l=o,u=1;u0){var f=c.duration,h=c.delay,d=c.easing,v={duration:f,delay:h||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,v):t.animateTo(r,v)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function lt(e,t,r,n,i,a){NN("update",e,t,r,n,i,a)}function Dt(e,t,r,n,i,a){NN("enter",e,t,r,n,i,a)}function vd(e){if(!e.__zr)return!0;for(var t=0;tSo(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function wV(e){return!e.isGroup}function dBe(e){return e.shape!=null}function v0(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){wV(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return dBe(o)&&(s.shape=Ae(o.shape)),s}var a=n(e);t.traverse(function(o){if(wV(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),lt(o,l,r,De(o).dataIndex)}}})}function BN(e,t){return se(e,function(r){var n=r[0];n=pr(n,t.x),n=Li(n,t.x+t.width);var i=r[1];return i=pr(i,t.y),i=Li(i,t.y+t.height),[n,i]})}function tQ(e,t){var r=pr(e.x,t.x),n=Li(e.x+e.width,t.x+t.width),i=pr(e.y,t.y),a=Li(e.y+e.height,t.y+t.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function Vv(e,t,r){var n=ie({rectHover:!0},t),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},e)return e.indexOf("image://")===0?(i.image=e.slice(8),Pe(i,r),new Yr(n)):tv(e.replace("path://",""),n,r,"center")}function bg(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var m=M2(d,v,c,f)/h;return!(m<0||m>1)}function M2(e,t,r,n){return e*n-r*t}function vBe(e){return e<=1e-6&&e>=-1e-6}function vf(e,t,r,n,i){return t==null||(ot(t)?Ht[0]=Ht[1]=Ht[2]=Ht[3]=t:(Ht[0]=t[0],Ht[1]=t[1],Ht[2]=t[2],Ht[3]=t[3]),n&&(Ht[0]=pr(0,Ht[0]),Ht[1]=pr(0,Ht[1]),Ht[2]=pr(0,Ht[2]),Ht[3]=pr(0,Ht[3])),r&&(Ht[0]=-Ht[0],Ht[1]=-Ht[1],Ht[2]=-Ht[2],Ht[3]=-Ht[3]),SV(e,Ht,"x","width",3,1,i&&i[0]||0),SV(e,Ht,"y","height",0,2,i&&i[1]||0)),e}var Ht=[0,0,0,0];function SV(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=pr(0,Li(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:So(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function Qs(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=pe(t)?{formatter:t}:t,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=e.formatterParamsExtra;l&&B(it(l),function(c){xe(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=De(e.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Pe({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function TI(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function Au(e,t){if(e)if(ae(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function $T(e,t,r){iQ(e,t,r,-1/0)}function iQ(e,t,r,n){if(e.ignoreModelZ)return n;var i=e.getTextContent(),a=e.getTextGuideLine(),o=e.isGroup;if(o)for(var s=e.childrenRef(),l=0;l=0&&s.push(l)}),s}}function Mu(e,t){return He(He({},e,!0),t,!0)}const ABe={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},MBe={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var mw="ZH",VN="EN",pd=VN,ub={},GN={},cQ=nt.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||pd).toUpperCase();return e.indexOf(mw)>-1?mw:pd}():pd;function WN(e,t){e=e.toUpperCase(),GN[e]=new et(t),ub[e]=t}function PBe(e){if(pe(e)){var t=ub[e.toUpperCase()]||{};return e===mw||e===VN?Ae(t):He(Ae(t),Ae(ub[pd]),!1)}else return He(Ae(e),Ae(ub[pd]),!1)}function AI(e){return GN[e]}function kBe(){return GN[pd]}WN(VN,ABe);WN(mw,MBe);var MI=null;function LBe(e){MI||(MI=e)}function Sr(){return MI}var HN=1e3,UN=HN*60,em=UN*60,ta=em*24,PV=ta*365,IBe={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},cb={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},OBe="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",Ux="{yyyy}-{MM}-{dd}",kV={year:"{yyyy}",month:"{yyyy}-{MM}",day:Ux,hour:Ux+" "+cb.hour,minute:Ux+" "+cb.minute,second:Ux+" "+cb.second,millisecond:OBe},xi=["year","month","day","hour","minute","second","millisecond"],EBe=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function DBe(e){return!pe(e)&&!Ce(e)?NBe(e):e}function NBe(e){e=e||{};var t={},r=!0;return B(xi,function(n){r&&(r=e[n]==null)}),B(xi,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=xi[s],u=ke(a)&&!ae(a)?a[l]:a,c=void 0;ae(u)?(c=u.slice(),o=c[0]||""):pe(u)?(o=u,c=[o]):(o==null?o=cb[n]:IBe[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function $n(e,t){return e+="","0000".substr(0,t-e.length)+e}function tm(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function jBe(e){return e===tm(e)}function RBe(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function p0(e,t,r,n){var i=Zo(e),a=i[fQ(r)](),o=i[ZN(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[YN(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[XN(r)](),f=(c-1)%12+1,h=i[qN(r)](),d=i[KN(r)](),v=i[JN(r)](),g=c>=12?"pm":"am",m=g.toUpperCase(),y=n instanceof et?n:AI(n||cQ)||kBe(),_=y.getModel("time"),b=_.get("month"),S=_.get("monthAbbr"),T=_.get("dayOfWeek"),C=_.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,$n(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,$n(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,$n(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,C[u]).replace(/{e}/g,u+"").replace(/{HH}/g,$n(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,$n(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,$n(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,$n(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,$n(v,3)).replace(/{S}/g,v+"")}function BBe(e,t,r,n,i){var a=null;if(pe(r))a=r;else if(Ce(r)){var o={time:e.time,level:e.time.level},s=Sr();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=r(e.value,t,o)}else{var l=e.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var c=qh(e.value,i);a=r[c][c][0]}}return p0(new Date(e.value),a,i,n)}function qh(e,t){var r=Zo(e),n=r[ZN(t)]()+1,i=r[YN(t)](),a=r[XN(t)](),o=r[qN(t)](),s=r[KN(t)](),l=r[JN(t)](),u=l===0,c=u&&s===0,f=c&&o===0,h=f&&a===0,d=h&&i===1,v=d&&n===1;return v?"year":d?"month":h?"day":f?"hour":c?"minute":u?"second":"millisecond"}function yw(e,t,r){switch(t){case"year":e[hQ(r)](0);case"month":e[dQ(r)](1);case"day":e[vQ(r)](0);case"hour":e[pQ(r)](0);case"minute":e[gQ(r)](0);case"second":e[mQ(r)](0)}return e}function fQ(e){return e?"getUTCFullYear":"getFullYear"}function ZN(e){return e?"getUTCMonth":"getMonth"}function YN(e){return e?"getUTCDate":"getDate"}function XN(e){return e?"getUTCHours":"getHours"}function qN(e){return e?"getUTCMinutes":"getMinutes"}function KN(e){return e?"getUTCSeconds":"getSeconds"}function JN(e){return e?"getUTCMilliseconds":"getMilliseconds"}function zBe(e){return e?"setUTCFullYear":"setFullYear"}function hQ(e){return e?"setUTCMonth":"setMonth"}function dQ(e){return e?"setUTCDate":"setDate"}function vQ(e){return e?"setUTCHours":"setHours"}function pQ(e){return e?"setUTCMinutes":"setMinutes"}function gQ(e){return e?"setUTCSeconds":"setSeconds"}function mQ(e){return e?"setUTCMilliseconds":"setMilliseconds"}function $Be(e,t,r,n,i,a,o,s){var l=new at({style:{text:e,font:t,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function QN(e){if(!bN(e))return pe(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function ej(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var Hv=a0;function PI(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&Ci(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var o=t==="time",s=e instanceof Date;if(o||s){var l=o?Zo(e):e;if(isNaN(+l)){if(s)return"-"}else return p0(l,n,r)}if(t==="ordinal")return J1(e)?i(e):ot(e)&&a(e)?e+"":"-";var u=$o(e);return a(u)?QN(u):J1(e)?i(e):typeof e=="boolean"?e+"":"-"}var LV=["a","b","c","d","e","f","g"],L2=function(e,t){return"{"+e+(t??"")+"}"};function tj(e,t,r){ae(t)||(t=[t]);var n=t.length;if(!n)return"";for(var i=t[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function VBe(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd -yyyy`);var n=Zo(t),i=r?"getUTC":"get",a=n[i+"FullYear"](),o=n[i+"Month"]()+1,s=n[i+"Date"](),l=n[i+"Hours"](),u=n[i+"Minutes"](),c=n[i+"Seconds"](),f=n[i+"Milliseconds"]();return e=e.replace("MM",$n(o,2)).replace("M",o).replace("yyyy",a).replace("yy",$n(a%100+"",2)).replace("dd",$n(s,2)).replace("d",s).replace("hh",$n(l,2)).replace("h",l).replace("mm",$n(u,2)).replace("m",u).replace("ss",$n(c,2)).replace("s",c).replace("SSS",$n(f,3)),e}function GBe(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function gf(e,t){return t=t||"transparent",pe(e)?e:ke(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function xw(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var fb={},I2={},Uv=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(fb),this._normalMasterList=n(I2);function n(i,a){var o=[];return B(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){B(this._normalMasterList,function(n){n.update&&n.update(t,r)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(t,r){if(t==="matrix"||t==="calendar"){fb[t]=r;return}I2[t]=r},e.get=function(t){return I2[t]||fb[t]},e}();function WBe(e){return!!fb[e]}var kI={coord:1,coord2:2};function HBe(e){xQ.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var xQ=_e();function UBe(e){var t=e.getShallow("coord",!0),r=kI.coord;if(t==null){var n=xQ.get(e.type);n&&n.getCoord2&&(r=kI.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var xo={none:0,dataCoordSys:1,boxCoordSys:2};function _Q(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=xo.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=xo.dataCoordSys,a||(i=xo.none)):n==="box"&&(i=xo.boxCoordSys,!a&&!WBe(r)&&(i=xo.none))}return{coordSysType:r,kind:i}}function g0(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=_Q(t),o=a.kind,s=a.coordSysType;if(i&&o!==xo.dataCoordSys&&(o=xo.dataCoordSys,s=r),o===xo.none||s!==r)return!1;var l=n(r,t);return l?(o===xo.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var bQ=function(e,t){var r=t.getReferringComponents(e,er).models[0];return r&&r.coordinateSystem},hb=B,wQ=["left","right","top","bottom","width","height"],Nc=[["width","left","right"],["height","top","bottom"]];function rj(e,t,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;t.eachChild(function(l,u){var c=l.getBoundingRect(),f=t.childAt(u+1),h=f&&f.getBoundingRect(),d,v;if(e==="horizontal"){var g=c.width+(h?-h.x+c.x:0);d=a+g,d>n||l.newline?(a=0,d=g,o+=s+r,s=c.height):s=Math.max(s,c.height)}else{var m=c.height+(h?-h.y+c.y:0);v=o+m,v>i||l.newline?(a+=s+r,o=0,v=m,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),e==="horizontal"?a=d+r:o=v+r)})}var Zc=rj;Fe(rj,"vertical");Fe(rj,"horizontal");function SQ(e,t){return{left:e.getShallow("left",t),top:e.getShallow("top",t),right:e.getShallow("right",t),bottom:e.getShallow("bottom",t),width:e.getShallow("width",t),height:e.getShallow("height",t)}}function ZBe(e,t){var r=jr(e,t,{enableLayoutOnlyByCenter:!0}),n=e.getBoxLayoutParams(),i,a;if(r.type===wg.point)a=r.refPoint,i=zt(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=ae(o)?o:[o,o];i=zt(n,r.refContainer),a=r.boxCoordFrom===kI.coord2?r.refPoint:[ve(s[0],i.width)+i.x,ve(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function TQ(e,t){var r=ZBe(e,t),n=r.viewRect,i=r.center,a=e.get("radius");ae(a)||(a=[0,a]);var o=ve(n.width,t.getWidth()),s=ve(n.height,t.getHeight()),l=Math.min(o,s),u=ve(a[0],l/2),c=ve(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function zt(e,t,r){r=Hv(r||0);var n=t.width,i=t.height,a=ve(e.left,n),o=ve(e.top,i),s=ve(e.right,n),l=ve(e.bottom,i),u=ve(e.width,n),c=ve(e.height,i),f=r[2]+r[0],h=r[1]+r[3],d=e.aspect;switch(isNaN(u)&&(u=n-s-h-a),isNaN(c)&&(c=i-l-f-o),d!=null&&(isNaN(u)&&isNaN(c)&&(d>n/i?u=n*.8:c=i*.8),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=n-s-u-h),isNaN(o)&&(o=i-l-c-f),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-h;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-c/2-r[0];break;case"bottom":o=i-c-f;break}a=a||0,o=o||0,isNaN(u)&&(u=n-h-a-(s||0)),isNaN(c)&&(c=i-f-o-(l||0));var v=new Oe((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,c);return v.margin=r,v}function CQ(e,t,r){var n=e.getShallow("preserveAspect",!0);if(!n)return t;var i=t.width/t.height;if(Math.abs(Math.atan(r)-Math.atan(i))<1e-9)return t;var a=e.getShallow("preserveAspectAlign",!0),o=e.getShallow("preserveAspectVerticalAlign",!0),s={width:t.width,height:t.height},l=n==="cover";return i>r&&!l||i=g)return f;for(var m=0;m=0;l--)s=He(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return Rv(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return SQ(this,!1)},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(r){this.option.zlevel=r},t.protoInitialize=function(){var r=t.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),t}(et);bJ(Ke,et);IT(Ke);TBe(Ke);CBe(Ke,qBe);function qBe(e){var t=[];return B(Ke.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=se(t,function(r){return To(r).main}),e!=="dataset"&&We(t,"dataset")<=0&&t.unshift("dataset"),t}var J={color:{},darkColor:{},size:{}},fr=J.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};ie(fr,{primary:fr.neutral80,secondary:fr.neutral70,tertiary:fr.neutral60,quaternary:fr.neutral50,disabled:fr.neutral20,border:fr.neutral30,borderTint:fr.neutral20,borderShade:fr.neutral40,background:fr.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:fr.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:fr.neutral70,axisLineTint:fr.neutral40,axisTick:fr.neutral70,axisTickMinor:fr.neutral60,axisLabel:fr.neutral70,axisSplitLine:fr.neutral15,axisMinorSplitLine:fr.neutral05});for(var Ju in fr)if(fr.hasOwnProperty(Ju)){var IV=fr[Ju];Ju==="theme"?J.darkColor.theme=fr.theme.slice():Ju==="highlight"?J.darkColor.highlight="rgba(255,231,130,0.4)":Ju.indexOf("accent")===0?J.darkColor[Ju]=Ms(IV,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):J.darkColor[Ju]=Ms(IV,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}J.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var MQ="";typeof navigator<"u"&&(MQ=navigator.platform||"");var oh="rgba(0, 0, 0, 0.2)",PQ=J.color.theme[0],KBe=Ms(PQ,null,null,.9);const JBe={darkMode:"auto",colorBy:"series",color:J.color.theme,gradientColor:[KBe,PQ],aria:{decal:{decals:[{color:oh,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:oh,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:oh,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:oh,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:oh,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:oh,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:MQ.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var kQ=_e(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Ni="original",on="arrayRows",ji="objectRows",Ja="keyedColumns",Kl="typedArray",LQ="unknown",Ha="column",Ef="row",fn={Must:1,Might:2,Not:3},IQ=Je();function QBe(e){IQ(e).datasetMap=_e()}function OQ(e,t,r){var n={},i=ij(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=IQ(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,f;e=e.slice(),B(e,function(g,m){var y=ke(g)?g:e[m]={name:g};y.type==="ordinal"&&c==null&&(c=m,f=v(y)),n[y.name]=[]});var h=l.get(u)||l.set(u,{categoryWayDim:f,valueWayDim:0});B(e,function(g,m){var y=g.name,_=v(g);if(c==null){var b=h.valueWayDim;d(n[y],b,_),d(o,b,_),h.valueWayDim+=_}else if(c===m)d(n[y],0,_),d(a,0,_);else{var b=h.categoryWayDim;d(n[y],b,_),d(o,b,_),h.categoryWayDim+=_}});function d(g,m,y){for(var _=0;_t)return e[n];return e[r-1]}function NQ(e,t,r,n,i,a,o){a=a||e;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=o==null||!n?r:i3e(n,o);if(c=c||r,!(!c||!c.length)){var f=c[l];return i&&(u[i]=f),s.paletteIdx=(l+1)%c.length,f}}function a3e(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var Zx,zp,EV,DV="\0_ec_inner",o3e=1,oj=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new et(a),this._locale=new et(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=RV(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,RV(n))},t.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?EV(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&B(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},t.prototype.mergeOption=function(r){this._mergeOption(r,null)},t.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=_e(),u=n&&n.replaceMergeMainTypeMap;QBe(this),B(r,function(f,h){f!=null&&(Ke.hasClass(h)?h&&(s.push(h),l.set(h,!0)):i[h]=i[h]==null?Ae(f):He(i[h],f,!0))}),u&&u.each(function(f,h){Ke.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Ke.topologicalTravel(s,Ke.getAllClassMainTypes(),c,this);function c(f){var h=r3e(this,f,Pt(r[f])),d=a.get(f),v=d?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",g=gJ(d,h,v);bRe(g,f,Ke),i[f]=null,a.set(f,null),o.set(f,0);var m=[],y=[],_=0,b;B(g,function(S,T){var C=S.existing,A=S.newOption;if(!A)C&&(C.mergeOption({},this),C.optionUpdated({},!1));else{var P=f==="series",I=Ke.getClass(f,S.keyInfo.subType,!P);if(!I)return;if(f==="tooltip"){if(b)return;b=!0}if(C&&C.constructor===I)C.name=S.keyInfo.name,C.mergeOption(A,this),C.optionUpdated(A,!1);else{var k=ie({componentIndex:T},S.keyInfo);C=new I(A,this,this,k),ie(C,k),S.brandNew&&(C.__requireNewView=!0),C.init(A,this,this),C.optionUpdated(null,!0)}}C?(m.push(C.option),y.push(C),_++):(m.push(void 0),y.push(void 0))},this),i[f]=m,a.set(f,y),o.set(f,_),f==="series"&&Zx(this)}this._seriesIndices||Zx(this)},t.prototype.getOption=function(){var r=Ae(this.option);return B(r,function(n,i){if(Ke.hasClass(i)){for(var a=Pt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!yy(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[DV],r},t.prototype.setTheme=function(r){this._theme=new et(r),this._resetOption("recreate",null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(r){this._payload=r},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=t:r==="max"?e<=t:e===t}function p3e(e,t){return e.join(",")===t.join(",")}var Aa=B,Ty=ke,BV=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function O2(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=BV.length;r0?r[o-1].seriesModel:null)}),T3e(r)}})}function T3e(e){B(e,function(t,r){var n=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,c,f){var h=o.get(t.stackedDimension,f);if(isNaN(h))return i;var d,v;s?v=o.getRawIndex(f):d=o.get(t.stackedByDimension,f);for(var g=NaN,m=r-1;m>=0;m--){var y=e[m];if(s||(v=y.data.rawIndexOf(y.stackedByDimension,d)),v>=0){var _=y.data.getByRawIndex(y.stackResultDimension,v);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&h>=0&&_>0||l==="samesign"&&h<=0&&_<0){h=lRe(h,_),g=_;break}}}return n[0]=h,n[1]=g,n})})}var GT=function(){function e(t){this.data=t.data||(t.sourceFormat===Ja?{}:[]),this.sourceFormat=t.sourceFormat||LQ,this.seriesLayoutBy=t.seriesLayoutBy||Ha,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var r=this.dimensionsDefine=t.dimensionsDefine;if(r)for(var n=0;ng&&(g=b)}d[0]=v,d[1]=g}},i=function(){return this._data?this._data.length/this._dimSize:0};HV=(t={},t[on+"_"+Ha]={pure:!0,appendData:a},t[on+"_"+Ef]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[ji]={pure:!0,appendData:a},t[Ja]={pure:!0,appendData:function(o){var s=this._data;B(o,function(l,u){for(var c=s[u]||(s[u]=[]),f=0;f<(l||[]).length;f++)c.push(l[f])})}},t[Ni]={appendData:a},t[Kl]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(g=o.interpolatedValue[m])}return g!=null?g+"":""})}},e.prototype.getRawValue=function(t,r){return nv(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function XV(e){var t,r;return ke(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function rm(e){return new O3e(e)}var O3e=function(){function e(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return e.prototype.perform=function(t){var r=this._upstream,n=t&&t.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(_){return!(_>=1)&&(_=1),_}var f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=u;var h=t&&t.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,v=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d1&&n>0?s:o}};return a;function o(){return t=e?null:lt},gte:function(e,t){return e>=t}},D3e=function(){function e(t,r){if(!ot(r)){var n="";mt(n)}this._opFn=UQ[t],this._rvalFloat=$o(r)}return e.prototype.evaluate=function(t){return ot(t)?this._opFn(t,this._rvalFloat):this._opFn($o(t),this._rvalFloat)},e}(),ZQ=function(){function e(t,r){var n=t==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return e.prototype.evaluate=function(t,r){var n=ot(t)?t:$o(t),i=ot(r)?r:$o(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=pe(t),l=pe(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),N3e=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=$o(r)}return e.prototype.evaluate=function(t){var r=t===this._rval;if(!r){var n=typeof t;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(r=$o(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function j3e(e,t){return e==="eq"||e==="ne"?new N3e(e==="eq",t):xe(UQ,e)?new D3e(e,t):null}var R3e=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(t){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(t){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(t,r){},e.prototype.retrieveValueFromItem=function(t,r){},e.prototype.convertValue=function(t,r){return Jl(t,r)},e}();function B3e(e,t){var r=new R3e,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==Ha&&mt(o);var s=[],l={},u=e.dimensionsDefine;if(u)B(u,function(g,m){var y=g.name,_={index:m,name:y,displayName:g.displayName};if(s.push(_),y!=null){var b="";xe(l,y)&&mt(b),l[y]=_}});else for(var c=0;c65535?U3e:Z3e}function lh(){return[1/0,-1/0]}function Y3e(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function JV(e,t,r,n,i){var a=qQ[r||"float"];if(i){var o=e[t],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;um[1]&&(m[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},e.prototype._initDataFromProvider=function(t,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=se(o,function(_){return _.property}),c=0;cy[1]&&(y[1]=m)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(t,r){if(!(r>=0&&r=0&&r=this._rawCount||t<0)return-1;if(!this._indices)return t;var r=this._indices,n=r[t];if(n!=null&&nt)a=o-1;else return o}return-1},e.prototype.getIndices=function(){var t,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){t=new n(i);for(var a=0;a=f&&_<=h||isNaN(_))&&(l[u++]=g),g++}v=!0}else if(a===2){for(var m=d[i[0]],b=d[i[1]],S=t[i[1]][0],T=t[i[1]][1],y=0;y=f&&_<=h||isNaN(_))&&(C>=S&&C<=T||isNaN(C))&&(l[u++]=g),g++}v=!0}}if(!v)if(a===1)for(var y=0;y=f&&_<=h||isNaN(_))&&(l[u++]=A)}else for(var y=0;yt[k][1])&&(P=!1)}P&&(l[u++]=r.getRawIndex(y))}return uy[1]&&(y[1]=m)}}}},e.prototype.lttbDownSample=function(t,r){var n=this.clone([t],!0),i=n._chunks,a=i[t],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),c,f,h,d=new(sh(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var v=1;vc&&(c=f,h=S)}E>0&&Es&&(g=s-c);for(var m=0;mv&&(v=_,d=c+m)}var b=this.getRawIndex(f),S=this.getRawIndex(d);fc-v&&(l=c-v,s.length=l);for(var g=0;gf[1]&&(f[1]=y),h[d++]=_}return a._count=d,a._indices=h,a._updateGetRawIdx(),a},e.prototype.each=function(t,r){if(this._count)for(var n=t.length,i=this._chunks,a=0,o=this.count();al&&(l=f)}return o=[s,l],this._extent[t]=o,o},e.prototype.getRawDataItem=function(t){var r=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[t]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function t(r,n,i,a){return Jl(r[a],this._dimensions[a])}N2={arrayRows:t,objectRows:function(r,n,i,a){return Jl(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return Jl(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),KQ=function(){function e(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(t,r){this._sourceList=t,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(Xx(t)){var o=t,s=void 0,l=void 0,u=void 0;if(n){var c=r[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=Un(s)?Kl:Ni,a=[];var f=this._getSourceMetaRawOption()||{},h=u&&u.metaRawOption||{},d=be(f.seriesLayoutBy,h.seriesLayoutBy)||null,v=be(f.sourceHeader,h.sourceHeader),g=be(f.dimensions,h.dimensions),m=d!==h.seriesLayoutBy||!!v!=!!h.sourceHeader||g;i=m?[OI(s,{seriesLayoutBy:d,sourceHeader:v,dimensions:g},l)]:[]}else{var y=t;if(n){var _=this._applyTransform(r);i=_.sourceList,a=_.upstreamSignList}else{var b=y.get("source",!0);i=[OI(b,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},e.prototype._applyTransform=function(t){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";t.length!==1&&e6(a)}var o,s=[],l=[];return B(t,function(u){u.prepareSource();var c=u.getSource(i||0),f="";i!=null&&!c&&e6(f),s.push(c),l.push(u._getVersionSign())}),n?o=W3e(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[C3e(s[0])]),{sourceList:o,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),r=0;r0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},e.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,r){if(!this._disposed)return this.handler.findHover(t,r)},e.prototype.on=function(t,r,n){return this._disposed||this.handler.on(t,r,n),this},e.prototype.off=function(t,r){this._disposed||this.handler.off(t,r)},e.prototype.trigger=function(t,r){this._disposed||this.handler.trigger(t,r)},e.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),r=0;r0){if(e<=i)return o;if(e>=a)return s}else{if(e>=i)return o;if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/l*u+o}var ve=cRe;function cRe(e,t,r){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%";break}return vw(e,t,r)}function vw(e,t,r){return pe(e)?uRe(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function gr(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),fJ),e=(+e).toFixed(t),r?e:+e}function Ai(e){return e.sort(function(t,r){return t-r}),e}function za(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,r=0;r<15;r++,t*=10)if(Math.round(e*t)/t===e)return r}return hJ(e)}function hJ(e){var t=e.toString().toLowerCase(),r=t.indexOf("e"),n=r>0?+t.slice(r+1):0,i=r>0?r:t.length,a=t.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function wN(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(To(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function fRe(e,t,r){if(!e[t])return 0;var n=dJ(e,r);return n[t]||0}function dJ(e,t){var r=da(e,function(d,v){return d+(isNaN(v)?0:v)},0);if(r===0)return[];for(var n=Math.pow(10,t),i=se(e,function(d){return(isNaN(d)?0:d)/r*n*100}),a=n*100,o=se(i,function(d){return Math.floor(d)}),s=da(o,function(d,v){return d+v},0),l=se(i,function(d,v){return d-o[v]});su&&(u=l[f],c=f);++o[c],l[c]=0,++s}return se(o,function(d){return d/n})}function hRe(e,t){var r=Math.max(za(e),za(t)),n=e+t;return r>fJ?n:gr(n,r)}var vI=9007199254740991;function SN(e){var t=Math.PI*2;return(e%t+t)%t}function Qd(e){return e>-VF&&e=10&&t++,t}function TN(e,t){var r=ET(e),n=Math.pow(10,r),i=e/n,a;return t?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,e=a*n,r>=-20?+e.toFixed(r<0?-r:0):e}function ub(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),i=+e[n-1],a=r-n;return a?i+a*(e[n]-i):i}function pI(e){e.sort(function(l,u){return s(l,u,0)?-1:1});for(var t=-1/0,r=1,n=0;n0?t.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx=this._end)?(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0):!1},e}();function d2(e){e.option=e.parentModel=e.ecModel=null}var ORe=".",Vu="___EC__COMPONENT__CONTAINER___",TJ="___EC__EXTENDED_CLASS___";function Co(e){var t={main:"",sub:""};if(e){var r=e.split(ORe);t.main=r[0]||"",t.sub=r[1]||""}return t}function ERe(e){xn(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function DRe(e){return!!(e&&e[TJ])}function PN(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return NRe(n)?i=function(a){q(o,a);function o(){return a.apply(this,arguments)||this}return o}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},vN(i,this)),ie(i.prototype,r),i[TJ]=!0,i.extend=this.extend,i.superCall=BRe,i.superApply=zRe,i.superClass=n,i}}function NRe(e){return Ce(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function CJ(e,t){e.extend=t.extend}var jRe=Math.round(Math.random()*10);function RRe(e){var t=["__\0is_clz",jRe++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function BRe(e,t){for(var r=[],n=2;n=0||a&&We(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var $Re=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],FRe=hf($Re),VRe=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return FRe(this,t,r)},e}(),mI=new Kd(50);function GRe(e){if(typeof e=="string"){var t=mI.get(e);return t&&t.image}else return e}function kN(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=mI.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!NT(t)&&a.pending.push(o)):(t=ui.loadImage(e,UF,UF),t.__zrImageSrc=e,mI.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function UF(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var c=jo(o,r);return c>l&&(r="",c=0),l=e-c,i.ellipsis=r,i.ellipsisWidth=c,i.contentWidth=l,i.containerWidth=e,i}function PJ(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=jo(a,t);if(o<=n){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){t+=r.ellipsis;break}var l=s===0?HRe(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=jo(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function HRe(e,t,r){for(var n=0,i=0,a=e.length;im&&d){var b=Math.floor(m/h);v=v||x.length>b,x=x.slice(0,b),_=x.length*h}if(i&&c&&g!=null)for(var S=MJ(g,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},C=0;Cv&&p2(a,o.substring(v,m),t,d),p2(a,g[2],t,d,g[1]),v=v2.lastIndex}vf){var U=a.lines.length;D>0?(I.tokens=I.tokens.slice(0,D),A(I,E,k),a.lines=a.lines.slice(0,P+1)):a.lines=a.lines.slice(0,P),a.isTruncated=a.isTruncated||a.lines.length0&&v+n.accumWidth>n.width&&(c=t.split(` +`),u=!0),n.accumWidth=v}else{var g=kJ(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=g.accumWidth+d,f=g.linesWidths,c=g.lines}}c||(c=t.split(` +`));for(var m=No(l),x=0;x=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var KRe=da(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function JRe(e){return qRe(e)?!!KRe[e]:!0}function kJ(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,f=No(t),h=0;hr:i+c+v>r){c?(s||l)&&(g?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=d,u+=v,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=d,c=v)):g?(a.push(l),o.push(u),l=d,u=v):(a.push(d),o.push(v));continue}c+=v,g?(l+=d,u+=v):(l&&(s+=l,l="",u=0),s+=d)}return l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=i),{accumWidth:c,lines:a,linesWidths:o}}function YF(e,t,r,n,i,a){if(e.baseX=r,e.baseY=n,e.outerWidth=e.outerHeight=null,!!t){var o=t.width*2,s=t.height*2;Oe.set(XF,Jd(r,o,i),Wc(n,s,a),o,s),Oe.intersect(t,XF,null,qF);var l=qF.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=Jd(l.x,l.width,i,!0),e.baseY=Wc(l.y,l.height,a,!0)}}var XF=new Oe(0,0,0,0),qF={outIntersectRect:{},clamp:!0};function LN(e){return e!=null?e+="":e=""}function QRe(e){var t=LN(e.text),r=e.font,n=jo(No(r),t),i=h0(r);return yI(e,n,i,null)}function yI(e,t,r,n){var i=new Oe(Jd(e.x||0,t,e.textAlign),Wc(e.y||0,r,e.textBaseline),t,r),a=n??(LJ(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function LJ(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var xI="__zr_style_"+Math.round(Math.random()*10),Hc={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},jT={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Hc[xI]=!0;var KF=["z","z2","invisible"],e5e=["invisible"],pa=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=it(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(zx[0]=x2(i)*r+e,zx[1]=y2(i)*n+t,$x[0]=x2(a)*r+e,$x[1]=y2(a)*n+t,u(s,zx,$x),c(l,zx,$x),i=i%Gu,i<0&&(i=i+Gu),a=a%Gu,a<0&&(a=a+Gu),i>a&&!o?a+=Gu:ii&&(Fx[0]=x2(d)*r+e,Fx[1]=y2(d)*n+t,u(s,Fx,s),c(l,Fx,l))}var It={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Wu=[],Hu=[],oo=[],al=[],so=[],lo=[],_2=Math.min,b2=Math.max,Uu=Math.cos,Zu=Math.sin,is=Math.abs,_I=Math.PI,gl=_I*2,w2=typeof Float32Array<"u",Bp=[];function S2(e){var t=Math.round(e/_I*1e8)/1e8;return t%2*_I}function BT(e,t){var r=S2(e[0]);r<0&&(r+=gl);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=gl?i=r+gl:t&&r-i>=gl?i=r-gl:!t&&r>i?i=r+(gl-S2(r-i)):t&&r0&&(this._ux=is(n/fw/t)||0,this._uy=is(n/fw/r)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,r){return this._drawPendingPt(),this.addData(It.M,t,r),this._ctx&&this._ctx.moveTo(t,r),this._x0=t,this._y0=r,this._xi=t,this._yi=r,this},e.prototype.lineTo=function(t,r){var n=is(t-this._xi),i=is(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(It.L,t,r),this._ctx&&a&&this._ctx.lineTo(t,r),a)this._xi=t,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=r,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){return this._drawPendingPt(),this.addData(It.C,t,r,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(t,r,n,i,a,o),this._xi=a,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,r,n,i){return this._drawPendingPt(),this.addData(It.Q,t,r,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,r,n,i),this._xi=n,this._yi=i,this},e.prototype.arc=function(t,r,n,i,a,o){this._drawPendingPt(),Bp[0]=i,Bp[1]=a,BT(Bp,o),i=Bp[0],a=Bp[1];var s=a-i;return this.addData(It.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=Uu(a)*n+t,this._yi=Zu(a)*n+r,this},e.prototype.arcTo=function(t,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,r,n,i,a),this},e.prototype.rect=function(t,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,r,n,i),this.addData(It.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(It.Z);var t=this._ctx,r=this._x0,n=this._y0;return t&&t.closePath(),this._xi=r,this._yi=n,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){if(this._saveData){var r=t.length;!(this.data&&this.data.length===r)&&w2&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sc.length&&(this._expandData(),c=this.data);for(var f=0;f0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],r=0;r11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){oo[0]=oo[1]=so[0]=so[1]=Number.MAX_VALUE,al[0]=al[1]=lo[0]=lo[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||is(b)>i||h===r-1)&&(g=Math.sqrt(_*_+b*b),a=m,o=x);break}case It.C:{var S=t[h++],T=t[h++],m=t[h++],x=t[h++],C=t[h++],A=t[h++];g=vje(a,o,S,T,m,x,C,A,10),a=C,o=A;break}case It.Q:{var S=t[h++],T=t[h++],m=t[h++],x=t[h++];g=gje(a,o,S,T,m,x,10),a=m,o=x;break}case It.A:var P=t[h++],I=t[h++],k=t[h++],E=t[h++],D=t[h++],N=t[h++],z=N+D;h+=1,v&&(s=Uu(D)*k+P,l=Zu(D)*E+I),g=b2(k,E)*_2(gl,Math.abs(N)),a=Uu(z)*k+P,o=Zu(z)*E+I;break;case It.R:{s=a=t[h++],l=o=t[h++];var F=t[h++],$=t[h++];g=F*2+$*2;break}case It.Z:{var _=s-a,b=l-o;g=Math.sqrt(_*_+b*b),a=s,o=l;break}}g>=0&&(u[f++]=g,c+=g)}return this._pathLen=c,c},e.prototype.rebuildPath=function(t,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,c,f,h,d=r<1,v,g,m=0,x=0,_,b=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,g=this._pathLen,_=r*g,!_)))e:for(var C=0;C0&&(t.lineTo(S,T),b=0),A){case It.M:s=u=n[C++],l=c=n[C++],t.moveTo(u,c);break;case It.L:{f=n[C++],h=n[C++];var I=is(f-u),k=is(h-c);if(I>i||k>a){if(d){var E=v[x++];if(m+E>_){var D=(_-m)/E;t.lineTo(u*(1-D)+f*D,c*(1-D)+h*D);break e}m+=E}t.lineTo(f,h),u=f,c=h,b=0}else{var N=I*I+k*k;N>b&&(S=f,T=h,b=N)}break}case It.C:{var z=n[C++],F=n[C++],$=n[C++],Z=n[C++],j=n[C++],U=n[C++];if(d){var E=v[x++];if(m+E>_){var D=(_-m)/E;uu(u,z,$,j,D,Wu),uu(c,F,Z,U,D,Hu),t.bezierCurveTo(Wu[1],Hu[1],Wu[2],Hu[2],Wu[3],Hu[3]);break e}m+=E}t.bezierCurveTo(z,F,$,Z,j,U),u=j,c=U;break}case It.Q:{var z=n[C++],F=n[C++],$=n[C++],Z=n[C++];if(d){var E=v[x++];if(m+E>_){var D=(_-m)/E;py(u,z,$,D,Wu),py(c,F,Z,D,Hu),t.quadraticCurveTo(Wu[1],Hu[1],Wu[2],Hu[2]);break e}m+=E}t.quadraticCurveTo(z,F,$,Z),u=$,c=Z;break}case It.A:var G=n[C++],V=n[C++],Y=n[C++],K=n[C++],ee=n[C++],le=n[C++],he=n[C++],Re=!n[C++],ge=Y>K?Y:K,ne=is(Y-K)>.001,fe=ee+le,ue=!1;if(d){var E=v[x++];m+E>_&&(fe=ee+le*(_-m)/E,ue=!0),m+=E}if(ne&&t.ellipse?t.ellipse(G,V,Y,K,he,ee,fe,Re):t.arc(G,V,ge,ee,fe,Re),ue)break e;P&&(s=Uu(ee)*Y+G,l=Zu(ee)*K+V),u=Uu(fe)*Y+G,c=Zu(fe)*K+V;break;case It.R:s=u=n[C],l=c=n[C+1],f=n[C++],h=n[C++];var te=n[C++],Ve=n[C++];if(d){var E=v[x++];if(m+E>_){var Se=_-m;t.moveTo(f,h),t.lineTo(f+_2(Se,te),h),Se-=te,Se>0&&t.lineTo(f+te,h+_2(Se,Ve)),Se-=Ve,Se>0&&t.lineTo(f+b2(te-Se,0),h+Ve),Se-=te,Se>0&&t.lineTo(f,h+b2(Ve-Se,0));break e}m+=E}t.rect(f,h,te,Ve);break;case It.Z:if(d){var E=v[x++];if(m+E>_){var D=(_-m)/E;t.lineTo(u*(1-D)+s*D,c*(1-D)+l*D);break e}m+=E}t.closePath(),u=s,c=l}}},e.prototype.clone=function(){var t=new e,r=this.data;return t.data=r.slice?r.slice():Array.prototype.slice.call(r),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=It,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function bl(e,t,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=e;if(o>t+s&&o>n+s||oe+s&&a>r+s||at+f&&c>n+f&&c>a+f&&c>s+f||ce+f&&u>r+f&&u>i+f&&u>o+f||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||c+ui&&(i+=zp);var h=Math.atan2(l,s);return h<0&&(h+=zp),h>=n&&h<=i||h+zp>=n&&h+zp<=i}function hs(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var ol=Wo.CMD,Yu=Math.PI*2,s5e=1e-4;function l5e(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&u5e(),d=$r(t,n,a,s,Xi[0]),h>1&&(v=$r(t,n,a,s,Xi[1]))),h===2?mt&&s>n&&s>a||s=0&&u<=1){for(var c=0,f=tn(t,n,a,u),h=0;hr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);zn[0]=-l,zn[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=Yu-1e-4){n=0,i=Yu;var c=a?1:-1;return o>=zn[0]+e&&o<=zn[1]+e?c:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=Yu,i+=Yu);for(var h=0,d=0;d<2;d++){var v=zn[d];if(v+e>o){var g=Math.atan2(s,v),c=a?1:-1;g<0&&(g=Yu+g),(g>=n&&g<=i||g+Yu>=n&&g+Yu<=i)&&(g>Math.PI/2&&g1&&(r||(s+=hs(l,u,c,f,n,i))),m&&(l=a[v],u=a[v+1],c=l,f=u),g){case ol.M:c=a[v++],f=a[v++],l=c,u=f;break;case ol.L:if(r){if(bl(l,u,a[v],a[v+1],t,n,i))return!0}else s+=hs(l,u,a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case ol.C:if(r){if(a5e(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=c5e(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case ol.Q:if(r){if(IJ(l,u,a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=f5e(l,u,a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case ol.A:var x=a[v++],_=a[v++],b=a[v++],S=a[v++],T=a[v++],C=a[v++];v+=1;var A=!!(1-a[v++]);h=Math.cos(T)*b+x,d=Math.sin(T)*S+_,m?(c=h,f=d):s+=hs(l,u,h,d,n,i);var P=(n-x)*S/b+x;if(r){if(o5e(x,_,S,T,T+C,A,t,P,i))return!0}else s+=h5e(x,_,S,T,T+C,A,P,i);l=Math.cos(T+C)*b+x,u=Math.sin(T+C)*S+_;break;case ol.R:c=l=a[v++],f=u=a[v++];var I=a[v++],k=a[v++];if(h=c+I,d=f+k,r){if(bl(c,f,h,f,t,n,i)||bl(h,f,h,d,t,n,i)||bl(h,d,c,d,t,n,i)||bl(c,d,c,f,t,n,i))return!0}else s+=hs(h,f,h,d,n,i),s+=hs(c,d,c,f,n,i);break;case ol.Z:if(r){if(bl(l,u,c,f,t,n,i))return!0}else s+=hs(l,u,c,f,n,i);l=c,u=f;break}}return!r&&!l5e(u,f)&&(s+=hs(l,u,c,f,n,i)||0),s!==0}function d5e(e,t,r){return OJ(e,0,!1,t,r)}function v5e(e,t,r,n){return OJ(e,t,!0,r,n)}var pw=Pe({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Hc),p5e={style:Pe({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},jT.style)},T2=Vo.concat(["invisible","culling","z","z2","zlevel","parent"]),tt=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.update=function(){var r=this;e.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?cI:n>.2?Zje:fI}else if(r)return fI}return cI},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(pe(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=yy(r,0)0))},t.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},t.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Mh)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),v5e(s,l/u,r,n)))return!0}if(this.hasFill())return d5e(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Mh,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(r){return this.animate("shape",r)},t.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):e.prototype.attrKV.call(this,r,n)},t.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:ie(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Mh)},t.prototype.createStyle=function(r){return u0(pw,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=ie({},this.shape))},t.prototype._applyStateObj=function(r,n,i,a,o,s){e.prototype._applyStateObj.call(this,r,n,i,a,o,s);var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=ie({},i.shape),ie(u,n.shape)):(u=ie({},a?this.shape:i.shape),ie(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=ie({},this.shape);for(var c={},f=it(u),h=0;hi&&(f=s+l,s*=i/f,l*=i/f),u+c>i&&(f=u+c,u*=i/f,c*=i/f),l+u>a&&(f=l+u,l*=a/f,u*=a/f),s+c>a&&(f=s+c,s*=a/f,c*=a/f),e.moveTo(r+s,n),e.lineTo(r+i-l,n),l!==0&&e.arc(r+i-l,n+l,l,-Math.PI/2,0),e.lineTo(r+i,n+a-u),u!==0&&e.arc(r+i-u,n+a-u,u,0,Math.PI/2),e.lineTo(r+c,n+a),c!==0&&e.arc(r+c,n+a-c,c,Math.PI/2,Math.PI),e.lineTo(r,n+s),s!==0&&e.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var Yh=Math.round;function zT(e,t,r){if(t){var n=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=n,e.x2=i,e.y1=a,e.y2=o;var s=r&&r.lineWidth;return s&&(Yh(n*2)===Yh(i*2)&&(e.x1=e.x2=Pi(n,s,!0)),Yh(a*2)===Yh(o*2)&&(e.y1=e.y2=Pi(a,s,!0))),e}}function EJ(e,t,r){if(t){var n=t.x,i=t.y,a=t.width,o=t.height;e.x=n,e.y=i,e.width=a,e.height=o;var s=r&&r.lineWidth;return s&&(e.x=Pi(n,s,!0),e.y=Pi(i,s,!0),e.width=Math.max(Pi(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Pi(i+o,s,!1)-e.y,o===0?0:1)),e}}function Pi(e,t,r){if(!t)return e;var n=Yh(e*2);return(n+Yh(t))%2===0?n/2:(n+(r?1:-1))/2}var b5e=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),w5e={},Xe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new b5e},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=EJ(w5e,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?_5e(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(tt);Xe.prototype.type="rect";var rV={fill:"#000"},nV=2,uo={},S5e={style:Pe({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},jT.style)},at=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=rV,n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,D=0;D=0&&(z=C[N],z.align==="right");)this._placeToken(z,r,P,x,D,"right",b),I-=z.width,D-=z.width,N--;for(E+=(c-(E-m)-(_-D)-I)/2;k<=N;)z=C[k],this._placeToken(z,r,P,x,E+z.width/2,"center",b),E+=z.width,k++;x+=P}},t.prototype._placeToken=function(r,n,i,a,o,s,l){var u=n.rich[r.styleName]||{};u.text=r.text;var c=r.verticalAlign,f=a+i/2;c==="top"?f=a+r.height/2:c==="bottom"&&(f=a+i-r.height/2);var h=!r.isLineHolder&&C2(u);h&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var d=!!u.backgroundColor,v=r.textPadding;v&&(o=uV(o,s,v),f-=r.height/2-v[0]-r.innerHeight/2);var g=this._getOrCreateChild(ev),m=g.createStyle();g.useStyle(m);var x=this._defaultStyle,_=!1,b=0,S=!1,T=lV("fill"in u?u.fill:"fill"in n?n.fill:(_=!0,x.fill)),C=sV("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!x.autoStroke||_)?(b=nV,S=!0,x.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;m.text=r.text,m.x=o,m.y=f,A&&(m.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,m.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",m.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,m.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),m.textAlign=s,m.textBaseline="middle",m.font=r.font||Fs,m.opacity=li(u.opacity,n.opacity,1),aV(m,u),C&&(m.lineWidth=li(u.lineWidth,n.lineWidth,b),m.lineDash=be(u.lineDash,n.lineDash),m.lineDashOffset=n.lineDashOffset||0,m.stroke=C),T&&(m.fill=T),g.setBoundingRect(yI(m,r.contentWidth,r.contentHeight,S?0:null))},t.prototype._renderBackground=function(r,n,i,a,o,s){var l=r.backgroundColor,u=r.borderWidth,c=r.borderColor,f=l&&l.image,h=l&&!f,d=r.borderRadius,v=this,g,m;if(h||r.lineHeight||u&&c){g=this._getOrCreateChild(Xe),g.useStyle(g.createStyle()),g.style.fill=null;var x=g.shape;x.x=i,x.y=a,x.width=o,x.height=s,x.r=d,g.dirtyShape()}if(h){var _=g.style;_.fill=l||null,_.fillOpacity=be(r.fillOpacity,1)}else if(f){m=this._getOrCreateChild(Yr),m.onload=function(){v.dirtyStyle()};var b=m.style;b.image=l.image,b.x=i,b.y=a,b.width=o,b.height=s}if(u&&c){var _=g.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=be(r.strokeOpacity,1),_.lineDash=r.borderDash,_.lineDashOffset=r.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var S=(g||m).style;S.shadowBlur=r.shadowBlur||0,S.shadowColor=r.shadowColor||"transparent",S.shadowOffsetX=r.shadowOffsetX||0,S.shadowOffsetY=r.shadowOffsetY||0,S.opacity=li(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return NJ(r)&&(n=[r.fontStyle,r.fontWeight,DJ(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Ci(n)||r.textFont||r.font},t}(pa),T5e={left:!0,right:1,center:1},C5e={top:1,bottom:1,middle:1},iV=["fontStyle","fontWeight","fontSize","fontFamily"];function DJ(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?cN+"px":e+"px"}function aV(e,t){for(var r=0;r=0,a=!1;if(e instanceof tt){var o=jJ(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(nh(s)||nh(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=ie({},n),u=ie({},u),u.fill=s):!nh(u.fill)&&nh(s)?(a=!0,n=ie({},n),u=ie({},u),u.fill=uw(s)):!nh(u.stroke)&&nh(l)&&(a||(n=ie({},n),u=ie({},u)),u.stroke=uw(l)),n.style=u}}if(n&&n.z2==null){a||(n=ie({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??$v)}return n}function O5e(e,t,r){if(r&&r.z2==null){r=ie({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??M5e)}return r}function E5e(e,t,r){var n=We(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:L5e(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=ie({},r),o=ie({opacity:n?i:a.opacity*.1},o),r.style=o),r}function A2(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return I5e(this,e,t,r);if(e==="blur")return E5e(this,e,r);if(e==="select")return O5e(this,e,r)}return r}function df(e){e.stateProxy=A2;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=A2),r&&(r.stateProxy=A2)}function vV(e,t){!GJ(e,t)&&!e.__highByOuter&&el(e,RJ)}function pV(e,t){!GJ(e,t)&&!e.__highByOuter&&el(e,BJ)}function Gs(e,t){e.__highByOuter|=1<<(t||0),el(e,RJ)}function Ws(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&el(e,BJ)}function $J(e){el(e,DN)}function NN(e){el(e,zJ)}function FJ(e){el(e,P5e)}function VJ(e){el(e,k5e)}function GJ(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function WJ(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=IN(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){zJ(u)}),s&&r.push(a)),o.isBlured=!1}),B(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function SI(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,c){for(var f=0;f0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function Kl(e,t,r){Dc(e,!0),el(e,df),CI(e,t,r)}function z5e(e){Dc(e,!1)}function Gt(e,t,r,n){n?z5e(e):Kl(e,t,r)}function CI(e,t,r){var n=De(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var mV=["emphasis","blur","select"],$5e={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Dr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=M2(v),s*=M2(v));var g=(i===a?-1:1)*M2((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,m=g*o*d/s,x=g*-s*h/o,_=(e+r)/2+Gx(f)*m-Vx(f)*x,b=(t+n)/2+Vx(f)*m+Gx(f)*x,S=bV([1,0],[(h-m)/o,(d-x)/s]),T=[(h-m)/o,(d-x)/s],C=[(-1*h-m)/o,(-1*d-x)/s],A=bV(T,C);if(MI(T,C)<=-1&&(A=$p),MI(T,C)>=1&&(A=0),A<0){var P=Math.round(A/$p*1e6)/1e6;A=$p*2+P%2*$p}c.addData(u,_,b,o,s,S,A,f,a)}var U5e=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Z5e=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Y5e(e){var t=new Wo;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=Wo.CMD,l=e.match(U5e);if(!l)return t;for(var u=0;uz*z+F*F&&(P=k,I=E),{cx:P,cy:I,x0:-c,y0:-f,x1:P*(i/T-1),y1:I*(i/T-1)}}function t3e(e){var t;if(ae(e)){var r=e.length;if(!r)return e;r===1?t=[e[0],e[0],0,0]:r===2?t=[e[0],e[0],e[1],e[1]]:r===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function r3e(e,t){var r,n=wg(t.r,0),i=wg(t.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var c=t.cx,f=t.cy,h=!!t.clockwise,d=SV(u-l),v=d>P2&&d%P2;if(v>Pa&&(d=v),!(n>Pa))e.moveTo(c,f);else if(d>P2-Pa)e.moveTo(c+n*ah(l),f+n*Xu(l)),e.arc(c,f,n,l,u,!h),i>Pa&&(e.moveTo(c+i*ah(u),f+i*Xu(u)),e.arc(c,f,i,u,l,h));else{var g=void 0,m=void 0,x=void 0,_=void 0,b=void 0,S=void 0,T=void 0,C=void 0,A=void 0,P=void 0,I=void 0,k=void 0,E=void 0,D=void 0,N=void 0,z=void 0,F=n*ah(l),$=n*Xu(l),Z=i*ah(u),j=i*Xu(u),U=d>Pa;if(U){var G=t.cornerRadius;G&&(r=t3e(G),g=r[0],m=r[1],x=r[2],_=r[3]);var V=SV(n-i)/2;if(b=co(V,x),S=co(V,_),T=co(V,g),C=co(V,m),I=A=wg(b,S),k=P=wg(T,C),(A>Pa||P>Pa)&&(E=n*ah(u),D=n*Xu(u),N=i*ah(l),z=i*Xu(l),dPa){var ne=co(x,I),fe=co(_,I),ue=Wx(N,z,F,$,n,ne,h),te=Wx(E,D,Z,j,n,fe,h);e.moveTo(c+ue.cx+ue.x0,f+ue.cy+ue.y0),I0&&e.arc(c+ue.cx,f+ue.cy,ne,Tn(ue.y0,ue.x0),Tn(ue.y1,ue.x1),!h),e.arc(c,f,n,Tn(ue.cy+ue.y1,ue.cx+ue.x1),Tn(te.cy+te.y1,te.cx+te.x1),!h),fe>0&&e.arc(c+te.cx,f+te.cy,fe,Tn(te.y1,te.x1),Tn(te.y0,te.x0),!h))}else e.moveTo(c+F,f+$),e.arc(c,f,n,l,u,!h);if(!(i>Pa)||!U)e.lineTo(c+Z,f+j);else if(k>Pa){var ne=co(g,k),fe=co(m,k),ue=Wx(Z,j,E,D,i,-fe,h),te=Wx(F,$,N,z,i,-ne,h);e.lineTo(c+ue.cx+ue.x0,f+ue.cy+ue.y0),k0&&e.arc(c+ue.cx,f+ue.cy,fe,Tn(ue.y0,ue.x0),Tn(ue.y1,ue.x1),!h),e.arc(c,f,i,Tn(ue.cy+ue.y1,ue.cx+ue.x1),Tn(te.cy+te.y1,te.cx+te.x1),h),ne>0&&e.arc(c+te.cx,f+te.cy,ne,Tn(te.y1,te.x1),Tn(te.y0,te.x0),!h))}else e.lineTo(c+Z,f+j),e.arc(c,f,i,u,l,h)}e.closePath()}}}var n3e=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),_n=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new n3e},t.prototype.buildPath=function(r,n){r3e(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(tt);_n.prototype.type="sector";var i3e=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),Fv=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new i3e},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,o,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,o,!0)},t}(tt);Fv.prototype.type="ring";function a3e(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,c,f;if(n){c=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=e.length;h=2){if(n){var a=a3e(i,n,r,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=i[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,f=i.length;sKu[1]){if(a=!1,Jr.negativeSize||n)return a;var l=Hx(Ku[0]-qu[1]),u=Hx(qu[0]-Ku[1]);k2(l,u)>Zx.len()&&(l=u||!Jr.bidirectional)&&(Ie.scale(Ux,s,-u*i),Jr.useDir&&Jr.calcDirMTV()))}}return a},e.prototype._getProjMinMaxOnAxis=function(t,r,n){for(var i=this._axes[t],a=this._origin,o=r[0].dot(i)+a[t],s=o,l=o,u=1;u0){var f=c.duration,h=c.delay,d=c.easing,v={duration:f,delay:h||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,v):t.animateTo(r,v)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function lt(e,t,r,n,i,a){zN("update",e,t,r,n,i,a)}function Dt(e,t,r,n,i,a){zN("enter",e,t,r,n,i,a)}function vd(e){if(!e.__zr)return!0;for(var t=0;tTo(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function AV(e){return!e.isGroup}function m3e(e){return e.shape!=null}function m0(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){AV(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return m3e(o)&&(s.shape=Ae(o.shape)),s}var a=n(e);t.traverse(function(o){if(AV(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),lt(o,l,r,De(o).dataIndex)}}})}function VN(e,t){return se(e,function(r){var n=r[0];n=pr(n,t.x),n=Li(n,t.x+t.width);var i=r[1];return i=pr(i,t.y),i=Li(i,t.y+t.height),[n,i]})}function aQ(e,t){var r=pr(e.x,t.x),n=Li(e.x+e.width,t.x+t.width),i=pr(e.y,t.y),a=Li(e.y+e.height,t.y+t.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function Wv(e,t,r){var n=ie({rectHover:!0},t),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},e)return e.indexOf("image://")===0?(i.image=e.slice(8),Pe(i,r),new Yr(n)):tv(e.replace("path://",""),n,r,"center")}function Sg(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var m=L2(d,v,c,f)/h;return!(m<0||m>1)}function L2(e,t,r,n){return e*n-r*t}function y3e(e){return e<=1e-6&&e>=-1e-6}function vf(e,t,r,n,i){return t==null||(ot(t)?Ht[0]=Ht[1]=Ht[2]=Ht[3]=t:(Ht[0]=t[0],Ht[1]=t[1],Ht[2]=t[2],Ht[3]=t[3]),n&&(Ht[0]=pr(0,Ht[0]),Ht[1]=pr(0,Ht[1]),Ht[2]=pr(0,Ht[2]),Ht[3]=pr(0,Ht[3])),r&&(Ht[0]=-Ht[0],Ht[1]=-Ht[1],Ht[2]=-Ht[2],Ht[3]=-Ht[3]),MV(e,Ht,"x","width",3,1,i&&i[0]||0),MV(e,Ht,"y","height",0,2,i&&i[1]||0)),e}var Ht=[0,0,0,0];function MV(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=pr(0,Li(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:To(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function tl(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=pe(t)?{formatter:t}:t,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=e.formatterParamsExtra;l&&B(it(l),function(c){xe(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=De(e.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Pe({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function kI(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function Au(e,t){if(e)if(ae(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function GT(e,t,r){lQ(e,t,r,-1/0)}function lQ(e,t,r,n){if(e.ignoreModelZ)return n;var i=e.getTextContent(),a=e.getTextGuideLine(),o=e.isGroup;if(o)for(var s=e.childrenRef(),l=0;l=0&&s.push(l)}),s}}function Mu(e,t){return He(He({},e,!0),t,!0)}const L3e={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},I3e={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var _w="ZH",UN="EN",pd=UN,hb={},ZN={},vQ=nt.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||pd).toUpperCase();return e.indexOf(_w)>-1?_w:pd}():pd;function YN(e,t){e=e.toUpperCase(),ZN[e]=new et(t),hb[e]=t}function O3e(e){if(pe(e)){var t=hb[e.toUpperCase()]||{};return e===_w||e===UN?Ae(t):He(Ae(t),Ae(hb[pd]),!1)}else return He(Ae(e),Ae(hb[pd]),!1)}function II(e){return ZN[e]}function E3e(){return ZN[pd]}YN(UN,L3e);YN(_w,I3e);var OI=null;function D3e(e){OI||(OI=e)}function Sr(){return OI}var XN=1e3,qN=XN*60,rm=qN*60,ta=rm*24,OV=ta*365,N3e={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},db={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},j3e="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",Xx="{yyyy}-{MM}-{dd}",EV={year:"{yyyy}",month:"{yyyy}-{MM}",day:Xx,hour:Xx+" "+db.hour,minute:Xx+" "+db.minute,second:Xx+" "+db.second,millisecond:j3e},xi=["year","month","day","hour","minute","second","millisecond"],R3e=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function B3e(e){return!pe(e)&&!Ce(e)?z3e(e):e}function z3e(e){e=e||{};var t={},r=!0;return B(xi,function(n){r&&(r=e[n]==null)}),B(xi,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=xi[s],u=ke(a)&&!ae(a)?a[l]:a,c=void 0;ae(u)?(c=u.slice(),o=c[0]||""):pe(u)?(o=u,c=[o]):(o==null?o=db[n]:N3e[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function $n(e,t){return e+="","0000".substr(0,t-e.length)+e}function nm(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function $3e(e){return e===nm(e)}function F3e(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function y0(e,t,r,n){var i=qo(e),a=i[pQ(r)](),o=i[KN(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[JN(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[QN(r)](),f=(c-1)%12+1,h=i[ej(r)](),d=i[tj(r)](),v=i[rj(r)](),g=c>=12?"pm":"am",m=g.toUpperCase(),x=n instanceof et?n:II(n||vQ)||E3e(),_=x.getModel("time"),b=_.get("month"),S=_.get("monthAbbr"),T=_.get("dayOfWeek"),C=_.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,$n(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,$n(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,$n(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,C[u]).replace(/{e}/g,u+"").replace(/{HH}/g,$n(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,$n(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,$n(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,$n(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,$n(v,3)).replace(/{S}/g,v+"")}function V3e(e,t,r,n,i){var a=null;if(pe(r))a=r;else if(Ce(r)){var o={time:e.time,level:e.time.level},s=Sr();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=r(e.value,t,o)}else{var l=e.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var c=qh(e.value,i);a=r[c][c][0]}}return y0(new Date(e.value),a,i,n)}function qh(e,t){var r=qo(e),n=r[KN(t)]()+1,i=r[JN(t)](),a=r[QN(t)](),o=r[ej(t)](),s=r[tj(t)](),l=r[rj(t)](),u=l===0,c=u&&s===0,f=c&&o===0,h=f&&a===0,d=h&&i===1,v=d&&n===1;return v?"year":d?"month":h?"day":f?"hour":c?"minute":u?"second":"millisecond"}function bw(e,t,r){switch(t){case"year":e[gQ(r)](0);case"month":e[mQ(r)](1);case"day":e[yQ(r)](0);case"hour":e[xQ(r)](0);case"minute":e[_Q(r)](0);case"second":e[bQ(r)](0)}return e}function pQ(e){return e?"getUTCFullYear":"getFullYear"}function KN(e){return e?"getUTCMonth":"getMonth"}function JN(e){return e?"getUTCDate":"getDate"}function QN(e){return e?"getUTCHours":"getHours"}function ej(e){return e?"getUTCMinutes":"getMinutes"}function tj(e){return e?"getUTCSeconds":"getSeconds"}function rj(e){return e?"getUTCMilliseconds":"getMilliseconds"}function G3e(e){return e?"setUTCFullYear":"setFullYear"}function gQ(e){return e?"setUTCMonth":"setMonth"}function mQ(e){return e?"setUTCDate":"setDate"}function yQ(e){return e?"setUTCHours":"setHours"}function xQ(e){return e?"setUTCMinutes":"setMinutes"}function _Q(e){return e?"setUTCSeconds":"setSeconds"}function bQ(e){return e?"setUTCMilliseconds":"setMilliseconds"}function W3e(e,t,r,n,i,a,o,s){var l=new at({style:{text:e,font:t,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function nj(e){if(!CN(e))return pe(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function ij(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var Zv=l0;function EI(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&Ci(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var o=t==="time",s=e instanceof Date;if(o||s){var l=o?qo(e):e;if(isNaN(+l)){if(s)return"-"}else return y0(l,n,r)}if(t==="ordinal")return tw(e)?i(e):ot(e)&&a(e)?e+"":"-";var u=Go(e);return a(u)?nj(u):tw(e)?i(e):typeof e=="boolean"?e+"":"-"}var DV=["a","b","c","d","e","f","g"],E2=function(e,t){return"{"+e+(t??"")+"}"};function aj(e,t,r){ae(t)||(t=[t]);var n=t.length;if(!n)return"";for(var i=t[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function U3e(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd +yyyy`);var n=qo(t),i=r?"getUTC":"get",a=n[i+"FullYear"](),o=n[i+"Month"]()+1,s=n[i+"Date"](),l=n[i+"Hours"](),u=n[i+"Minutes"](),c=n[i+"Seconds"](),f=n[i+"Milliseconds"]();return e=e.replace("MM",$n(o,2)).replace("M",o).replace("yyyy",a).replace("yy",$n(a%100+"",2)).replace("dd",$n(s,2)).replace("d",s).replace("hh",$n(l,2)).replace("h",l).replace("mm",$n(u,2)).replace("m",u).replace("ss",$n(c,2)).replace("s",c).replace("SSS",$n(f,3)),e}function Z3e(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function gf(e,t){return t=t||"transparent",pe(e)?e:ke(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function ww(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var vb={},D2={},Yv=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(vb),this._normalMasterList=n(D2);function n(i,a){var o=[];return B(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){B(this._normalMasterList,function(n){n.update&&n.update(t,r)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(t,r){if(t==="matrix"||t==="calendar"){vb[t]=r;return}D2[t]=r},e.get=function(t){return D2[t]||vb[t]},e}();function Y3e(e){return!!vb[e]}var DI={coord:1,coord2:2};function X3e(e){SQ.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var SQ=_e();function q3e(e){var t=e.getShallow("coord",!0),r=DI.coord;if(t==null){var n=SQ.get(e.type);n&&n.getCoord2&&(r=DI.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var _o={none:0,dataCoordSys:1,boxCoordSys:2};function TQ(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=_o.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=_o.dataCoordSys,a||(i=_o.none)):n==="box"&&(i=_o.boxCoordSys,!a&&!Y3e(r)&&(i=_o.none))}return{coordSysType:r,kind:i}}function x0(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=TQ(t),o=a.kind,s=a.coordSysType;if(i&&o!==_o.dataCoordSys&&(o=_o.dataCoordSys,s=r),o===_o.none||s!==r)return!1;var l=n(r,t);return l?(o===_o.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var CQ=function(e,t){var r=t.getReferringComponents(e,er).models[0];return r&&r.coordinateSystem},pb=B,AQ=["left","right","top","bottom","width","height"],Nc=[["width","left","right"],["height","top","bottom"]];function oj(e,t,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;t.eachChild(function(l,u){var c=l.getBoundingRect(),f=t.childAt(u+1),h=f&&f.getBoundingRect(),d,v;if(e==="horizontal"){var g=c.width+(h?-h.x+c.x:0);d=a+g,d>n||l.newline?(a=0,d=g,o+=s+r,s=c.height):s=Math.max(s,c.height)}else{var m=c.height+(h?-h.y+c.y:0);v=o+m,v>i||l.newline?(a+=s+r,o=0,v=m,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),e==="horizontal"?a=d+r:o=v+r)})}var Zc=oj;Fe(oj,"vertical");Fe(oj,"horizontal");function MQ(e,t){return{left:e.getShallow("left",t),top:e.getShallow("top",t),right:e.getShallow("right",t),bottom:e.getShallow("bottom",t),width:e.getShallow("width",t),height:e.getShallow("height",t)}}function K3e(e,t){var r=jr(e,t,{enableLayoutOnlyByCenter:!0}),n=e.getBoxLayoutParams(),i,a;if(r.type===Tg.point)a=r.refPoint,i=zt(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=ae(o)?o:[o,o];i=zt(n,r.refContainer),a=r.boxCoordFrom===DI.coord2?r.refPoint:[ve(s[0],i.width)+i.x,ve(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function PQ(e,t){var r=K3e(e,t),n=r.viewRect,i=r.center,a=e.get("radius");ae(a)||(a=[0,a]);var o=ve(n.width,t.getWidth()),s=ve(n.height,t.getHeight()),l=Math.min(o,s),u=ve(a[0],l/2),c=ve(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function zt(e,t,r){r=Zv(r||0);var n=t.width,i=t.height,a=ve(e.left,n),o=ve(e.top,i),s=ve(e.right,n),l=ve(e.bottom,i),u=ve(e.width,n),c=ve(e.height,i),f=r[2]+r[0],h=r[1]+r[3],d=e.aspect;switch(isNaN(u)&&(u=n-s-h-a),isNaN(c)&&(c=i-l-f-o),d!=null&&(isNaN(u)&&isNaN(c)&&(d>n/i?u=n*.8:c=i*.8),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=n-s-u-h),isNaN(o)&&(o=i-l-c-f),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-h;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-c/2-r[0];break;case"bottom":o=i-c-f;break}a=a||0,o=o||0,isNaN(u)&&(u=n-h-a-(s||0)),isNaN(c)&&(c=i-f-o-(l||0));var v=new Oe((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,c);return v.margin=r,v}function kQ(e,t,r){var n=e.getShallow("preserveAspect",!0);if(!n)return t;var i=t.width/t.height;if(Math.abs(Math.atan(r)-Math.atan(i))<1e-9)return t;var a=e.getShallow("preserveAspectAlign",!0),o=e.getShallow("preserveAspectVerticalAlign",!0),s={width:t.width,height:t.height},l=n==="cover";return i>r&&!l||i=g)return f;for(var m=0;m=0;l--)s=He(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return zv(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return MQ(this,!1)},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(r){this.option.zlevel=r},t.protoInitialize=function(){var r=t.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),t}(et);CJ(Ke,et);DT(Ke);P3e(Ke);k3e(Ke,eBe);function eBe(e){var t=[];return B(Ke.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=se(t,function(r){return Co(r).main}),e!=="dataset"&&We(t,"dataset")<=0&&t.unshift("dataset"),t}var J={color:{},darkColor:{},size:{}},fr=J.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};ie(fr,{primary:fr.neutral80,secondary:fr.neutral70,tertiary:fr.neutral60,quaternary:fr.neutral50,disabled:fr.neutral20,border:fr.neutral30,borderTint:fr.neutral20,borderShade:fr.neutral40,background:fr.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:fr.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:fr.neutral70,axisLineTint:fr.neutral40,axisTick:fr.neutral70,axisTickMinor:fr.neutral60,axisLabel:fr.neutral70,axisSplitLine:fr.neutral15,axisMinorSplitLine:fr.neutral05});for(var Ju in fr)if(fr.hasOwnProperty(Ju)){var NV=fr[Ju];Ju==="theme"?J.darkColor.theme=fr.theme.slice():Ju==="highlight"?J.darkColor.highlight="rgba(255,231,130,0.4)":Ju.indexOf("accent")===0?J.darkColor[Ju]=ks(NV,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):J.darkColor[Ju]=ks(NV,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}J.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var IQ="";typeof navigator<"u"&&(IQ=navigator.platform||"");var oh="rgba(0, 0, 0, 0.2)",OQ=J.color.theme[0],tBe=ks(OQ,null,null,.9);const rBe={darkMode:"auto",colorBy:"series",color:J.color.theme,gradientColor:[tBe,OQ],aria:{decal:{decals:[{color:oh,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:oh,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:oh,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:oh,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:oh,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:oh,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:IQ.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var EQ=_e(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Ni="original",on="arrayRows",ji="objectRows",Qa="keyedColumns",Ql="typedArray",DQ="unknown",Ua="column",Ef="row",fn={Must:1,Might:2,Not:3},NQ=Je();function nBe(e){NQ(e).datasetMap=_e()}function jQ(e,t,r){var n={},i=lj(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=NQ(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,f;e=e.slice(),B(e,function(g,m){var x=ke(g)?g:e[m]={name:g};x.type==="ordinal"&&c==null&&(c=m,f=v(x)),n[x.name]=[]});var h=l.get(u)||l.set(u,{categoryWayDim:f,valueWayDim:0});B(e,function(g,m){var x=g.name,_=v(g);if(c==null){var b=h.valueWayDim;d(n[x],b,_),d(o,b,_),h.valueWayDim+=_}else if(c===m)d(n[x],0,_),d(a,0,_);else{var b=h.categoryWayDim;d(n[x],b,_),d(o,b,_),h.categoryWayDim+=_}});function d(g,m,x){for(var _=0;_t)return e[n];return e[r-1]}function zQ(e,t,r,n,i,a,o){a=a||e;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=o==null||!n?r:lBe(n,o);if(c=c||r,!(!c||!c.length)){var f=c[l];return i&&(u[i]=f),s.paletteIdx=(l+1)%c.length,f}}function uBe(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var qx,Fp,RV,BV="\0_ec_inner",cBe=1,cj=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new et(a),this._locale=new et(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=FV(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,FV(n))},t.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?RV(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&B(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},t.prototype.mergeOption=function(r){this._mergeOption(r,null)},t.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=_e(),u=n&&n.replaceMergeMainTypeMap;nBe(this),B(r,function(f,h){f!=null&&(Ke.hasClass(h)?h&&(s.push(h),l.set(h,!0)):i[h]=i[h]==null?Ae(f):He(i[h],f,!0))}),u&&u.each(function(f,h){Ke.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Ke.topologicalTravel(s,Ke.getAllClassMainTypes(),c,this);function c(f){var h=oBe(this,f,Pt(r[f])),d=a.get(f),v=d?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",g=_J(d,h,v);CRe(g,f,Ke),i[f]=null,a.set(f,null),o.set(f,0);var m=[],x=[],_=0,b;B(g,function(S,T){var C=S.existing,A=S.newOption;if(!A)C&&(C.mergeOption({},this),C.optionUpdated({},!1));else{var P=f==="series",I=Ke.getClass(f,S.keyInfo.subType,!P);if(!I)return;if(f==="tooltip"){if(b)return;b=!0}if(C&&C.constructor===I)C.name=S.keyInfo.name,C.mergeOption(A,this),C.optionUpdated(A,!1);else{var k=ie({componentIndex:T},S.keyInfo);C=new I(A,this,this,k),ie(C,k),S.brandNew&&(C.__requireNewView=!0),C.init(A,this,this),C.optionUpdated(null,!0)}}C?(m.push(C.option),x.push(C),_++):(m.push(void 0),x.push(void 0))},this),i[f]=m,a.set(f,x),o.set(f,_),f==="series"&&qx(this)}this._seriesIndices||qx(this)},t.prototype.getOption=function(){var r=Ae(this.option);return B(r,function(n,i){if(Ke.hasClass(i)){for(var a=Pt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!_y(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[BV],r},t.prototype.setTheme=function(r){this._theme=new et(r),this._resetOption("recreate",null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(r){this._payload=r},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=t:r==="max"?e<=t:e===t}function xBe(e,t){return e.join(",")===t.join(",")}var Aa=B,Ay=ke,VV=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function N2(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=VV.length;r0?r[o-1].seriesModel:null)}),PBe(r)}})}function PBe(e){B(e,function(t,r){var n=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,c,f){var h=o.get(t.stackedDimension,f);if(isNaN(h))return i;var d,v;s?v=o.getRawIndex(f):d=o.get(t.stackedByDimension,f);for(var g=NaN,m=r-1;m>=0;m--){var x=e[m];if(s||(v=x.data.rawIndexOf(x.stackedByDimension,d)),v>=0){var _=x.data.getByRawIndex(x.stackResultDimension,v);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&h>=0&&_>0||l==="samesign"&&h<=0&&_<0){h=hRe(h,_),g=_;break}}}return n[0]=h,n[1]=g,n})})}var UT=function(){function e(t){this.data=t.data||(t.sourceFormat===Qa?{}:[]),this.sourceFormat=t.sourceFormat||DQ,this.seriesLayoutBy=t.seriesLayoutBy||Ua,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var r=this.dimensionsDefine=t.dimensionsDefine;if(r)for(var n=0;ng&&(g=b)}d[0]=v,d[1]=g}},i=function(){return this._data?this._data.length/this._dimSize:0};XV=(t={},t[on+"_"+Ua]={pure:!0,appendData:a},t[on+"_"+Ef]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[ji]={pure:!0,appendData:a},t[Qa]={pure:!0,appendData:function(o){var s=this._data;B(o,function(l,u){for(var c=s[u]||(s[u]=[]),f=0;f<(l||[]).length;f++)c.push(l[f])})}},t[Ni]={appendData:a},t[Ql]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(g=o.interpolatedValue[m])}return g!=null?g+"":""})}},e.prototype.getRawValue=function(t,r){return nv(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function QV(e){var t,r;return ke(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function im(e){return new jBe(e)}var jBe=function(){function e(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return e.prototype.perform=function(t){var r=this._upstream,n=t&&t.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(_){return!(_>=1)&&(_=1),_}var f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=u;var h=t&&t.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,v=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d1&&n>0?s:o}};return a;function o(){return t=e?null:lt},gte:function(e,t){return e>=t}},BBe=function(){function e(t,r){if(!ot(r)){var n="";mt(n)}this._opFn=qQ[t],this._rvalFloat=Go(r)}return e.prototype.evaluate=function(t){return ot(t)?this._opFn(t,this._rvalFloat):this._opFn(Go(t),this._rvalFloat)},e}(),KQ=function(){function e(t,r){var n=t==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return e.prototype.evaluate=function(t,r){var n=ot(t)?t:Go(t),i=ot(r)?r:Go(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=pe(t),l=pe(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),zBe=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=Go(r)}return e.prototype.evaluate=function(t){var r=t===this._rval;if(!r){var n=typeof t;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(r=Go(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function $Be(e,t){return e==="eq"||e==="ne"?new zBe(e==="eq",t):xe(qQ,e)?new BBe(e,t):null}var FBe=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(t){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(t){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(t,r){},e.prototype.retrieveValueFromItem=function(t,r){},e.prototype.convertValue=function(t,r){return eu(t,r)},e}();function VBe(e,t){var r=new FBe,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==Ua&&mt(o);var s=[],l={},u=e.dimensionsDefine;if(u)B(u,function(g,m){var x=g.name,_={index:m,name:x,displayName:g.displayName};if(s.push(_),x!=null){var b="";xe(l,x)&&mt(b),l[x]=_}});else for(var c=0;c65535?qBe:KBe}function lh(){return[1/0,-1/0]}function JBe(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function r6(e,t,r,n,i){var a=eee[r||"float"];if(i){var o=e[t],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;um[1]&&(m[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},e.prototype._initDataFromProvider=function(t,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=se(o,function(_){return _.property}),c=0;cx[1]&&(x[1]=m)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(t,r){if(!(r>=0&&r=0&&r=this._rawCount||t<0)return-1;if(!this._indices)return t;var r=this._indices,n=r[t];if(n!=null&&nt)a=o-1;else return o}return-1},e.prototype.getIndices=function(){var t,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){t=new n(i);for(var a=0;a=f&&_<=h||isNaN(_))&&(l[u++]=g),g++}v=!0}else if(a===2){for(var m=d[i[0]],b=d[i[1]],S=t[i[1]][0],T=t[i[1]][1],x=0;x=f&&_<=h||isNaN(_))&&(C>=S&&C<=T||isNaN(C))&&(l[u++]=g),g++}v=!0}}if(!v)if(a===1)for(var x=0;x=f&&_<=h||isNaN(_))&&(l[u++]=A)}else for(var x=0;xt[k][1])&&(P=!1)}P&&(l[u++]=r.getRawIndex(x))}return ux[1]&&(x[1]=m)}}}},e.prototype.lttbDownSample=function(t,r){var n=this.clone([t],!0),i=n._chunks,a=i[t],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),c,f,h,d=new(sh(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var v=1;vc&&(c=f,h=S)}E>0&&Es&&(g=s-c);for(var m=0;mv&&(v=_,d=c+m)}var b=this.getRawIndex(f),S=this.getRawIndex(d);fc-v&&(l=c-v,s.length=l);for(var g=0;gf[1]&&(f[1]=x),h[d++]=_}return a._count=d,a._indices=h,a._updateGetRawIdx(),a},e.prototype.each=function(t,r){if(this._count)for(var n=t.length,i=this._chunks,a=0,o=this.count();al&&(l=f)}return o=[s,l],this._extent[t]=o,o},e.prototype.getRawDataItem=function(t){var r=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[t]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function t(r,n,i,a){return eu(r[a],this._dimensions[a])}B2={arrayRows:t,objectRows:function(r,n,i,a){return eu(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return eu(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),tee=function(){function e(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(t,r){this._sourceList=t,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(Jx(t)){var o=t,s=void 0,l=void 0,u=void 0;if(n){var c=r[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=Un(s)?Ql:Ni,a=[];var f=this._getSourceMetaRawOption()||{},h=u&&u.metaRawOption||{},d=be(f.seriesLayoutBy,h.seriesLayoutBy)||null,v=be(f.sourceHeader,h.sourceHeader),g=be(f.dimensions,h.dimensions),m=d!==h.seriesLayoutBy||!!v!=!!h.sourceHeader||g;i=m?[RI(s,{seriesLayoutBy:d,sourceHeader:v,dimensions:g},l)]:[]}else{var x=t;if(n){var _=this._applyTransform(r);i=_.sourceList,a=_.upstreamSignList}else{var b=x.get("source",!0);i=[RI(b,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},e.prototype._applyTransform=function(t){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";t.length!==1&&i6(a)}var o,s=[],l=[];return B(t,function(u){u.prepareSource();var c=u.getSource(i||0),f="";i!=null&&!c&&i6(f),s.push(c),l.push(u._getVersionSign())}),n?o=YBe(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[kBe(s[0])]),{sourceList:o,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),r=0;r1||r>0&&!e.noHeader;return B(e.blocks,function(i){var a=tee(i);a>=t&&(t=a+ +(n&&(!a||DI(i)&&!i.noHeader)))}),t}return 0}function J3e(e,t,r,n){var i=t.noHeader,a=eze(tee(t)),o=[],s=t.blocks||[];xn(!s||ae(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(xe(u,l)){var c=new ZQ(u[l],null);s.sort(function(g,m){return c.evaluate(g.sortParam,m.sortParam)})}else l==="seriesDesc"&&s.reverse()}B(s,function(g,m){var y=t.valueFormatter,_=eee(g)(y?ie(ie({},e),{valueFormatter:y}):e,g,m>0?a.html:0,n);_!=null&&o.push(_)});var f=e.renderMode==="richText"?o.join(a.richText):NI(n,o.join(""),i?r:a.html);if(i)return f;var h=PI(t.header,"ordinal",e.useUTC),d=QQ(n,e.renderMode).nameStyle,v=JQ(n);return e.renderMode==="richText"?ree(e,h,d)+a.richText+f:NI(n,'
'+In(h)+"
"+f,r)}function Q3e(e,t,r,n){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(S){return S=ae(S)?S:[S],se(S,function(T,C){return PI(T,ae(d)?d[C]:d,u)})};if(!(a&&o)){var f=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||J.color.secondary,i),h=a?"":PI(l,"ordinal",u),d=t.valueType,v=o?[]:c(t.value,t.dataIndex),g=!s||!a,m=!s&&a,y=QQ(n,i),_=y.nameStyle,b=y.valueStyle;return i==="richText"?(s?"":f)+(a?"":ree(e,h,_))+(o?"":nze(e,v,g,m,b)):NI(n,(s?"":f)+(a?"":tze(h,!s,_))+(o?"":rze(v,g,m,b)),r)}}function t6(e,t,r,n,i,a){if(e){var o=eee(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function eze(e){return{html:q3e[e],richText:K3e[e]}}function NI(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=JQ(e);return'
'+t+n+"
"}function tze(e,t,r){var n=t?"margin-left:2px":"";return''+In(e)+""}function rze(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=ae(e)?e:[e],''+se(e,function(o){return In(o)}).join("  ")+""}function ree(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function nze(e,t,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(ae(t)?t.join(" "):t,a)}function nee(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return gf(n)}function iee(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var j2=function(){function e(){this.richTextStyles={},this._nextStyleNameId=fJ()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(t,r,n){var i=n==="richText"?this._generateStyleName():null,a=yQ({color:r,type:t,renderMode:n,markerId:i});return pe(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};ae(r)?B(r,function(a){return ie(n,a)}):ie(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function aee(e){var t=e.series,r=e.dataIndex,n=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(r),l=ae(s),u=nee(t,r),c,f,h,d;if(o>1||l&&!o){var v=ize(s,t,r,a,u);c=v.inlineValues,f=v.inlineValueTypes,h=v.blocks,d=v.inlineValues[0]}else if(o){var g=i.getDimensionInfo(a[0]);d=c=nv(i,r,a[0]),f=g.type}else d=c=l?s[0]:s;var m=wN(t),y=m&&t.name||"",_=i.getName(r),b=n?y:_;return Cr("section",{header:y,noHeader:n||!m,sortParam:d,blocks:[Cr("nameValue",{markerType:"item",markerColor:u,name:b,noName:!Ci(b),value:c,valueType:f,dataIndex:r})].concat(h||[])})}function ize(e,t,r,n,i){var a=t.getData(),o=da(e,function(f,h,d){var v=a.getDimensionInfo(d);return f=f||v&&v.tooltip!==!1&&v.displayName!=null},!1),s=[],l=[],u=[];n.length?B(n,function(f){c(nv(a,r,f),f)}):B(e,c);function c(f,h){var d=a.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?u.push(Cr("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var al=Je();function qx(e,t){return e.getName(t)||e.getId(t)}var db="__universalTransitionEnabled",Tt=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return t.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=rm({count:oze,reset:sze}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=al(this).sourceManager=new KQ(this);a.prepareSource();var o=this.getInitialData(r,i);n6(o,this),this.dataTask.context.data=o,al(this).dataBeforeProcessed=o,r6(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=Sy(this),a=i?Of(r):{},o=this.subType;Ke.hasClass(o)&&(o+="Series"),He(r,n.getTheme().get(this.subType)),He(r,this.getDefaultOption()),cf(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Vo(r,a,i)},t.prototype.mergeOption=function(r,n){r=He(this.option,r,!0),this.fillDataTextStyle(r.data);var i=Sy(this);i&&Vo(this.option,r,i);var a=al(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);n6(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,al(this).dataBeforeProcessed=o,r6(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!Un(r))for(var n=["show"],i=0;i=0&&h<0)&&(f=_,h=y,d=0),y===h&&(c[d++]=g))}),c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return aee({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(nt.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,o=aj.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},t.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},t.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},t.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[qx(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[db])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},t.prototype._innerSelect=function(r,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){ke(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return Ke.registerClass(r)},t.protoInitialize=function(){var r=t.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),t}(Ke);cr(Tt,WT);cr(Tt,aj);bJ(Tt,Ke);function r6(e){var t=e.name;wN(e)||(e.name=aze(e)||t)}function aze(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return B(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function oze(e){return e.model.getRawData().count()}function sze(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),lze}function lze(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function n6(e,t){B(qd(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Fe(uze,t))})}function uze(e,t){var r=jI(e);return r&&r.setOutputEnd((t||this).count()),t}function jI(e){var t=(e.ecModel||{}).scheduler,r=t&&t.getPipeline(e.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(e.uid))}return n}}var kt=function(){function e(){this.group=new Me,this.uid=Wv("viewComponent")}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){},e.prototype.updateLayout=function(t,r,n,i){},e.prototype.updateVisual=function(t,r,n,i){},e.prototype.toggleBlurSeries=function(t,r,n){},e.prototype.eachRendered=function(t){var r=this.group;r&&r.traverse(t)},e}();TN(kt);IT(kt);function Zv(){var e=Je();return function(t){var r=e(t),n=t.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var oee=Je(),cze=Zv(),bt=function(){function e(){this.group=new Me,this.uid=Wv("viewChart"),this.renderTask=rm({plan:fze,reset:hze}),this.renderTask.context={view:this}}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.highlight=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&a6(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&a6(a,i,"normal")},e.prototype.remove=function(t,r){this.group.removeAll()},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateLayout=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateVisual=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.eachRendered=function(t){Au(this.group,t)},e.markUpdateMethod=function(t,r){oee(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function i6(e,t,r){e&&_y(e)&&(t==="emphasis"?Fs:Vs)(e,r)}function a6(e,t,r){var n=ff(e,t),i=t&&t.highlightKey!=null?B5e(t.highlightKey):null;n!=null?B(Pt(n),function(a){i6(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){i6(a,r,i)})}TN(bt);IT(bt);function fze(e){return cze(e.model)}function hze(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&oee(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),dze[l]}var dze={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},_w="\0__throttleOriginMethod",o6="\0__throttleRate",s6="\0__throttleType";function UT(e,t,r){var n,i=0,a=0,o=null,s,l,u,c;t=t||0;function f(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var h=function(){for(var d=[],v=0;v=0?f():o=setTimeout(f,-s),i=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){c=d},h}function Yv(e,t,r,n){var i=e[t];if(i){var a=i[_w]||i,o=i[s6],s=i[o6];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=UT(a,r,n==="debounce"),i[_w]=a,i[s6]=n,i[o6]=r}return i}}function Cy(e,t){var r=e[t];r&&r[_w]&&(r.clear&&r.clear(),e[t]=r[_w])}var l6=Je(),u6={itemStyle:hf(uQ,!0),lineStyle:hf(lQ,!0)},vze={lineStyle:"stroke",itemStyle:"fill"};function see(e,t){var r=e.visualStyleMapper||u6[t];return r||(console.warn("Unknown style type '"+t+"'."),u6.itemStyle)}function lee(e,t){var r=e.visualDrawType||vze[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var pze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=see(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=lee(e,n),u=o[l],c=Ce(u)?u:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||f){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=h,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Ce(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||Ce(o.stroke)?h:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&c)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,v){var g=e.getDataParams(v),m=ie({},o);m[l]=c(g),d.setItemVisual(v,"style",m)}}}},Fp=new et,gze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=see(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Fp.option=l[n];var u=i(Fp),c=o.ensureUniqueItemVisual(s,"style");ie(c,u),Fp.option.decal&&(o.setItemVisual(s,"decal",Fp.option.decal),Fp.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},mze={performRawSeries:!0,overallReset:function(e){var t=_e();e.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var i=r.type+"-"+n,a=t.get(i);a||(a={},t.set(i,a)),l6(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=l6(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=lee(r,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],f=a.getItemVisual(c,"colorFromPalette");if(f){var h=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",v=n.count();h[l]=r.getColorFromPalette(d,o,v)}})}})}},Kx=Math.PI;function yze(e,t){t=t||{},Pe(t,{text:"loading",textColor:J.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:J.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new Me,n=new Xe({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new at({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Xe({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});r.add(a);var o;return t.showSpinner&&(o=new h0({shape:{startAngle:-Kx/2,endAngle:-Kx/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Kx*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Kx*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(e.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),c=e.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},r.resize(),r}var uee=function(){function e(t,r,n,i){this._stageTaskMap=_e(),this.ecInstance=t,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(t,r){t.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},e.prototype.getPerformArgs=function(t,r){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},e.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},e.prototype.updateStreamModes=function(t,r){var n=this._pipelineMap.get(t.uid),i=t.getData(),a=i.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&a>=n.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},e.prototype.restorePipelines=function(t){var r=this,n=r._pipelineMap=_e();t.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),r._pipe(i,i.dataTask)})},e.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,r=this.api.getModel(),n=this.api;B(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";xn(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},e.prototype.prepareView=function(t,r,n,i){var a=t.renderTask,o=a.context;o.model=r,o.ecModel=n,o.api=i,a.__block=!t.incrementalPrepareRender,this._pipe(r,a)},e.prototype.performDataProcessorTasks=function(t,r){this._performStageTasks(this._dataProcessorHandlers,t,r,{block:!0})},e.prototype.performVisualTasks=function(t,r,n){this._performStageTasks(this._visualHandlers,t,r,n)},e.prototype._performStageTasks=function(t,r,n,i){i=i||{};var a=!1,o=this;B(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),f=c.seriesTaskMap,h=c.overallTask;if(h){var d,v=h.agentStubMap;v.each(function(m){s(i,m)&&(m.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var g=o.getPerformArgs(h,i.block);v.each(function(m){m.perform(g)}),h.perform(g)&&(a=!0)}else f&&f.each(function(m,y){s(i,m)&&m.dirty();var _=o.getPerformArgs(m,i.block);_.skip=!l.performRawSeries&&r.isSeriesFiltered(m.context.model),o.updatePayload(m,n),m.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},e.prototype.performSeriesTasks=function(t){var r;t.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(t){var r=t.tail;do{if(r.__block){t.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},e.prototype.updatePayload=function(t,r){r!=="remain"&&(t.context.payload=r)},e.prototype._createSeriesStageTask=function(t,r,n,i){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=_e(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(f){var h=f.uid,d=s.set(h,o&&o.get(h)||rm({plan:Sze,reset:Tze,count:Aze}));d.context={model:f,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(f,d)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||rm({reset:xze});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=_e(),u=t.seriesType,c=t.getTargetSeries,f=!0,h=!1,d="";xn(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,v):c?c(n,i).each(v):(f=!1,B(n.getSeries(),v));function v(g){var m=g.uid,y=l.set(m,s&&s.get(m)||(h=!0,rm({reset:_ze,onDirty:wze})));y.context={model:g,overallProgress:f},y.agent=o,y.__block=f,a._pipe(g,y)}h&&o.dirty()},e.prototype._pipe=function(t,r){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},e.wrapStageHandler=function(t,r){return Ce(t)&&(t={overallReset:t,seriesType:Mze(t)}),t.uid=Wv("stageHandler"),r&&(t.visualType=r),t},e}();function xze(e){e.overallReset(e.ecModel,e.api,e.payload)}function _ze(e){return e.overallProgress&&bze}function bze(){this.agent.dirty(),this.getDownstream().dirty()}function wze(){this.agent&&this.agent.dirty()}function Sze(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Tze(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Pt(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?se(t,function(r,n){return cee(n)}):Cze}var Cze=cee(0);function cee(e){return function(t,r){var n=r.data,i=r.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&d===u.length-h.length){var v=u.slice(0,d);v!=="data"&&(r.mainType=v,r[h.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(n[u]=l,c=!0),c||(i[u]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},e.prototype.filter=function(t,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,r.otherQuery,i,a));function c(f,h,d,v){return f[d]==null||h[v||d]===f[d]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),RI=["symbol","symbolSize","symbolRotate","symbolOffset"],f6=RI.concat(["symbolKeepAspect"]),Lze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData();if(e.legendIcon&&r.setVisual("legendIcon",e.legendIcon),!e.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&Rc(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function BI(e,t,r){for(var n=t.type==="radial"?Hze(e,t,r):Wze(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:ot(e)?[e]:ae(e)?e:null}function hj(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&Zze(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=se(r,function(a){return a/i}),n/=i)}return[r,n]}var Yze=new Fo(!0);function Sw(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function h6(e){return typeof e=="string"&&e!=="none"}function Tw(e){var t=e.fill;return t!=null&&t!=="none"}function d6(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function v6(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function zI(e,t,r){var n=CN(t.image,t.__image,r);if(OT(n)){var i=e.createPattern(n,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Hg),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function Xze(e,t,r,n){var i,a=Sw(r),o=Tw(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||Yze,f=t.__dirty;if(!n){var h=r.fill,d=r.stroke,v=o&&!!h.colorStops,g=a&&!!d.colorStops,m=o&&!!h.image,y=a&&!!d.image,_=void 0,b=void 0,S=void 0,T=void 0,C=void 0;(v||g)&&(C=t.getBoundingRect()),v&&(_=f?BI(e,h,C):t.__canvasFillGradient,t.__canvasFillGradient=_),g&&(b=f?BI(e,d,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),m&&(S=f||!t.__canvasFillPattern?zI(e,h,t):t.__canvasFillPattern,t.__canvasFillPattern=S),y&&(T=f||!t.__canvasStrokePattern?zI(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),v?e.fillStyle=_:m&&(S?e.fillStyle=S:o=!1),g?e.strokeStyle=b:y&&(T?e.strokeStyle=T:a=!1)}var A=t.getGlobalScale();c.setScale(A[0],A[1],t.segmentIgnoreThreshold);var P,I;e.setLineDash&&r.lineDash&&(i=hj(t),P=i[0],I=i[1]);var k=!0;(u||f&Mh)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),k=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),k&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=I),n||(r.strokeFirst?(a&&v6(e,r),o&&d6(e,r)):(o&&d6(e,r),a&&v6(e,r))),P&&e.setLineDash([])}function qze(e,t,r){var n=t.__image=CN(r.image,t.__image,t,t.onload);if(!(!n||!OT(n))){var i=r.x||0,a=r.y||0,o=t.getWidth(),s=t.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var u=r.sx||0,c=r.sy||0;e.drawImage(n,u,c,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,c=r.sy,f=o-u,h=s-c;e.drawImage(n,u,c,f,h,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function Kze(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||zs,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=hj(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(Sw(r)&&e.strokeText(i,r.x,r.y),Tw(r)&&e.fillText(i,r.x,r.y)):(Tw(r)&&e.fillText(i,r.x,r.y),Sw(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var p6=["shadowBlur","shadowOffsetX","shadowOffsetY"],g6=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function gee(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){ri(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?Hc.opacity:o}(n||t.blend!==r.blend)&&(a||(ri(e,i),a=!0),e.globalCompositeOperation=t.blend||Hc.blend);for(var s=0;s0&&r.unfinished);r.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(r,n,i){if(!this[Pr]){if(this._disposed){this.id;return}var a,o,s;if(ke(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Pr]=!0,hh(this),!this._model||n){var l=new f3e(this._api),u=this._theme,c=this._model=new oj;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},GI);var f={seriesTransition:s,optionChanged:!0};if(i)this[Kr]={silent:a,updateParams:f},this[Pr]=!1,this.getZr().wakeUp();else{try{nc(this),ns.update.call(this,null,f)}catch(h){throw this[Kr]=null,this[Pr]=!1,h}this._ssr||this._zr.flush(),this[Kr]=null,this[Pr]=!1,ch.call(this,a),fh.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[Pr]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Kr]&&(a==null&&(a=this[Kr].silent),o=this[Kr].updateParams,this[Kr]=null),this[Pr]=!0,hh(this);try{this._updateTheme(r),i.setTheme(this._theme),nc(this),ns.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Pr]=!1,s}this[Pr]=!1,ch.call(this,a),fh.call(this,a)}}},t.prototype._updateTheme=function(r){pe(r)&&(r=Nee[r]),r&&(r=Ae(r),r&&BQ(r,!0),this._theme=r)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||nt.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},t.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},t.prototype.getSvgDataURL=function(){var r=this._zr,n=r.storage.getDisplayList();return B(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()},t.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],o=this;B(n,function(l){i.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return B(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(Pw[i]){var l=s,u=s,c=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();B(Yc,function(b,S){if(b.group===i){var T=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(Ae(r)),C=b.getDom().getBoundingClientRect();l=a(C.left,l),u=a(C.top,u),c=o(C.right,c),f=o(C.bottom,f),h.push({dom:T,left:C.left,top:C.top})}}),l*=d,u*=d,c*=d,f*=d;var v=c-l,g=f-u,m=ui.createCanvas(),y=sI(m,{renderer:n?"svg":"canvas"});if(y.resize({width:v,height:g}),n){var _="";return B(h,function(b){var S=b.left-l,T=b.top-u;_+=''+b.dom+""}),y.painter.getSvgRoot().innerHTML=_,r.connectedBackgroundColor&&y.painter.setBackgroundColor(r.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}else return r.connectedBackgroundColor&&y.add(new Xe({shape:{x:0,y:0,width:v,height:g},style:{fill:r.connectedBackgroundColor}})),B(h,function(b){var S=new Yr({style:{x:b.left*d-l,y:b.top*d-u,image:b.dom}});y.add(S)}),y.refreshImmediately(),m.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},t.prototype.convertToPixel=function(r,n,i){return t_(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return t_(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return t_(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=dd(i,r);return B(o,function(s,l){l.indexOf("Models")>=0&&B(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[u.__viewId];f&&f.containPoint&&(a=a||f.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=dd(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?fj(s,l,n):m0(s,n)},t.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},t.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},t.prototype._initEvents=function(){var r=this;B(S4e,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&jc(l,function(g){var m=De(g);if(m&&m.dataIndex!=null){var y=m.dataModel||s.getSeriesByIndex(m.seriesIndex);return u=y&&y.getDataParams(m.dataIndex,m.dataType,l)||{},!0}else if(m.eventData)return u=ie({},m.eventData),!0},!0),u){var f=u.componentType,h=u.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=u.seriesIndex);var d=f&&h!=null&&s.getComponent(f,h),v=d&&r[d.mainType==="series"?"_chartsMap":"_componentsMap"][d.__viewId];u.event=o,u.type=i,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:d,view:v},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;B(FI,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Oze(n,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&yJ(this.getDom(),gj,"");var n=this,i=n._api,a=n._model;B(n._componentsViews,function(o){o.dispose(a,i)}),B(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete Yc[n.id]},t.prototype.resize=function(r){if(!this[Pr]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[Kr]&&(a==null&&(a=this[Kr].silent),i=!0,this[Kr]=null),this[Pr]=!0,hh(this);try{i&&nc(this),ns.update.call(this,{type:"resize",animation:ie({duration:0},r&&r.animation)})}catch(o){throw this[Pr]=!1,o}this[Pr]=!1,ch.call(this,a),fh.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(ke(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!WI[r]){var i=WI[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(r){var n=ie({},r);return n.type=$I[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ke(n)||(n={silent:!!n}),!!Aw[r.type]&&this._model){if(this[Pr]){this._pendingActions.push(r);return}var i=n.silent;V2.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&nt.browser.weChat&&this._throttledZrFlush(),ch.call(this,i),fh.call(this,i)}},t.prototype.updateLabelLayout=function(){ka.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){nc=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),$2(f,!0),$2(f,!1),h.plan()},$2=function(f,h){for(var d=f._model,v=f._scheduler,g=h?f._componentsViews:f._chartsViews,m=h?f._componentsMap:f._chartsMap,y=f._zr,_=f._api,b=0;bh.get("hoverLayerThreshold")&&!nt.node&&!nt.worker&&h.eachSeries(function(m){if(!m.preventUsingHoverLayer){var y=f._chartsMap[m.__viewId];y.__alive&&y.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function s(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(v){v.isGroup||(v.style.blend=d)})}function l(f,h){if(!f.preventAutoZ){var d=pf(f);h.eachRendered(function(v){return $T(v,d.z,d.zlevel),!0})}}function u(f,h){h.eachRendered(function(d){if(!vd(d)){var v=d.getTextContent(),g=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(f,h){var d=f.getModel("stateAnimation"),v=f.isAnimationEnabled(),g=d.get("duration"),m=g>0?{duration:g,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(y){if(y.states&&y.states.emphasis){if(vd(y))return;if(y instanceof tt&&z5e(y),y.__dirty){var _=y.prevStates;_&&y.useStates(_)}if(v){y.stateTransition=m;var b=y.getTextContent(),S=y.getTextGuideLine();b&&(b.stateTransition=m),S&&(S.stateTransition=m)}y.__dirty&&a(y)}})}k6=function(f){return new(function(h){q(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(v){for(;v;){var g=v.__ecComponentInfo;if(g!=null)return f._model.getComponent(g.mainType,g.index);v=v.parent}},d.prototype.enterEmphasis=function(v,g){Fs(v,g),Gi(f)},d.prototype.leaveEmphasis=function(v,g){Vs(v,g),Gi(f)},d.prototype.enterBlur=function(v){jJ(v),Gi(f)},d.prototype.leaveBlur=function(v){IN(v),Gi(f)},d.prototype.enterSelect=function(v){RJ(v),Gi(f)},d.prototype.leaveSelect=function(v){BJ(v),Gi(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(v){return f.getViewOfComponentModel(v)},d.prototype.getViewOfSeriesModel=function(v){return f.getViewOfSeriesModel(v)},d.prototype.getMainProcessVersion=function(){return f[Qx]},d}(jQ))(f)},Dee=function(f){function h(d,v){for(var g=0;g=0)){I6.push(r);var a=uee.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function wj(e,t){WI[e]=t}function E4e(e){SK({createCanvas:e})}function Fee(e,t,r){var n=wee("registerMap");n&&n(e,t,r)}function D4e(e){var t=wee("getMap");return t&&t(e)}var Vee=G3e;Pu(vj,pze);Pu(ZT,gze);Pu(ZT,mze);Pu(vj,Lze);Pu(ZT,Ize);Pu(Mee,a4e);xj(BQ);_j(h4e,S3e);wj("default",yze);Qa({type:Uc,event:Uc,update:Uc},sr);Qa({type:sb,event:sb,update:sb},sr);Qa({type:dw,event:kN,update:dw,action:sr,refineEvent:Sj,publishNonRefinedEvent:!0});Qa({type:mI,event:kN,update:mI,action:sr,refineEvent:Sj,publishNonRefinedEvent:!0});Qa({type:vw,event:kN,update:vw,action:sr,refineEvent:Sj,publishNonRefinedEvent:!0});function Sj(e,t,r,n){return{eventContent:{selected:D5e(r),isFromClick:t.isFromClick||!1}}}yj("default",{});yj("dark",dee);var N4e={},O6=[],j4e={registerPreprocessor:xj,registerProcessor:_j,registerPostInit:Ree,registerPostUpdate:Bee,registerUpdateLifecycle:YT,registerAction:Qa,registerCoordinateSystem:zee,registerLayout:$ee,registerVisual:Pu,registerTransform:Vee,registerLoading:wj,registerMap:Fee,registerImpl:o4e,PRIORITY:Pee,ComponentModel:Ke,ComponentView:kt,SeriesModel:Tt,ChartView:bt,registerComponentModel:function(e){Ke.registerClass(e)},registerComponentView:function(e){kt.registerClass(e)},registerSeriesModel:function(e){Tt.registerClass(e)},registerChartView:function(e){bt.registerClass(e)},registerCustomSeries:function(e,t){Tee(e,t)},registerSubTypeDefaulter:function(e,t){Ke.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){iJ(e,t)}};function Ze(e){if(ae(e)){B(e,function(t){Ze(t)});return}We(O6,e)>=0||(O6.push(e),Ce(e)&&(e={install:e}),e.install(j4e))}function Gp(e){return e==null?0:e.length||1}function E6(e){return e}var Gs=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||E6,this._newKeyGetter=i||E6,this.context=a,this._diffModeMultiple=o==="multiple"}return e.prototype.add=function(t){return this._add=t,this},e.prototype.update=function(t){return this._update=t,this},e.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},e.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},e.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},e.prototype.remove=function(t){return this._remove=t,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var t=this._old,r=this._new,n={},i=new Array(t.length),a=new Array(r.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var o=0;o1){var c=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(c,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},e.prototype._executeMultiple=function(){var t=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(t,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&h===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(f===1&&h===1)this._update&&this._update(c,u),i[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(f>1)for(var d=0;d1)for(var s=0;s30}var Wp=ke,ol=se,V4e=typeof Int32Array>"u"?Array:Int32Array,G4e="e\0\0",D6=-1,W4e=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],H4e=["_approximateExtent"],N6,n_,Hp,Up,H2,Zp,U2,En=function(){function e(t,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;Wee(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===Ni;if(l&&!i.pure)for(var u=[],c=t;c0},e.prototype.ensureUniqueItemVisual=function(t,r){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var a=i[r];return a==null&&(a=this.getVisual(r),ae(a)?a=a.slice():Wp(a)&&(a=ie({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Wp(r)?ie(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){Wp(t)?ie(this._layout,t):this._layout[t]=r},e.prototype.getLayout=function(t){return this._layout[t]},e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},e.prototype.setItemLayout=function(t,r,n){this._itemLayouts[t]=n?ie(this._itemLayouts[t]||{},r):r},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(t,r){var n=this.hostModel&&this.hostModel.seriesIndex;gI(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){B(this._graphicEls,function(n,i){n&&t&&t.call(r,n,i)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:ol(this.dimensions,this._getDimInfo,this),this.hostModel)),H2(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Ce(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(TT(arguments)))})},e.internalField=function(){N6=function(t){var r=t._invertedIndicesMap;B(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new V4e(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function U4e(e,t){return qv(e,t).dimensions}function qv(e,t){sj(e)||(e=lj(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=_e(),a=[],o=Y4e(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Zee(o),l=n===e.dimensionsDefine,u=l?Uee(e):Hee(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var f=_e(c),h=new XQ(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function Y4e(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return B(t,function(a){var o;ke(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function X4e(e,t,r){if(r||t.hasKey(e)){for(var n=0;t.hasKey(e+n);)n++;e+=n}return t.set(e,!0),e}var q4e=function(){function e(t){this.coordSysDims=[],this.axisMap=_e(),this.categoryAxisMap=_e(),this.coordSysName=t}return e}();function K4e(e){var t=e.get("coordinateSystem"),r=new q4e(t),n=J4e[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var J4e={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",er).models[0],a=e.getReferringComponents("yAxis",er).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),dh(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),dh(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",er).models[0];t.coordSysDims=["single"],r.set("single",i),dh(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",er).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),dh(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),dh(o)&&(n.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(e,t,r,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,r,n){var i=e.ecModel,a=i.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();B(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),dh(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",er).models[0];t.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),o=i.getDimensionModel("y");r.set("x",a),r.set("y",o),n.set("x",a),n.set("y",o)}};function dh(e){return e.get("type")==="category"}function Yee(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;Q4e(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,f,h;if(B(a,function(_,b){pe(_)&&(a[b]=_={name:_}),l&&!_.isExtraCoord&&(!n&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!i||i===_.coordDim)&&(c=_))}),c&&!n&&!u&&(n=!0),c){f="__\0ecstackresult_"+e.id,h="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,v=c.type,g=0;B(a,function(_){_.coordDim===d&&g++});var m={name:f,coordDim:d,coordDimIndex:g,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:h,coordDim:h,coordDimIndex:g+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(m.storeDimIndex=s.ensureCalculationDimension(h,v),y.storeDimIndex=s.ensureCalculationDimension(f,v)),o.appendCalculationDimension(m),o.appendCalculationDimension(y)):(a.push(m),a.push(y))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function Q4e(e){return!Wee(e.schema)}function Ws(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function Tj(e,t){return Ws(e,t)?e.getCalculationInfo("stackResultDimension"):t}function e$e(e,t){var r=e.get("coordinateSystem"),n=Uv.get(r),i;return t&&t.coordSysDims&&(i=se(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=kw(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function t$e(e,t,r){var n,i;return r&&B(e,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(e[n].otherDims.itemName=0),n}function Xo(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=lj(e)):(i=n.getSource(),a=i.sourceFormat===Ni);var o=K4e(t),s=e$e(t,o),l=r.useEncodeDefaulter,u=Ce(l)?l:l?Fe(OQ,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=qv(i,c),h=t$e(f.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(f),v=Yee(t,{schema:f,store:d}),g=new En(f,t);g.setCalculationInfo(v);var m=h!=null&&r$e(i)?function(y,_,b,S){return S===h?b:this.defaultDimValueGetter(y,_,b,S)}:null;return g.hasItemOption=!1,g.initData(a?i:d,null,m),g}function r$e(e){if(e.sourceFormat===Ni){var t=n$e(e.data||[]);return!ae(jv(t))}}function n$e(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=Py(o),l=a.niceTickExtent=[gr(Math.ceil(e[0]/o)*o,s),gr(Math.floor(e[1]/o)*o,s)];return a$e(l,e),a}function Z2(e){var t=Math.pow(10,LT(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,gr(r*t)}function Py(e){return Ba(e)+2}function j6(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function a$e(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),j6(e,0,t),j6(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function Cj(e,t){return e>=t[0]&&e<=t[1]}var o$e=function(){function e(){this.normalize=R6,this.scale=B6}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=me(t.normalize,t),this.scale=me(t.scale,t)):(this.normalize=R6,this.scale=B6)},e}();function R6(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function B6(e,t){return e*(t[1]-t[0])+t[0]}function UI(e,t,r){var n=Math.log(e);return[Math.log(r?t[0]:Math.max(0,t[0]))/n,Math.log(r?t[1]:Math.max(0,t[1]))/n]}var ku=function(){function e(t){this._calculator=new o$e,this._setting=t||{},this._extent=[1/0,-1/0];var r=Sr();r&&(this._brkCtx=r.createScaleBreakContext(),this._brkCtx.update(this._extent))}return e.prototype.getSetting=function(t){return this._setting[t]},e.prototype._innerUnionExtent=function(t){var r=this._extent;this._innerSetExtent(t[0]r[1]?t[1]:r[1])},e.prototype.unionExtentFromData=function(t,r){this._innerUnionExtent(t.getApproximateExtent(r))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(t,r){this._innerSetExtent(t,r)},e.prototype._innerSetExtent=function(t,r){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(r)||(n[1]=r),this._brkCtx&&this._brkCtx.update(n)},e.prototype.setBreaksFromOption=function(t){var r=Sr();r&&this._innerSetBreak(r.parseAxisBreakOption(t,me(this.parse,this)))},e.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},e.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},e.prototype.hasBreaks=function(){return this._brkCtx?this._brkCtx.hasBreaks():!1},e.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},e.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(t){this._isBlank=t},e}();IT(ku);var s$e=0,ky=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++s$e,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&se(n,l$e);return new e({categories:i,needCollect:!i,deduplication:r.dedplication!==!1})},e.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},e.prototype.parseAndCollect=function(t){var r,n=this._needCollect;if(!pe(t)&&!n)return t;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=t,this._onCollect&&this._onCollect(t,r),r;var i=this._getOrCreateMap();return r=i.get(t),r==null&&(n?(r=this.categories.length,this.categories[r]=t,i.set(t,r),this._onCollect&&this._onCollect(t,r)):r=NaN),r},e.prototype._getOrCreateMap=function(){return this._map||(this._map=_e(this.categories))},e}();function l$e(e){return ke(e)&&e.value!=null?e.value:e+""}var av=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new ky({})),ae(i)&&(i=new ky({categories:se(i,function(a){return ke(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return t.prototype.parse=function(r){return r==null?NaN:pe(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return Cj(r,this._extent)&&r>=0&&r=0&&r=0&&r=r},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(ku);ku.registerClass(av);var sl=gr,Hs=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return t.prototype.parse=function(r){return r==null||r===""?NaN:Number(r)},t.prototype.contain=function(r){return Cj(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=Py(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=Sr(),l=[];if(!n)return l;if(r.breakTicks==="only_break"&&s)return s.addBreaksToTicks(l,this._brkCtx.breaks,this._extent),l;var u=1e4;i[0]=0&&(f=sl(f+h*n,o))}if(l.length>0&&f===l[l.length-1].value)break;if(l.length>u)return[]}var d=l.length?l[l.length-1].value:a[1];return i[1]>d&&(r.expandToNicedExtent?l.push({value:sl(d+n,o)}):l.push({value:i[1]})),s&&s.pruneTicksByBreak(r.pruneByBreak,l,this._brkCtx.breaks,function(v){return v.value},this._interval,this._extent),r.breakTicks!=="none"&&s&&s.addBreaksToTicks(l,this._brkCtx.breaks,this._extent),l},t.prototype.getMinorTicks=function(r){for(var n=this.getTicks({expandToNicedExtent:!0}),i=[],a=this.getExtent(),o=1;oa[0]&&v0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function Jee(e){var t=f$e(e),r=[];return B(e,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],c=Math.abs(o[1]-o[0]),f=a.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=u?c/h*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var v=ve(n.get("barWidth"),s),g=ve(n.get("barMaxWidth"),s),m=ve(n.get("barMinWidth")||(nte(n)?.5:1),s),y=n.get("barGap"),_=n.get("barCategoryGap"),b=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:v,barMaxWidth:g,barMinWidth:m,barGap:y,barCategoryGap:_,defaultBarGap:b,axisKey:Aj(a),stackId:qee(n)})}),Qee(r)}function Qee(e){var t={};B(e,function(n,i){var a=n.axisKey,o=n.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:n.defaultBarGap||0,stacks:{}},l=s.stacks;t[a]=s;var u=n.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=n.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var f=n.barMaxWidth;f&&(l[u].maxWidth=f);var h=n.barMinWidth;h&&(l[u].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var v=n.barCategoryGap;v!=null&&(s.categoryGap=v)});var r={};return B(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=it(a).length;s=Math.max(35-l*4,15)+"%"}var u=ve(s,o),c=ve(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-u)/(h+(h-1)*c);d=Math.max(d,0),B(a,function(y){var _=y.maxWidth,b=y.minWidth;if(y.width){var S=y.width;_&&(S=Math.min(S,_)),b&&(S=Math.max(S,b)),y.width=S,f-=S+c*S,h--}else{var S=d;_&&_S&&(S=b),S!==d&&(y.width=S,f-=S+c*S,h--)}}),d=(f-u)/(h+(h-1)*c),d=Math.max(d,0);var v=0,g;B(a,function(y,_){y.width||(y.width=d),g=y,v+=y.width*(1+c)}),g&&(v-=g.width*c);var m=-v/2;B(a,function(y,_){r[i][_]=r[i][_]||{bandWidth:o,offset:m,width:y.width},m+=y.width*(1+c)})}),r}function h$e(e,t,r){if(e&&t){var n=e[Aj(t)];return n}}function ete(e,t){var r=Kee(e,t),n=Jee(r);B(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=qee(i),u=n[Aj(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function tte(e){return{seriesType:e,plan:Zv(),reset:function(t){if(rte(t)){var r=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(i.dim)),l=t.get("showBackground",!0),u=r.mapDimension(a.dim),c=r.getCalculationInfo("stackResultDimension"),f=Ws(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),d=d$e(i,a),v=nte(t),g=t.get("barMinHeight")||0,m=c&&r.getDimensionIndex(c),y=r.getLayout("size"),_=r.getLayout("offset");return{progress:function(b,S){for(var T=b.count,C=v&&Co(T*3),A=v&&l&&Co(T*3),P=v&&Co(T),I=n.master.getRect(),k=h?I.width:I.height,E,D=S.getStore(),N=0;(E=b.next())!=null;){var z=D.get(f?m:o,E),F=D.get(s,E),$=d,Z=void 0;f&&(Z=+z-D.get(o,E));var j=void 0,U=void 0,G=void 0,V=void 0;if(h){var Y=n.dataToPoint([z,F]);if(f){var K=n.dataToPoint([Z,F]);$=K[0]}j=$,U=Y[1]+_,G=Y[0]-$,V=y,Math.abs(G)0?r:1:r))}var v$e=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=i_.length,s=Math.min(v$e(i_,this._approxInterval,0,o),o-1);this._interval=i_[s][1],this._intervalPrecision=Py(this._interval),this._minLevelUnit=i_[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return ot(r)?r:+Zo(r)},t.prototype.contain=function(r){return Cj(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.type="time",t}(Hs),i_=[["second",HN],["minute",UN],["hour",em],["quarter-day",em*6],["half-day",em*12],["day",ta*1.2],["half-week",ta*3.5],["week",ta*7],["month",ta*31],["quarter",ta*95],["half-year",PV/2],["year",PV]];function ite(e,t,r,n){return yw(new Date(t),e,n).getTime()===yw(new Date(r),e,n).getTime()}function p$e(e,t){return e/=ta,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function g$e(e){var t=30*ta;return e/=t,e>6?6:e>3?3:e>2?2:1}function m$e(e){return e/=em,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function z6(e,t){return e/=t?UN:HN,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function y$e(e){return _N(e,!0)}function x$e(e,t,r){var n=Math.max(0,We(xi,t)-1);return yw(new Date(e),xi[n],r).getTime()}function _$e(e,t){var r=new Date(0);r[e](1);var n=r.getTime();r[e](1+t);var i=r.getTime()-n;return function(a,o){return Math.max(0,Math.round((o-a)/i))}}function b$e(e,t,r,n,i,a){var o=1e4,s=EBe,l=0;function u(N,z,F,$,Z,j,U){for(var G=_$e(Z,N),V=z,Y=new Date(V);Vo));)if(Y[Z](Y[$]()+N),V=Y.getTime(),a){var K=a.calcNiceTickMultiple(V,G);K>0&&(Y[Z](Y[$]()+K*N),V=Y.getTime())}U.push({value:V,notAdd:!0})}function c(N,z,F){var $=[],Z=!z.length;if(!ite(tm(N),n[0],n[1],r)){Z&&(z=[{value:x$e(n[0],N,r)},{value:n[1]}]);for(var j=0;j=n[0]&&U<=n[1]&&u(V,U,G,Y,K,ee,$),N==="year"&&F.length>1&&j===0&&F.unshift({value:F[0].value-V})}}for(var j=0;j<$.length;j++)F.push($[j])}}for(var f=[],h=[],d=0,v=0,g=0;g=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&v>T/1.5||(f.push(_),d>T||e===s[g]))break}h=[]}}}for(var C=ht(se(f,function(N){return ht(N,function(z){return z.value>=n[0]&&z.value<=n[1]&&!z.notAdd})}),function(N){return N.length>0}),A=[],P=C.length-1,g=0;g0;)a*=10;var s=[YI(S$e(n[0]/a)*a),YI(w$e(n[1]/a)*a)];this._interval=a,this._intervalPrecision=Py(a),this._niceExtent=s}},t.prototype.calcNiceExtent=function(r){e.prototype.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},t.prototype.contain=function(r){return r=o_(r)/o_(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=o_(r)/o_(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),a_(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=Sr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,me(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(Hs);function s_(e,t){return YI(e,Ba(t))}ku.registerClass(ate);var T$e=function(){function e(t,r,n){this._prepareParams(t,r,n)}return e.prototype._prepareParams=function(t,r,n){n[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:f}},e.prototype.modifyDataMinMax=function(t,r){this[A$e[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=C$e[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),C$e={min:"_determinedMin",max:"_determinedMax"},A$e={min:"_dataMin",max:"_dataMax"};function ote(e,t,r){var n=e.rawExtentInfo;return n||(n=new T$e(e,t,r),e.rawExtentInfo=n,n)}function l_(e,t){return t==null?null:gn(t)?NaN:e.parse(t)}function ste(e,t){var r=e.type,n=ote(e,t,e.getExtent()).calculate();e.setBlank(n.isBlank);var i=n.min,a=n.max,o=t.ecModel;if(o&&r==="time"){var s=Kee("bar",o),l=!1;if(B(s,function(f){l=l||f.getBaseAxis()===t.axis}),l){var u=Jee(s),c=M$e(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function M$e(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=h$e(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;B(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;B(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,f=1-(s+l)/a,h=c/f-c;return t+=h*(l/u),e-=h*(s/u),{min:e,max:t}}function mf(e,t){var r=t,n=ste(e,r),i=n.extent,a=r.get("splitNumber");e instanceof ate&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(ute(r)),e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&e.setInterval&&e.setInterval(s)}function y0(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new av({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new Mj({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(ku.getClass(t)||Hs)}}function P$e(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function Kv(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=DBe(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(pe(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Ce(t)){if(e.type==="category")return function(i,a){return t(Lw(e,i),i.value-e.scale.getExtent()[0],null)};var n=Sr();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(Lw(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function Lw(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function Pj(e){var t=e.get("interval");return t??"auto"}function lte(e){return e.type==="category"&&Pj(e.getLabelModel())===0}function Iw(e,t){var r={};return B(e.mapDimensionsAll(t),function(n){r[Tj(e,n)]=!0}),it(r)}function k$e(e,t,r){t&&B(Iw(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function ov(e){return e==="middle"||e==="center"}function Ly(e){return e.getShallow("show")}function ute(e){var t=e.get("breaks",!0);if(t!=null)return!Sr()||!L$e(e.axis)?void 0:t}function L$e(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var Jv=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function I$e(e){return Xo(null,e)}var O$e={isDimensionStacked:Ws,enableDataStack:Yee,getStackedDimension:Tj};function E$e(e,t){var r=t;t instanceof et||(r=new et(t));var n=y0(r);return n.setExtent(e[0],e[1]),mf(n,r),n}function D$e(e){cr(e,Jv)}function N$e(e,t){return t=t||{},Mt(e,null,null,t.state!=="normal")}const j$e=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:U4e,createList:I$e,createScale:E$e,createSymbol:xr,createTextStyle:N$e,dataStack:O$e,enableHoverEmphasis:Xl,getECData:De,getLayoutRect:zt,mixinAxisModelCommonMethods:D$e},Symbol.toStringTag,{value:"Module"}));var R$e=1e-8;function $6(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return z$e(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},t.prototype.getBoundingRect=function(r){var n=this._rect;if(n&&!r)return n;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return B(o,function(s){s.type==="polygon"?F6(s.exterior,i,a,r):B(s.points,function(l){F6(l,i,a,r)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new Oe(i[0],i[1],a[0]-i[0],a[1]-i[1]),r||(this._rect=n),n},t.prototype.contain=function(r){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(r[0],r[1]))return!1;e:for(var a=0,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/r,l/r])}return n}function XI(e,t){return e=F$e(e),se(ht(e.features,function(r){return r.geometry&&r.properties&&r.geometry.coordinates.length>0}),function(r){var n=r.properties,i=r.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new V6(o[0],o.slice(1)));break;case"MultiPolygon":B(i.coordinates,function(l){l[0]&&a.push(new V6(l[0],l.slice(1)))});break;case"LineString":a.push(new G6([i.coordinates]));break;case"MultiLineString":a.push(new G6(i.coordinates))}var s=new fte(n[t||"name"],a,n.cp);return s.properties=n,s})}const V$e=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:uI,asc:Ai,getPercentWithPrecision:sRe,getPixelPrecision:yN,getPrecision:Ba,getPrecisionSafe:lJ,isNumeric:bN,isRadianAroundZero:Qd,linearMap:gt,nice:_N,numericToNumber:$o,parseDate:Zo,parsePercent:ve,quantile:ob,quantity:cJ,quantityExponent:LT,reformIntervals:cI,remRadian:xN,round:gr},Symbol.toStringTag,{value:"Module"})),G$e=Object.freeze(Object.defineProperty({__proto__:null,format:p0,parse:Zo,roundTime:yw},Symbol.toStringTag,{value:"Module"})),W$e=Object.freeze(Object.defineProperty({__proto__:null,Arc:h0,BezierCurve:$v,BoundingRect:Oe,Circle:Yo,CompoundPath:d0,Ellipse:f0,Group:Me,Image:Yr,IncrementalDisplayable:qJ,Line:mr,LinearGradient:Lf,Polygon:bn,Polyline:an,RadialGradient:DN,Rect:Xe,Ring:zv,Sector:_n,Text:at,clipPointsByRect:BN,clipRectByRect:tQ,createIcon:Vv,extendPath:QJ,extendShape:JJ,getShapeClass:by,getTransform:ql,initProps:Dt,makeImage:jN,makePath:tv,mergePath:Si,registerShape:_a,resizePath:RN,updateProps:lt},Symbol.toStringTag,{value:"Module"})),H$e=Object.freeze(Object.defineProperty({__proto__:null,addCommas:QN,capitalFirst:GBe,encodeHTML:In,formatTime:VBe,formatTpl:tj,getTextRect:$Be,getTooltipMarker:yQ,normalizeCssArray:Hv,toCamelCase:ej,truncateText:$Re},Symbol.toStringTag,{value:"Module"})),U$e=Object.freeze(Object.defineProperty({__proto__:null,bind:me,clone:Ae,curry:Fe,defaults:Pe,each:B,extend:ie,filter:ht,indexOf:We,inherits:cN,isArray:ae,isFunction:Ce,isObject:ke,isString:pe,map:se,merge:He,reduce:da},Symbol.toStringTag,{value:"Module"}));var Z$e=Je(),nm=Je(),qa={estimate:1,determine:2};function Ow(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function dte(e,t){var r=se(t,function(n){return e.scale.parse(n)});return e.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function Y$e(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=Kv(e),i=e.scale.getExtent(),a=dte(e,r),o=ht(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:se(o,function(s){var l={value:s};return{formattedLabel:n(l),rawLabel:e.scale.getLabel(l),tickValue:s,time:void 0,break:void 0}})}}return e.type==="category"?q$e(e,t):J$e(e)}function X$e(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=dte(e,n);return{ticks:ht(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?K$e(e,t):{ticks:se(e.scale.getTicks(r),function(o){return o.value})}}function q$e(e,t){var r=e.getLabelModel(),n=vte(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function vte(e,t,r){var n=eFe(e),i=Pj(t),a=r.kind===qa.estimate;if(!a){var o=gte(n,i);if(o)return o}var s,l;Ce(i)?s=xte(e,i):(l=i==="auto"?tFe(e,r):i,s=yte(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return qI(n,i,u),!0}):qI(n,i,u),u}function K$e(e,t){var r=Q$e(e),n=Pj(t),i=gte(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Ce(n))a=xte(e,n,!0);else if(n==="auto"){var s=vte(e,e.getLabelModel(),Ow(qa.determine));o=s.labelCategoryInterval,a=se(s.labels,function(l){return l.tickValue})}else o=n,a=yte(e,o,!0);return qI(r,n,{ticks:a,tickCategoryInterval:o})}function J$e(e){var t=e.scale.getTicks(),r=Kv(e);return{labels:se(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var Q$e=pte("axisTick"),eFe=pte("axisLabel");function pte(e){return function(r){return nm(r)[e]||(nm(r)[e]={list:[]})}}function gte(e,t){for(var r=0;rc&&(u=Math.max(1,Math.floor(l/c)));for(var f=s[0],h=e.dataToCoord(f+1)-e.dataToCoord(f),d=Math.abs(h*Math.cos(a)),v=Math.abs(h*Math.sin(a)),g=0,m=0;f<=s[1];f+=u){var y=0,_=0,b=PT(i({value:f}),n.font,"center","top");y=b.width*1.3,_=b.height*1.3,g=Math.max(g,y,7),m=Math.max(m,_,7)}var S=g/d,T=m/v;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var C=Math.max(0,Math.floor(Math.min(S,T)));if(r===qa.estimate)return t.out.noPxChangeTryDetermine.push(me(nFe,null,e,C,l)),C;var A=mte(e,C,l);return A??C}function nFe(e,t,r){return mte(e,t,r)==null}function mte(e,t,r){var n=Z$e(e.model),i=e.getExtent(),a=n.lastAutoInterval,o=n.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-r)<=1&&a>t&&n.axisExtent0===i[0]&&n.axisExtent1===i[1])return a;n.lastTickCount=r,n.lastAutoInterval=t,n.axisExtent0=i[0],n.axisExtent1=i[1]}function iFe(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function yte(e,t,r){var n=Kv(e),i=e.scale,a=i.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],c=i.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var f=lte(e),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&u!==a[0]&&g(a[0]);for(var v=u;v<=a[1];v+=l)g(v);d&&v-l!==a[1]&&g(a[1]);function g(m){var y={value:m};s.push(r?m:{formattedLabel:n(y),rawLabel:i.getLabel(y),tickValue:m,time:void 0,break:void 0})}return s}function xte(e,t,r){var n=e.scale,i=Kv(e),a=[];return B(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;t(o.value,s)&&a.push(r?l:{formattedLabel:i(o),rawLabel:s,tickValue:l,time:void 0,break:void 0})}),a}var W6=[0,1],ba=function(){function e(t,r,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=r,this._extent=n||[0,0]}return e.prototype.contain=function(t){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return t>=n&&t<=i},e.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(t){return yN(t||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(t,r){var n=this._extent;n[0]=t,n[1]=r},e.prototype.dataToCoord=function(t,r){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&i.type==="ordinal"&&(n=n.slice(),H6(n,i.count())),gt(t,W6,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),H6(n,i.count()));var a=gt(t,n,W6,r);return this.scale.scale(a)},e.prototype.pointToData=function(t,r){},e.prototype.getTicksCoords=function(t){t=t||{};var r=t.tickModel||this.getTickModel(),n=X$e(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=se(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return aFe(this,a,o,t.clamp),a},e.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),r=t.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=se(n,function(a){return se(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||Ow(qa.determine),Y$e(this,t).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var t=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},e.prototype.calculateCategoryInterval=function(t){return t=t||Ow(qa.determine),rFe(this,t)},e}();function H6(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function aFe(e,t,r,n){var i=t.length;if(!e.onBand||r||!i)return;var a=e.getExtent(),o,s;if(i===1)t[0].coord=a[0],t[0].onBand=!0,o=t[1]={coord:a[1],tickValue:t[0].tickValue,onBand:!0};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;B(t,function(d){d.coord-=u/2,d.onBand=!0});var c=e.scale.getExtent();s=1+c[1]-t[i-1].tickValue,o={coord:t[i-1].coord+u*s,tickValue:c[1]+1,onBand:!0},t.push(o)}var f=a[0]>a[1];h(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&h(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),h(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&h(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function h(d,v){return d=gr(d),v=gr(v),f?d>v:di&&(i+=Yp);var d=Math.atan2(s,o);if(d<0&&(d+=Yp),d>=n&&d<=i||d+Yp>=n&&d+Yp<=i)return l[0]=c,l[1]=f,u-r;var v=r*Math.cos(n)+e,g=r*Math.sin(n)+t,m=r*Math.cos(i)+e,y=r*Math.sin(i)+t,_=(v-o)*(v-o)+(g-s)*(g-s),b=(m-o)*(m-o)+(y-s)*(y-s);return _0){t=t/180*Math.PI,za.fromArray(e[0]),Ot.fromArray(e[1]),dr.fromArray(e[2]),Ie.sub(Ao,za,Ot),Ie.sub(_o,dr,Ot);var r=Ao.len(),n=_o.len();if(!(r<.001||n<.001)){Ao.scale(1/r),_o.scale(1/n);var i=Ao.dot(_o),a=Math.cos(t);if(a1&&Ie.copy(Fn,dr),Fn.toArray(e[1])}}}}function pFe(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,za.fromArray(e[0]),Ot.fromArray(e[1]),dr.fromArray(e[2]),Ie.sub(Ao,Ot,za),Ie.sub(_o,dr,Ot);var n=Ao.len(),i=_o.len();if(!(n<.001||i<.001)){Ao.scale(1/n),_o.scale(1/i);var a=Ao.dot(t),o=Math.cos(r);if(a=l)Ie.copy(Fn,dr);else{Fn.scaleAndAdd(_o,s/Math.tan(Math.PI/2-c));var f=dr.x!==Ot.x?(Fn.x-Ot.x)/(dr.x-Ot.x):(Fn.y-Ot.y)/(dr.y-Ot.y);if(isNaN(f))return;f<0?Ie.copy(Fn,Ot):f>1&&Ie.copy(Fn,dr)}Fn.toArray(e[1])}}}}function q2(e,t,r,n){var i=r==="normal",a=i?e:e.ensureState(r);a.ignore=t;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=n.getModel("lineStyle").getLineStyle();i?e.useStyle(s):a.style=s}function gFe(e,t){var r=t.smooth,n=t.points;if(n)if(e.moveTo(n[0][0],n[0][1]),r>0&&n.length>=3){var i=ms(n[0],n[1]),a=ms(n[1],n[2]);if(!i||!a){e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*r,s=Zg([],n[1],n[0],o/i),l=Zg([],n[1],n[2],o/a),u=Zg([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var c=1;c0){S(k*I,0,a);var E=k+A;E<0&&T(-E*I,1)}else T(-A*I,1)}}function S(A,P,I){A!==0&&(c=!0);for(var k=P;k0)for(var E=0;E0;E--){var F=I[E-1]*z;S(-F,E,a)}}}function C(A){var P=A<0?-1:1;A=Math.abs(A);for(var I=Math.ceil(A/(a-1)),k=0;k0?S(I,0,k+1):S(-I,a-k-1,a),A-=I,A<=0)return}return c}function xFe(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),We(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),lt(n,u,r,l)}else if(n.attr(u),!Gv(n).valueAnimation){var f=be(n.style.opacity,1);n.style.opacity=0,Dt(n,{style:{opacity:f}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};u_(d,u,c_),u_(d,n.states.select,c_)}if(n.states.emphasis){var v=a.oldLayoutEmphasis={};u_(v,u,c_),u_(v,n.states.emphasis,c_)}sQ(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=wFe(i),o=a.oldLayout,g={points:i.shape.points};o?(i.attr({shape:o}),lt(i,{shape:g},r)):(i.setShape(g),i.style.strokePercent=0,Dt(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},e}(),Q2=Je();function TFe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=Q2(r).labelManager;i||(i=Q2(r).labelManager=new SFe),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=Q2(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var eM=Math.sin,tM=Math.cos,Ate=Math.PI,ac=Math.PI*2,CFe=180/Ate,Mte=function(){function e(){}return e.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},e.prototype.moveTo=function(t,r){this._add("M",t,r)},e.prototype.lineTo=function(t,r){this._add("L",t,r)},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){this._add("C",t,r,n,i,a,o)},e.prototype.quadraticCurveTo=function(t,r,n,i){this._add("Q",t,r,n,i)},e.prototype.arc=function(t,r,n,i,a,o){this.ellipse(t,r,n,n,0,i,a,o)},e.prototype.ellipse=function(t,r,n,i,a,o,s,l){var u=s-o,c=!l,f=Math.abs(u),h=Ol(f-ac)||(c?u>=ac:-u>=ac),d=u>0?u%ac:u%ac+ac,v=!1;h?v=!0:Ol(f)?v=!1:v=d>=Ate==!!c;var g=t+n*tM(o),m=r+i*eM(o);this._start&&this._add("M",g,m);var y=Math.round(a*CFe);if(h){var _=1/this._p,b=(c?1:-1)*(ac-_);this._add("A",n,i,y,1,+c,t+n*tM(o+b),r+i*eM(o+b)),_>.01&&this._add("A",n,i,y,0,+c,g,m)}else{var S=t+n*tM(s),T=r+i*eM(s);this._add("A",n,i,y,+v,+c,S,T)}},e.prototype.rect=function(t,r,n,i){this._add("M",t,r),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(t,r,n,i,a,o,s,l,u){for(var c=[],f=this._p,h=1;h"}function DFe(e){return""}function Oj(e,t){t=t||{};var r=t.newline?` -`:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return EFe(o,s)+(o!=="style"?In(l):l||"")+(a?""+r+se(a,function(u){return n(u)}).join(r)+r:"")+DFe(o)}return n(e)}function NFe(e,t,r){r=r||{};var n=r.newline?` -`:"",i=" {"+n,a=n+"}",o=se(it(e),function(l){return l+i+se(it(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=se(it(t),function(l){return"@keyframes "+l+i+se(it(t[l]),function(u){return u+i+se(it(t[l][u]),function(c){var f=t[l][u][c];return c==="d"&&(f='path("'+f+'")'),c+":"+f+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function tO(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function K6(e,t,r,n){return Gr("svg","root",{width:e,height:t,xmlns:Pte,"xmlns:xlink":kte,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var jFe=0;function Ite(){return jFe++}var J6={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},dc="transform-origin";function RFe(e,t,r){var n=ie({},e.shape);ie(n,t),e.buildPath(r,n);var i=new Mte;return i.reset(KK(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function BFe(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[dc]=r+"px "+n+"px")}var zFe={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Ote(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function $Fe(e,t,r){var n=e.shape.paths,i={},a,o;if(B(n,function(l){var u=tO(r.zrId);u.animation=!0,qT(l,{},u,!0);var c=u.cssAnims,f=u.cssNodes,h=it(c),d=h.length;if(d){o=h[d-1];var v=c[o];for(var g in v){var m=v[g];i[g]=i[g]||{d:""},i[g].d+=m.d||""}for(var y in f){var _=f[y].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){t.d=!1;var s=Ote(i,r);return a.replace(o,s)}}function Q6(e){return pe(e)?J6[e]?"cubic-bezier("+J6[e]+")":vN(e)?e:"":""}function qT(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof d0){var s=$Fe(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Re=Ote(A,r);return Re+" "+_[0]+" both"}}for(var m in l){var s=g(l[m]);s&&o.push(s)}if(o.length){var y=r.zrId+"-cls-"+Ite();r.cssNodes["."+y]={animation:o.join(",")},t.class=y}}function FFe(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};eG(n,t,r)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,l=e.currentStates.indexOf("select")>=0&&s||o;l&&(a=ow(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&e.transform?e.transform[0]:1;u=u/c}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),eG(n,t,r)}}function eG(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+Ite(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var Iy=Math.round;function Ete(e){return e&&pe(e.src)}function Dte(e){return e&&Ce(e.toDataURL)}function Ej(e,t,r,n){LFe(function(i,a){var o=i==="fill"||i==="stroke";o&&qK(a)?jte(t,e,i,n):o&&gN(a)?Rte(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),YFe(r,e,n)}function Dj(e,t){var r=aJ(t);r&&(r.each(function(n,i){n!=null&&(e[(q6+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[q6+"silent"]="true"))}function tG(e){return Ol(e[0]-1)&&Ol(e[1])&&Ol(e[2])&&Ol(e[3]-1)}function VFe(e){return Ol(e[4])&&Ol(e[5])}function Nj(e,t,r){if(t&&!(VFe(t)&&tG(t))){var n=1e4;e.transform=tG(t)?"translate("+Iy(t[4]*n)/n+" "+Iy(t[5]*n)/n+")":Sje(t)}}function rG(e,t,r){for(var n=e.points,i=[],a=0;a"u"){var m="Image width/height must been given explictly in svg-ssr renderer.";xn(h,m),xn(d,m)}else if(h==null||d==null){var y=function(k,E){if(k){var D=k.elm,N=h||E.width,z=d||E.height;k.tag==="pattern"&&(u?(z=1,N/=a.width):c&&(N=1,z/=a.height)),k.attrs.width=N,k.attrs.height=z,D&&(D.setAttribute("width",N),D.setAttribute("height",z))}},_=CN(v,null,e,function(k){l||y(C,k),y(f,k)});_&&_.width&&_.height&&(h=h||_.width,d=d||_.height)}f=Gr("image","img",{href:v,width:h,height:d}),o.width=h,o.height=d}else i.svgElement&&(f=Ae(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(f){var b,S;l?b=S=1:u?(S=1,b=o.width/a.width):c?(b=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",b!=null&&!isNaN(b)&&(o.width=b),S!=null&&!isNaN(S)&&(o.height=S);var T=JK(i);T&&(o.patternTransform=T);var C=Gr("pattern","",o,[f]),A=Oj(C),P=n.patternCache,I=P[A];I||(I=n.zrId+"-p"+n.patternIdx++,P[A]=I,o.id=I,C=n.defs[I]=Gr("pattern",I,o,[f])),t[r]=MT(I)}}function XFe(e,t,r){var n=r.clipPathCache,i=r.defs,a=n[e.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[e.id]=a,i[a]=Gr("clipPath",a,o,[Nte(e,r)])}t["clip-path"]=MT(a)}function aG(e){return document.createTextNode(e)}function _c(e,t,r){e.insertBefore(t,r)}function oG(e,t){e.removeChild(t)}function sG(e,t){e.appendChild(t)}function Bte(e){return e.parentNode}function zte(e){return e.nextSibling}function rM(e,t){e.textContent=t}var lG=58,qFe=120,KFe=Gr("","");function rO(e){return e===void 0}function go(e){return e!==void 0}function JFe(e,t,r){for(var n={},i=t;i<=r;++i){var a=e[i].key;a!==void 0&&(n[a]=i)}return n}function Tg(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function Oy(e){var t,r=e.children,n=e.tag;if(go(n)){var i=e.elm=Lte(n);if(jj(KFe,e),ae(r))for(t=0;ta?(v=r[l+1]==null?null:r[l+1].elm,$te(e,v,r,i,l)):Rw(e,t,n,a))}function Ph(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(jj(e,t),rO(t.text)?go(n)&&go(i)?n!==i&&QFe(r,n,i):go(i)?(go(e.text)&&rM(r,""),$te(r,null,i,0,i.length-1)):go(n)?Rw(r,n,0,n.length-1):go(e.text)&&rM(r,""):e.text!==t.text&&(go(n)&&Rw(r,n,0,n.length-1),rM(r,t.text)))}function eVe(e,t){if(Tg(e,t))Ph(e,t);else{var r=e.elm,n=Bte(r);Oy(t),n!==null&&(_c(n,t.elm,zte(r)),Rw(n,[e],0,0))}return t}var tVe=0,rVe=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=uG(),this.configLayer=uG(),this.storage=r,this._opts=n=ie({},n),this.root=t,this._id="zr"+tVe++,this._oldVNode=K6(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=Lte("svg");jj(null,this._oldVNode),i.appendChild(a),t.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",eVe(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return iG(t,tO(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=tO(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=nVe(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Gr("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=se(it(a.defs),function(h){return a.defs[h]});if(u.length&&o.push(Gr("defs","defs",{},u)),t.animation){var c=NFe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=Gr("style","stl",{},[],c);o.push(f)}}return K6(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},Oj(this.renderToVNode({animation:be(t.cssAnimation,!0),emphasis:be(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:be(t.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(t,r,n){for(var i=t.length,a=[],o=0,s,l,u=0,c=0;c=0&&!(h&&l&&h[g]===l[g]);g--);for(var m=v-1;m>g;m--)o--,s=a[o-1];for(var y=g+1;y=s)}}for(var f=this.__startIndex;f15)break}}z.prevElClipPaths&&y.restore()};if(_)if(_.length===0)P=m.__endIndex;else for(var k=d.dpr,E=0;E<_.length;++E){var D=_[E];y.save(),y.beginPath(),y.rect(D.x*k,D.y*k,D.width*k,D.height*k),y.clip(),I(D),y.restore()}else y.save(),I(),y.restore();m.__drawIndex=P,m.__drawIndex0&&t>i[0]){for(l=0;lt);l++);s=n[i[l]]}if(i.splice(l+1,0,t),n[t]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},e.prototype.eachLayer=function(t,r){for(var n=this._zlevelList,i=0;i0?f_:0),this._needsManuallyCompositing),c.__builtin__||wT("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,r(l),a=c),i.__dirty&wi&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(t){t.clear()},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t,B(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var n=this._layerConfig;n[t]?He(n[t],r,!0):n[t]=r;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill=J.color.neutral00,u.style.lineWidth=2),n},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(Tt);function sv(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=nv(e,t,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(t[a])}return n.join(" ")}var x0=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return o.updateData(r,n,i,a),o}return t.prototype._createSymbol=function(r,n,i,a,o,s){this.removeAll();var l=xr(r,-1,-1,2,2,null,s);l.attr({z2:be(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=fVe,this._symbolType=r,this.add(l)},t.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Fs(this.childAt(0))},t.prototype.downplay=function(){Vs(this.childAt(0))},t.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},t.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},t.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=t.getSymbolSize(r,n),u=t.getSymbolZ2(r,n),c=o!==this._symbolType,f=a&&a.disableAnimation;if(c){var h=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,h)}else{var d=this.childAt(0);d.silent=!1;var v={scaleX:l[0]/2,scaleY:l[1]/2};f?d.attr(v):lt(d,v,s,n),ga(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!f){var v={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Dt(d,v,s,n)}}f&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,c,f,h,d,v,g,m,y;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,f=a.selectItemStyle,h=a.focus,d=a.blurScope,g=a.labelStatesModels,m=a.hoverScale,y=a.cursorStyle,v=a.emphasisDisabled),!a||r.hasItemOption){var _=a&&a.itemModel?a.itemModel:r.getItemModel(n),b=_.getModel("emphasis");u=b.getModel("itemStyle").getItemStyle(),f=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),v=b.get("disabled"),g=Nr(_),m=b.getShallow("scale"),y=_.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=Df(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),y&&s.attr("cursor",y);var C=r.getItemVisual(n,"style"),A=C.fill;if(s instanceof Yr){var P=s.style;s.useStyle(ie({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},C))}else s.__isEmptyBrush?s.useStyle(ie({},C)):s.useStyle(C),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var I=r.getItemVisual(n,"liftZ"),k=this._z2;I!=null?k==null&&(this._z2=s.z2,s.z2+=I):k!=null&&(s.z2=k,this._z2=null);var E=o&&o.useNameLabel;Ur(s,g,{labelFetcher:l,labelDataIndex:n,defaultText:D,inheritColor:A,defaultOpacity:C.opacity});function D(F){return E?r.getName(F):sv(r,F)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var N=s.ensureState("emphasis");N.style=u,s.ensureState("select").style=f,s.ensureState("blur").style=c;var z=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;N.scaleX=this._sizeX*z,N.scaleY=this._sizeY*z,this.setSymbolScale(1),Gt(this,h,d,v)},t.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},t.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),o=De(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&cu(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();cu(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return Xv(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Me);function fVe(e,t){this.parent.drift(e,t)}function iM(e,t,r,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&e.getItemVisual(r,"symbol")!=="none"}function hG(e){return e!=null&&!ke(e)&&(e={isIgnore:e}),e||{}}function dG(e){var t=e.hostModel,r=t.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Nr(t),cursorStyle:t.get("cursor")}}var _0=function(){function e(t){this.group=new Me,this._SymbolCtor=t||x0}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=hG(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=dG(t),u={disableAnimation:s},c=r.getSymbolPoint||function(f){return t.getItemLayout(f)};a||n.removeAll(),t.diff(a).add(function(f){var h=c(f);if(iM(t,h,f,r)){var d=new o(t,f,l,u);d.setPosition(h),t.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=a.getItemGraphicEl(h),v=c(f);if(!iM(t,v,f,r)){n.remove(d);return}var g=t.getItemVisual(f,"symbol")||"circle",m=d&&d.getSymbolType&&d.getSymbolType();if(!d||m&&m!==g)n.remove(d),d=new o(t,f,l,u),d.setPosition(v);else{d.updateData(t,f,l,u);var y={x:v[0],y:v[1]};s?d.attr(y):lt(d,y,i)}n.add(d),t.setItemGraphicEl(f,d)}).remove(function(f){var h=a.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},i)}).execute(),this._getSymbolPoint=c,this._data=t},e.prototype.updateLayout=function(){var t=this,r=this._data;r&&r.eachItemGraphicEl(function(n,i){var a=t._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=dG(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=hG(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a0?r=n[0]:n[1]<0&&(r=n[1]),r}function Gte(e,t,r,n){var i=NaN;e.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=r.get(e.baseDim,n),o[1-a]=i,t.dataToPoint(o)}function dVe(e,t){var r=[];return t.diff(e).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,i){r.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function vVe(e,t,r,n,i,a,o,s){for(var l=dVe(e,t),u=[],c=[],f=[],h=[],d=[],v=[],g=[],m=Vte(i,t,o),y=e.getLayout("points")||[],_=t.getLayout("points")||[],b=0;b=i||g<0)break;if(Xc(y,_)){if(l){g+=a;continue}break}if(g===r)e[a>0?"moveTo":"lineTo"](y,_),f=y,h=_;else{var b=y-u,S=_-c;if(b*b+S*S<.5){g+=a;continue}if(o>0){for(var T=g+a,C=t[T*2],A=t[T*2+1];C===y&&A===_&&m=n||Xc(C,A))d=y,v=_;else{k=C-u,E=A-c;var z=y-u,F=C-y,$=_-c,Z=A-_,j=void 0,U=void 0;if(s==="x"){j=Math.abs(z),U=Math.abs(F);var G=k>0?1:-1;d=y-G*j*o,v=_,D=y+G*U*o,N=_}else if(s==="y"){j=Math.abs($),U=Math.abs(Z);var V=E>0?1:-1;d=y,v=_-V*j*o,D=y,N=_+V*U*o}else j=Math.sqrt(z*z+$*$),U=Math.sqrt(F*F+Z*Z),I=U/(U+j),d=y-k*o*(1-I),v=_-E*o*(1-I),D=y+k*o*I,N=_+E*o*I,D=ll(D,ul(C,y)),N=ll(N,ul(A,_)),D=ul(D,ll(C,y)),N=ul(N,ll(A,_)),k=D-y,E=N-_,d=y-k*j/U,v=_-E*j/U,d=ll(d,ul(u,y)),v=ll(v,ul(c,_)),d=ul(d,ll(u,y)),v=ul(v,ll(c,_)),k=y-d,E=_-v,D=y+k*U/j,N=_+E*U/j}e.bezierCurveTo(f,h,d,v,y,_),f=D,h=N}else e.lineTo(y,_)}u=y,c=_,g+=a}return m}var Wte=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),pVe=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polyline",n}return t.prototype.getDefaultStyle=function(){return{stroke:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new Wte},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Xc(i[o*2-2],i[o*2-1]);o--);for(;a=0){var S=u?(v-l)*b+l:(d-s)*b+s;return u?[r,S]:[S,r]}s=d,l=v;break;case o.C:d=a[f++],v=a[f++],g=a[f++],m=a[f++],y=a[f++],_=a[f++];var T=u?iw(s,d,g,y,r,c):iw(l,v,m,_,r,c);if(T>0)for(var C=0;C=0){var S=u?$r(l,v,m,_,A):$r(s,d,g,y,A);return u?[r,S]:[S,r]}}s=y,l=_;break}}},t}(tt),gVe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Wte),Hte=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polygon",n}return t.prototype.getDefaultShape=function(){return new gVe},t.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Xc(i[s*2-2],i[s*2-1]);s--);for(;ot){a?r.push(o(a,l,t)):i&&r.push(o(i,l,0),o(i,l,t));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function xVe(e,t,r){var n=e.getVisual("visualMeta");if(!(!n||!n.length||!e.count())&&t.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=e.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=t.getAxis(i),u=se(a.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),c=u.length,f=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),f.reverse());var h=yVe(u,i==="x"?r.getWidth():r.getHeight()),d=h.length;if(!d&&c)return u[0].coord<0?f[1]?f[1]:u[c-1].color:f[0]?f[0]:u[0].color;var v=10,g=h[0].coord-v,m=h[d-1].coord+v,y=m-g;if(y<.001)return"transparent";B(h,function(b){b.offset=(b.coord-g)/y}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var _=new Lf(0,0,0,0,h,!0);return _[i]=g,_[i+"2"]=m,_}}}function _Ve(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&bVe(a,t))){var o=t.mapDimension(a.dim),s={};return B(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function bVe(e,t){var r=e.getExtent(),n=Math.abs(r[1]-r[0])/e.scale.count();isNaN(n)&&(n=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function wVe(e,t){return isNaN(e)||isNaN(t)}function SVe(e){for(var t=e.length/2;t>0&&wVe(e[t*2-2],e[t*2-1]);t--);return t-1}function yG(e,t){return[e[t*2],e[t*2+1]]}function TVe(e,t,r){for(var n=e.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function Yte(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var U=v.getState("emphasis").style;U.lineWidth=+v.style.lineWidth+1}De(v).seriesIndex=r.seriesIndex,Gt(v,$,Z,j);var G=mG(r.get("smooth")),V=r.get("smoothMonotone");if(v.setShape({smooth:G,smoothMonotone:V,connectNulls:A}),g){var Y=s.getCalculationInfo("stackedOnSeries"),K=0;g.useStyle(Pe(u.getAreaStyle(),{fill:D,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Y&&(K=mG(Y.get("smooth"))),g.setShape({smooth:G,stackedOnSmooth:K,smoothMonotone:V,connectNulls:A}),Dr(g,r,"areaStyle"),De(g).seriesIndex=r.seriesIndex,Gt(g,$,Z,j)}var ee=this._changePolyState;s.eachItemGraphicEl(function(le){le&&(le.onHoverStateChange=ee)}),this._polyline.onHoverStateChange=ee,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=k,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,v),g&&this.packEventData(r,g))},t.prototype.packEventData=function(r,n){De(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},t.prototype.highlight=function(r,n,i,a){var o=r.getData(),s=ff(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],f=l[s*2+1];if(isNaN(c)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,f))return;var h=r.get("zlevel")||0,d=r.get("z")||0;u=new x0(o,s),u.x=c,u.y=f,u.setZ(h,d);var v=u.getSymbolPath().getTextContent();v&&(v.zlevel=h,v.z=d,v.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else bt.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=ff(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else bt.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;pw(this._polyline,r),n&&pw(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new pVe({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},t.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new Hte({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},t.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,c=u.get("animationDuration");Ce(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=Ce(f)?f(null):f;r.eachItemGraphicEl(function(d,v){var g=d;if(g){var m=[d.x,d.y],y=void 0,_=void 0,b=void 0;if(i)if(o){var S=i,T=n.pointToCoord(m);a?(y=S.startAngle,_=S.endAngle,b=-T[1]/180*Math.PI):(y=S.r0,_=S.r,b=T[0])}else{var C=i;a?(y=C.x,_=C.x+C.width,b=d.x):(y=C.y+C.height,_=C.y,b=d.y)}var A=_===y?0:(b-y)/(_-y);l&&(A=1-A);var P=Ce(f)?f(v):c*A+h,I=g.getSymbolPath(),k=I.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),k&&k.animateFrom({style:{opacity:0}},{duration:300,delay:P}),I.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(Yte(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new at({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=SVe(l);c>=0&&(Ur(s,Nr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(f,h,d){return d!=null?Fte(o,d):sv(o,f)},enableTextSetter:!0},CVe(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(r,n,i,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var f=i.getLayout("points"),h=i.hostModel,d=h.get("connectNulls"),v=s.get("precision"),g=s.get("distance")||0,m=l.getBaseAxis(),y=m.isHorizontal(),_=m.inverse,b=n.shape,S=_?y?b.x:b.y+b.height:y?b.x+b.width:b.y,T=(y?g:0)*(_?-1:1),C=(y?0:-g)*(_?-1:1),A=y?"x":"y",P=TVe(f,S,A),I=P.range,k=I[1]-I[0],E=void 0;if(k>=1){if(k>1&&!d){var D=yG(f,I[0]);u.attr({x:D[0]+T,y:D[1]+C}),o&&(E=h.getRawValue(I[0]))}else{var D=c.getPointOn(S,A);D&&u.attr({x:D[0]+T,y:D[1]+C});var N=h.getRawValue(I[0]),z=h.getRawValue(I[1]);o&&(E=xJ(i,v,N,z,P.t))}a.lastFrameIndex=I[0]}else{var F=r===1||a.lastFrameIndex>0?I[0]:0,D=yG(f,F);o&&(E=h.getRawValue(F)),u.attr({x:D[0]+T,y:D[1]+C})}if(o){var $=Gv(u);typeof $.setLabelText=="function"&&$.setLabelText(E)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,f=r.hostModel,h=vVe(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=h.current,v=h.stackedOnCurrent,g=h.next,m=h.stackedOnNext;if(o&&(v=cl(h.stackedOnCurrent,h.current,i,o,l),d=cl(h.current,null,i,o,l),m=cl(h.stackedOnNext,h.next,i,o,l),g=cl(h.next,null,i,o,l)),gG(d,g)>3e3||c&&gG(v,m)>3e3){u.stopAnimation(),u.setShape({points:g}),c&&(c.stopAnimation(),c.setShape({points:g,stackedOnPoints:m}));return}u.shape.__points=h.current,u.shape.points=d;var y={shape:{points:g}};h.current!==d&&(y.shape.__points=h.next),u.stopAnimation(),lt(u,y,f),c&&(c.setShape({points:d,stackedOnPoints:v}),c.stopAnimation(),lt(c,{shape:{stackedOnPoints:m}},f),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],b=h.status,S=0;St&&(t=e[r]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,r=0;r10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),f=n.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(f||1),d=Math.round(s/h);if(isFinite(d)&&d>1){a==="lttb"?t.setData(i.lttbDownSample(i.mapDimension(u.dim),1/d)):a==="minmax"&&t.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/d));var v=void 0;pe(a)?v=MVe[a]:Ce(a)&&(v=a),v&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,v,PVe))}}}}}function kVe(e){e.registerChartView(AVe),e.registerSeriesModel(cVe),e.registerLayout(w0("line",!0)),e.registerVisual({seriesType:"line",reset:function(t){var r=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,Xte("line"))}var Ey=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return Xo(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(r,n,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(r),s=a.dataToPoint(o);if(i)B(a.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var v=h.getTicksCoords(),g=h.getTickModel().get("alignWithLabel"),m=o[d],y=n[d]==="x1"||n[d]==="y1";if(y&&!g&&(m+=1),v.length<2)return;if(v.length===2){s[d]=h.toGlobalCoord(h.getExtent()[y?1:0]);return}for(var _=void 0,b=void 0,S=1,T=0;Tm){b=(C+_)/2;break}T===1&&(S=A-v[0].tickValue)}b==null&&(_?_&&(b=v[v.length-1].coord):b=v[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),f=a.getBaseAxis().isHorizontal()?0:1;s[f]+=u+c/2}return s}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},t}(Tt);Tt.registerClass(Ey);var LVe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(){return Xo(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},t.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=Mu(Ey.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:J.color.primary,borderWidth:2}},realtimeSort:!1}),t}(Ey),IVe=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),Bw=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="sausage",n}return t.prototype.getDefaultShape=function(){return new IVe},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,c=n.startAngle,f=n.endAngle,h=n.clockwise,d=Math.PI*2,v=h?f-cMath.PI/2&&cs)return!0;s=f}return!1},t.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},t.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},t.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Ps(a,r,De(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(bt),xG={cartesian2d:function(e,t){var r=t.width<0?-1:1,n=t.height<0?-1:1;r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=oM(t.x,e.x),s=sM(t.x+t.width,i),l=oM(t.y,e.y),u=sM(t.y+t.height,a),c=si?s:o,t.y=f&&l>a?u:l,t.width=c?0:s-o,t.height=f?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),c||f},polar:function(e,t){var r=t.r0<=t.r?1:-1;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}var i=sM(t.r,e.r),a=oM(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}return o}},_G={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Xe({shape:ie({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var c=u.shape,f=i?"height":"width";c[f]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?Bw:_n,c=new u({shape:n,z2:1});c.name="item";var f=qte(i);if(c.calculateTextPosition=OVe(f,{isRoundCap:u===Bw}),a){var h=c.shape,d=i?"r":"endAngle",v={};h[d]=i?n.r0:n.startAngle,v[d]=n[d],(s?lt:Dt)(c,{shape:v},a)}return c}};function jVe(e,t){var r=e.get("realtimeSort",!0),n=t.getBaseAxis();if(r&&n.type==="category"&&t.type==="cartesian2d")return{baseAxis:n,otherAxis:t.getOtherAxis(n)}}function bG(e,t,r,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?lt:Dt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?lt:Dt)(r,{shape:u},c,i)}function wG(e,t){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(e,t,r){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function zVe(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function qte(e){return function(t){var r=t?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}}(e)}function TG(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var c=e.shape,f=Mo(n.getModel("itemStyle"),c,!0);ie(c,f),e.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var h=n.getShallow("cursor");h&&e.attr("cursor",h);var d=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",v=Nr(n);Ur(e,v,{labelFetcher:a,labelDataIndex:r,defaultText:sv(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var g=e.getTextContent();if(s&&g){var m=n.get(["label","position"]);e.textConfig.inside=m==="middle"?!0:null,EVe(e,m==="outside"?d:m,qte(o),n.get(["label","rotate"]))}oQ(g,v,a.getRawValue(r),function(_){return Fte(t,_)});var y=n.getModel(["emphasis"]);Gt(e,y.get("focus"),y.get("blurScope"),y.get("disabled")),Dr(e,n),zVe(i)&&(e.style.fill="none",e.style.stroke="none",B(e.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function $Ve(e,t){var r=e.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,a)}var FVe=function(){function e(){}return e}(),CG=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="largeBar",n}return t.prototype.getDefaultShape=function(){return new FVe},t.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c=0?r:null},30,!1);function VVe(e,t,r){for(var n=e.baseDimIdx,i=1-n,a=e.shape.points,o=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,f=a.length/3;c=s[0]&&t<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[c]}return-1}function Kte(e,t,r){if(fu(r,"cartesian2d")){var n=t,i=r.getArea();return{x:e?n.x:i.x,y:e?i.y:n.y,width:e?n.width:i.width,height:e?i.height:n.height}}else{var i=r.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}}function GVe(e,t,r){var n=e.type==="polar"?_n:Xe;return new n({shape:Kte(t,r,e),silent:!0,z2:0})}function WVe(e){e.registerChartView(NVe),e.registerSeriesModel(LVe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(ete,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,tte("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,Xte("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,r){var n=t.componentType||"series";r.eachComponent({mainType:n,query:t},function(i){t.sortInfo&&i.axis.setCategorySortInfo(t.sortInfo)})})}var PG=Math.PI*2,p_=Math.PI/180;function HVe(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=TQ(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=o.viewRect,h=-n.get("startAngle")*p_,d=n.get("endAngle"),v=n.get("padAngle")*p_;d=d==="auto"?h-PG:-d*p_;var g=n.get("minAngle")*p_,m=g+v,y=0;i.each(a,function(Z){!isNaN(Z)&&y++});var _=i.getSum(a),b=Math.PI/(_||y)*2,S=n.get("clockwise"),T=n.get("roseType"),C=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var P=S?1:-1,I=[h,d],k=P*v/2;NT(I,!S),h=I[0],d=I[1];var E=Jte(n);E.startAngle=h,E.endAngle=d,E.clockwise=S,E.cx=s,E.cy=l,E.r=u,E.r0=c;var D=Math.abs(d-h),N=D,z=0,F=h;if(i.setLayout({viewRect:f,r:u}),i.each(a,function(Z,j){var U;if(isNaN(Z)){i.setItemLayout(j,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?U=_===0&&C?b:Z*b:U=D/y,UU?(V=F+P*U/2,Y=V):(V=F+k,Y=G-k),i.setItemLayout(j,{angle:U,startAngle:V,endAngle:Y,clockwise:S,cx:s,cy:l,r0:c,r:T?gt(Z,A,[c,u]):u}),F=G}),Nr?y:m,T=Math.abs(b.label.y-r);if(T>=S.maxY){var C=b.label.x-t-b.len2*i,A=n+b.len,P=Math.abs(C)e.unconstrainedWidth?null:h:null;n.setStyle("width",d)}ere(a,n)}}}function ere(e,t){LG.rect=e,Tte(LG,t,YVe)}var YVe={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},LG={};function lM(e){return e.position==="center"}function XVe(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*UVe,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function d(C){C.ignore=!0}function v(C){if(!C.ignore)return!0;for(var A in C.states)if(C.states[A].ignore===!1)return!0;return!1}t.each(function(C){var A=t.getItemGraphicEl(C),P=A.shape,I=A.getTextContent(),k=A.getTextGuideLine(),E=t.getItemModel(C),D=E.getModel("label"),N=D.get("position")||E.get(["emphasis","label","position"]),z=D.get("distanceToLabelLine"),F=D.get("alignTo"),$=ve(D.get("edgeDistance"),u),Z=D.get("bleedMargin");Z==null&&(Z=Math.min(u,h)>200?10:2);var j=E.getModel("labelLine"),U=j.get("length");U=ve(U,u);var G=j.get("length2");if(G=ve(G,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Y>0?"left":"right"}var Ge=Math.PI,Ye=0,vt=D.get("rotate");if(ot(vt))Ye=vt*(Ge/180);else if(N==="center")Ye=0;else if(vt==="radial"||vt===!0){var Ft=Y<0?-V+Ge:-V;Ye=Ft}else if(vt==="tangential"&&N!=="outside"&&N!=="outer"){var rr=Math.atan2(Y,K);rr<0&&(rr=Ge*2+rr);var Nn=K>0;Nn&&(rr=Ge+rr),Ye=rr-Ge}if(a=!!Ye,I.x=ee,I.y=le,I.rotation=Ye,I.setStyle({verticalAlign:"middle"}),ge){I.setStyle({align:Re});var qn=I.states.select;qn&&(qn.x+=I.x,qn.y+=I.y)}else{var Xr=new Oe(0,0,0,0);ere(Xr,I),r.push({label:I,labelLine:k,position:N,len:U,len2:G,minTurnAngle:j.get("minTurnAngle"),maxSurfaceAngle:j.get("maxSurfaceAngle"),surfaceNormal:new Ie(Y,K),linePoints:he,textAlign:Re,labelDistance:z,labelAlignTo:F,edgeDistance:$,bleedMargin:Z,rect:Xr,unconstrainedWidth:Xr.width,labelStyleWidth:I.style.width})}A.setTextConfig({inside:ge})}}),!a&&e.get("avoidLabelOverlap")&&ZVe(r,n,i,l,u,h,c,f);for(var g=0;g0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f=a.r0}},t.type="pie",t}(bt);function ep(e,t,r){t=ae(t)&&{coordDimensions:t}||ie({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=qv(n,t).dimensions,a=new En(i,e);return a.initData(n,r),a}var tp=function(){function e(t,r){this._getDataWithEncodedVisual=t,this._getRawData=r}return e.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},e.prototype.containName=function(t){var r=this._getRawData();return r.indexOfName(t)>=0},e.prototype.indexOfName=function(t){var r=this._getDataWithEncodedVisual();return r.indexOfName(t)},e.prototype.getItemVisual=function(t,r){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,r)},e}(),JVe=Je(),tre=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new tp(me(this.getData,this),me(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return ep(this,{coordDimensions:["value"],encodeDefaulter:Fe(nj,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=JVe(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=uJ(o,n.hostModel.get("percentPrecision"))}var s=e.prototype.getDataParams.call(this,r);return s.percent=a[r]||0,s.$vars.push("percent"),s},t.prototype._defaultLabelLine=function(r){cf(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"50%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:"box",left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Tt);HBe({fullType:tre.type,getCoord2:function(e){return e.getShallow("center")}});function QVe(e){return{seriesType:e,reset:function(t,r){var n=t.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(ot(o)&&!isNaN(o)&&o<0)})}}}function e6e(e){e.registerChartView(KVe),e.registerSeriesModel(tre),pee("pie",e.registerAction),e.registerLayout(Fe(HVe,"pie")),e.registerProcessor(Qv("pie")),e.registerProcessor(QVe("pie"))}var t6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r}return t.prototype.getInitialData=function(r,n){return Xo(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?5e3:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?1e4:this.get("progressiveThreshold"))},t.prototype.brushSelector=function(r,n,i){return i.point(n.getItemLayout(r))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:J.color.primary}},universalTransition:{divideShape:"clone"}},t}(Tt),rre=4,r6e=function(){function e(){}return e}(),n6e=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new r6e},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(r,n){var i=n.points,a=n.size,o=this.symbolProxy,s=o.shape,l=r.getContext?r.getContext():r,u=l&&a[0]=0;u--){var c=u*2,f=a[c]-s/2,h=a[c+1]-l/2;if(r>=f&&n>=h&&r<=f+s&&n<=h+l)return u}return-1},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.points,a=n.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,f=-1/0,h=0;h=0&&(u.dataIndex=f+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),a6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.updateData(a,{clipShape:this._getClipShape(r)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.incrementalPrepareUpdate(a),this._finished=!1},t.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=r.end===n.getData().count()},t.prototype.updateTransform=function(r,n,i){var a=r.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=w0("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},t.prototype.eachRendered=function(r){this._symbolDraw&&this._symbolDraw.eachRendered(r)},t.prototype._getClipShape=function(r){if(r.get("clip",!0)){var n=r.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},t.prototype._updateSymbolDraw=function(r,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new i6e:new _0,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},t.prototype.remove=function(r,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(bt),nre={left:0,right:0,top:0,bottom:0},zw=["25%","25%"],o6e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Of(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Vo(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Vo(this.option.outerBounds,r.outerBounds)},t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:nre,outerBoundsContain:"all",outerBoundsClampWidth:zw[0],outerBoundsClampHeight:zw[1],backgroundColor:J.color.transparent,borderWidth:1,borderColor:J.color.neutral30},t}(Ke),iO=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",er).models[0]},t.type="cartesian2dAxis",t}(Ke);cr(iO,Jv);var ire={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:J.color.axisLine,width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:J.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:J.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[J.color.backgroundTint,J.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:J.color.neutral00,borderColor:J.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},s6e=He({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},ire),Rj=He({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:J.color.axisMinorSplitLine,width:1}}},ire),l6e=He({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Rj),u6e=Pe({logBase:10},Rj);const are={category:s6e,value:Rj,time:l6e,log:u6e};var c6e={value:1,category:1,time:1,log:1},aO=null;function f6e(e){aO||(aO=e)}function S0(){return aO}function lv(e,t,r,n){B(c6e,function(i,a){var o=He(He({},are[a],!0),n,!0),s=function(l){q(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=t+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,f){var h=Sy(this),d=h?Of(c):{},v=f.getTheme();He(c,v.get(a+"Axis")),He(c,this.getDefaultOption()),c.type=IG(c),h&&Vo(c,d,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=ky.createByAxisModel(this))},u.prototype.getCategories=function(c){var f=this.option;if(f.type==="category")return c?f.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){var f=S0();return f?f.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",IG)}function IG(e){return e.type||(e.data?"category":"value")}var h6e=function(){function e(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return e.prototype.getAxis=function(t){return this._axes[t]},e.prototype.getAxes=function(){return se(this._dimList,function(t){return this._axes[t]},this)},e.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),ht(this.getAxes(),function(r){return r.scale.type===t})},e.prototype.addAxis=function(t){var r=t.dim;this._axes[r]=t,this._dimList.push(r)},e}(),oO=["x","y"];function OG(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var d6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=oO,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!OG(r)||!OG(n))){var i=r.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,f=(s[1]-o[1])/u,h=o[0]-i[0]*c,d=o[1]-a[0]*f,v=this._transform=[c,0,0,f,h,d];this._invTransform=va([],v)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},t.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},t.prototype.containZone=function(r,n){var i=this.dataToPoint(r),a=this.dataToPoint(n),o=this.getArea(),s=new Oe(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},t.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return lr(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},t.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},t.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return lr(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.toLocalCoord(r[1]),n),i},t.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},t.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-r,o=Math.min(i[0],i[1])-r,s=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-o+r;return new Oe(a,o,s,l)},t}(h6e),ore=function(e){q(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},t.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},t.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},t.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},t}(ba),KT="expandAxisBreak",sre="collapseAxisBreak",lre="toggleAxisBreak",Bj="axisbreakchanged",v6e={type:KT,event:Bj,update:"update",refineEvent:zj},p6e={type:sre,event:Bj,update:"update",refineEvent:zj},g6e={type:lre,event:Bj,update:"update",refineEvent:zj};function zj(e,t,r,n){var i=[];return B(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function m6e(e){e.registerAction(v6e,t),e.registerAction(p6e,t),e.registerAction(g6e,t);function t(r,n){var i=[],a=dd(n,r);function o(s,l){B(a[s],function(u){var c=u.updateAxisBreaks(r);B(c.breaks,function(f){var h;i.push(Pe((h={},h[l]=u.componentIndex,h),f))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var El=Math.PI,y6e=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],x6e=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],uv=Je(),ure=Je(),cre=function(){function e(t){this.recordMap={},this.resolveAxisNameOverlap=t}return e.prototype.ensureRecord=function(t){var r=t.axis.dim,n=t.componentIndex,i=this.recordMap,a=i[r]||(i[r]=[]);return a[n]||(a[n]={ready:{}})},e}();function _6e(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=$j(e.axisName)&&ov(e.nameLocation);B(n,function(v){var g=Go(v);if(!(!g||g.label.ignore)){o.push(g);var m=a.transGroup;l&&(m.transform?va(Xp,m.transform):s0(Xp),g.transform&&Va(Xp,Xp,g.transform),Oe.copy(g_,g.localRect),g_.applyTransform(Xp),s?s.union(g_):Oe.copy(s=new Oe(0,0,0,0),g_))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",c=a.transGroup[u];if(o.sort(function(v,g){return Math.abs(v.label[u]-c)-Math.abs(g.label[u]-c)}),l&&s){var f=i.getExtent(),h=Math.min(f[0],f[1]),d=Math.max(f[0],f[1])-h;s.union(new Oe(h,0,d,1))}a.stOccupiedRect=s,a.labelInfoList=o}var Xp=Wr(),g_=new Oe(0,0,0,0),fre=function(e,t,r,n,i,a){if(ov(e.nameLocation)){var o=a.stOccupiedRect;o&&hre(yFe({},o,a.transGroup.transform),n,i)}else dre(a.labelInfoList,a.dirVec,n,i)};function hre(e,t,r){var n=new Ie;XT(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&KI(t,n)}function dre(e,t,r,n){for(var i=Ie.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):Qd(i-El)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},e.makeAxisEventDataBase=function(t){var r={componentType:t.mainType,componentIndex:t.componentIndex};return r[t.mainType+"Index"]=t.componentIndex,r},e.isLabelSilent=function(t){var r=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||r&&r.show)},e}(),b6e=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],w6e={axisLine:function(e,t,r,n,i,a,o){var s=n.get(["axisLine","show"]);if(s==="auto"&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),!!s){var l=n.axis.getExtent(),u=a.transform,c=[l[0],0],f=[l[1],0],h=c[0]>f[0];u&&(lr(c,c,u),lr(f,f,u));var d=ie({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),v={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:d};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())S0().buildAxisBreakLine(n,i,a,v);else{var g=new mr(ie({shape:{x1:c[0],y1:c[1],x2:f[0],y2:f[1]}},v));rv(g.shape,g.style.lineWidth),g.anid="line",i.add(g)}var m=n.get(["axisLine","symbol"]);if(m!=null){var y=n.get(["axisLine","symbolSize"]);pe(m)&&(m=[m,m]),(pe(y)||ot(y))&&(y=[y,y]);var _=Df(n.get(["axisLine","symbolOffset"])||0,y),b=y[0],S=y[1];B([{rotate:e.rotation+Math.PI/2,offset:_[0],r:0},{rotate:e.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((c[0]-f[0])*(c[0]-f[0])+(c[1]-f[1])*(c[1]-f[1]))}],function(T,C){if(m[C]!=="none"&&m[C]!=null){var A=xr(m[C],-b/2,-S/2,b,S,d.stroke,!0),P=T.r+T.offset,I=h?f:c;A.attr({rotation:T.rotate,x:I[0]+P*Math.cos(e.rotation),y:I[1]-P*Math.sin(e.rotation),silent:!0,z2:11}),i.add(A)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=DG(t,i,s);l&&EG(e,t,r,n,i,a,o,qa.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=DG(t,i,s);l&&EG(e,t,r,n,i,a,o,qa.determine);var u=A6e(e,i,a,n);C6e(e,t.labelLayoutList,u),M6e(e,i,a,n,e.tickDirection)},axisName:function(e,t,r,n,i,a,o,s){var l=r.ensureRecord(n);t.nameEl&&(i.remove(t.nameEl),t.nameEl=l.nameLayout=l.nameLocation=null);var u=e.axisName;if($j(u)){var c=e.nameLocation,f=e.nameDirection,h=n.getModel("nameTextStyle"),d=n.get("nameGap")||0,v=n.axis.getExtent(),g=n.axis.inverse?-1:1,m=new Ie(0,0),y=new Ie(0,0);c==="start"?(m.x=v[0]-g*d,y.x=-g):c==="end"?(m.x=v[1]+g*d,y.x=g):(m.x=(v[0]+v[1])/2,m.y=e.labelOffset+f*d,y.y=f);var _=Wr();y.transform(Ks(_,_,e.rotation));var b=n.get("nameRotate");b!=null&&(b=b*El/180);var S,T;ov(c)?S=Wn.innerTextLayout(e.rotation,b??e.rotation,f):(S=S6e(e.rotation,c,b||0,v),T=e.raw.axisNameAvailableWidth,T!=null&&(T=Math.abs(T/Math.sin(S.rotation)),!isFinite(T)&&(T=null)));var C=h.getFont(),A=n.get("nameTruncate",!0)||{},P=A.ellipsis,I=rn(e.raw.nameTruncateMaxWidth,A.maxWidth,T),k=s.nameMarginLevel||0,E=new at({x:m.x,y:m.y,rotation:S.rotation,silent:Wn.isLabelSilent(n),style:Mt(h,{text:u,font:C,overflow:"truncate",width:I,ellipsis:P,fill:h.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:h.get("align")||S.textAlign,verticalAlign:h.get("verticalAlign")||S.textVerticalAlign}),z2:1});if(Qs({el:E,componentModel:n,itemName:u}),E.__fullText=u,E.anid="name",n.get("triggerEvent")){var D=Wn.makeAxisEventDataBase(n);D.targetType="axisName",D.name=u,De(E).eventData=D}a.add(E),E.updateTransform(),t.nameEl=E;var N=l.nameLayout=Go({label:E,priority:E.z2,defaultAttr:{ignore:E.ignore},marginDefault:ov(c)?y6e[k]:x6e[k]});if(l.nameLocation=c,i.add(E),E.decomposeTransform(),e.shouldNameMoveOverlap&&N){var z=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,N,y,z)}}}};function EG(e,t,r,n,i,a,o,s){pre(t)||P6e(e,t,i,s,n,o);var l=t.labelLayoutList;k6e(e,n,l,a),O6e(n,e.rotation,l);var u=e.optionHideOverlap;T6e(n,l,u),u&&Cte(ht(l,function(c){return c&&!c.label.ignore})),_6e(e,r,n,l)}function S6e(e,t,r,n){var i=xN(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return Qd(i-El/2)?(o=l?"bottom":"top",a="center"):Qd(i-El*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iEl/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function T6e(e,t,r){if(lte(e.axis))return;function n(s,l,u){var c=Go(t[l]),f=Go(t[u]);if(!(!c||!f)){if(s===!1||c.suggestIgnore){Cg(c.label);return}if(f.suggestIgnore){Cg(f.label);return}var h=.1;if(!r){var d=[0,0,0,0];c=JI({marginForce:d},c),f=JI({marginForce:d},f)}XT(c,f,null,{touchThreshold:h})&&Cg(s?f.label:c.label)}}var i=e.get(["axisLabel","showMinLabel"]),a=e.get(["axisLabel","showMaxLabel"]),o=t.length;n(i,0,1),n(a,o-1,o-2)}function C6e(e,t,r){e.showMinorTicks||B(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(v)&&isFinite(u[0]);)d=Z2(d),v=u[1]-d*o;else{var m=e.getTicks().length-1;m>o&&(d=Z2(d));var y=d*o;g=Math.ceil(u[1]/d)*d,v=gr(g-y),v<0&&u[0]>=0?(v=0,g=gr(y)):g>0&&u[1]<=0&&(g=0,v=-gr(y))}var _=(i[0].value-a[0].value)/s,b=(i[o].value-a[o].value)/s;n.setExtent.call(e,v+d*_,g+d*b),n.setInterval.call(e,d),(_||b)&&n.setNiceExtent.call(e,v+d,g-d)}var jG=[[3,1],[0,2]],j6e=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=oO,this._initCartesian(t,r,n),this.model=t}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(t,r){var n=this._axesMap;this._updateScale(t,this.model);function i(o){var s,l=it(o),u=l.length;if(u){for(var c=[],f=u-1;f>=0;f--){var h=+l[f],d=o[h],v=d.model,g=d.scale;HI(g)&&v.get("alignTicks")&&v.get("interval")==null?c.push(d):(mf(g,v),HI(g)&&(s=d))}c.length&&(s||(s=c.pop(),mf(s.scale,s.model)),B(c,function(m){gre(m.scale,m.model,s.scale)}))}}i(n.x),i(n.y);var a={};B(n.x,function(o){RG(n,"y",o,a)}),B(n.y,function(o){RG(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=jr(t,r),a=this._rect=zt(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(lO(o,a),!n){var u=z6e(a,s,o,l,r),c=void 0;if(l)uO?(uO(this._axesList,a),lO(o,a)):c=$G(a.clone(),"axisLabel",null,a,o,u,i);else{var f=$6e(t,a,i),h=f.outerBoundsRect,d=f.parsedOuterBoundsContain,v=f.outerBoundsClamp;h&&(c=$G(h,d,v,a,o,u,i))}mre(a,o,qa.determine,null,c,i)}B(this._coordsList,function(g){g.calcAffineTransform()})},e.prototype.getAxis=function(t,r){var n=this._axesMap[t];if(n!=null)return n[r||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(t,r){if(t!=null&&r!=null){var n="x"+t+"y"+r;return this._coordsMap[n]}ke(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return vf(n,s,!0,!0,r),lO(i,n),l;function u(h){B(i[Be[h]],function(d){if(Ly(d.model)){var v=a.ensureRecord(d.model),g=v.labelInfoList;if(g)for(var m=0;m0&&!gn(d)&&d>1e-4&&(h/=d),h}}function z6e(e,t,r,n,i){var a=new cre(F6e);return B(r,function(o){return B(o,function(s){if(Ly(s.model)){var l=!n;s.axisBuilder=D6e(e,t,s.model,i,a,l)}})}),a}function mre(e,t,r,n,i,a){var o=r===qa.determine;B(t,function(u){return B(u,function(c){Ly(c.model)&&(N6e(c.axisBuilder,e,c.model),c.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[Be[1-u]]=e[Tr[u]]<=a.refContainer[Tr[u]]*.5?0:1-u===1?2:1}B(t,function(u,c){return B(u,function(f){Ly(f.model)&&((n==="all"||o)&&f.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&f.axisBuilder.build({axisLine:!0}))})})}function $6e(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=zt(e.get("outerBounds",!0)||nre,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||We(["all","axisLabel"],a)<0?o="all":o=a;var s=[fw(be(e.get("outerBoundsClampWidth",!0),zw[0]),t.width),fw(be(e.get("outerBoundsClampHeight",!0),zw[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var F6e=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";fre(e,t,r,n,i,a),ov(e.nameLocation)||B(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&dre(s.labelInfoList,s.dirVec,n,i)})};function V6e(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return G6e(r,e,t),r.seriesInvolved&&H6e(r,e),r}function G6e(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];B(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Dy(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,f=c.getModel("tooltip",n);if(B(s.getAxes(),Fe(g,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var h=f.get("trigger")==="axis",d=f.get(["axisPointer","type"])==="cross",v=s.getTooltipAxes(f.get(["axisPointer","axis"]));(h||d)&&B(v.baseAxes,Fe(g,d?"cross":!0,h)),d&&B(v.otherAxes,Fe(g,"cross",!1))}function g(m,y,_){var b=_.model.getModel("axisPointer",i),S=b.get("show");if(!(!S||S==="auto"&&!m&&!cO(b))){y==null&&(y=b.get("triggerTooltip")),b=m?W6e(_,f,i,t,m,y):b;var T=b.get("snap"),C=b.get("triggerEmphasis"),A=Dy(_.model),P=y||T||_.type==="category",I=e.axesInfo[A]={key:A,axis:_,coordSys:s,axisPointerModel:b,triggerTooltip:y,triggerEmphasis:C,involveSeries:P,snap:T,useHandle:cO(b),seriesModels:[],linkGroup:null};u[A]=I,e.seriesInvolved=e.seriesInvolved||P;var k=U6e(a,_);if(k!=null){var E=o[k]||(o[k]={axesInfo:{}});E.axesInfo[A]=I,E.mapper=a[k].mapper,I.linkGroup=E}}}})}function W6e(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};B(s,function(h){l[h]=Ae(o.get(h))}),l.snap=e.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var c=o.get(["label","show"]);if(u.show=c??!0,!a){var f=l.lineStyle=o.get("crossStyle");f&&Pe(u,f.textStyle)}}return e.model.getModel("axisPointer",new et(l,r,n))}function H6e(e,t){t.eachSeries(function(r){var n=r.coordinateSystem,i=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!n||!n.model||i==="none"||i===!1||i==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||B(e.coordSysAxesInfo[Dy(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function U6e(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function Z6e(e){var t=Fj(e);if(t){var r=t.axisPointerModel,n=t.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=cO(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0;return o&&s}var eGe=Je();function GG(e,t,r,n){if(e instanceof ore){var i=e.scale.type;if(i!=="category"&&i!=="ordinal")return r}var a=e.model,o=a.get("jitter"),s=a.get("jitterOverlap"),l=a.get("jitterMargin")||0,u=e.scale.type==="ordinal"?e.getBandWidth():null;return o>0?s?Sre(r,o,u,n):tGe(e,t,r,n,o,l):r}function Sre(e,t,r,n){if(r===null)return e+(Math.random()-.5)*t;var i=r-n*2,a=Math.min(Math.max(0,t),i);return e+(Math.random()-.5)*a}function tGe(e,t,r,n,i,a){var o=eGe(e);o.items||(o.items=[]);var s=o.items,l=WG(s,t,r,n,i,a,1),u=WG(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||f&&h>f/2-n?Sre(r,i,f,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function WG(e,t,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&v>s||o===-1&&v0&&!v.min?v.min=0:v.min!=null&&v.min<0&&!v.max&&(v.max=0);var g=l;v.color!=null&&(g=Pe({color:v.color},l));var m=He(Ae(v),{boundaryGap:r,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:v.text,showName:u,nameLocation:"end",nameGap:f,nameTextStyle:g,triggerEvent:h},!1);if(pe(c)){var y=m.name;m.name=c.replace("{value}",y??"")}else Ce(c)&&(m.name=c(m.name,m));var _=new et(m,null,this.ecModel);return cr(_,Jv.prototype),_.mainType="radar",_.componentIndex=this.componentIndex,_},this);this._indicatorModels=d},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,axisName:{show:!0,color:J.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:He({lineStyle:{color:J.color.neutral20}},qp.axisLine),axisLabel:m_(qp.axisLabel,!1),axisTick:m_(qp.axisTick,!1),splitLine:m_(qp.splitLine,!0),splitArea:m_(qp.splitArea,!0),indicator:[]},t}(Ke),cGe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group;a.removeAll(),this._buildAxes(r,i),this._buildSplitLineAndArea(r)},t.prototype._buildAxes=function(r,n){var i=r.coordinateSystem,a=i.getIndicatorAxes(),o=se(a,function(s){var l=s.model.get("showName")?s.name:"",u=new Wn(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});B(o,function(s){s.build(),this.group.add(s.group)},this)},t.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),o=r.getModel("splitLine"),s=r.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),f=s.get("show"),h=l.get("color"),d=u.get("color"),v=ae(h)?h:[h],g=ae(d)?d:[d],m=[],y=[];function _(F,$,Z){var j=Z%$.length;return F[j]=F[j]||[],j}if(a==="circle")for(var b=i[0].getTicksCoords(),S=n.cx,T=n.cy,C=0;C3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(i){var f=Math.abs(a),h=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(r){if(!(ZG(this._zr,"globalPan")||Kp(r))){var n=r.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(r,n,i,a,o){r._checkPointer(a,o.originX,o.originY)&&($s(a.event),a.__ecRoamConsumed=!0,YG(r,n,i,a,o))},t}(xa);function Kp(e){return e.__ecRoamConsumed}var yGe=Je();function JT(e){var t=yGe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Jp(e,t,r,n){for(var i=JT(e),a=i.roam,o=a[t]=a[t]||[],s=0;s=4&&(c={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(c&&s!=null&&l!=null&&(f=kre(c,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var d=i;i=new Me,i.add(d),d.scaleX=d.scaleY=f.scale,d.x=f.x,d.y=f.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Xe({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:f,named:a}},e.prototype._parseNode=function(t,r,n,i,a,o){var s=t.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=r;else{if(!a){var c=fM[s];if(c&&xe(fM,s)){l=c.call(this,t,r);var f=t.getAttribute("name");if(f){var h={name:f,namedFrom:null,svgNodeTagLower:s,el:l};n.push(h),s==="g"&&(u=h)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var d=JG[s];if(d&&xe(JG,s)){var v=d.call(this,t),g=t.getAttribute("id");g&&(this._defs[g]=v)}}if(l&&l.isGroup)for(var m=t.firstChild;m;)m.nodeType===1?this._parseNode(m,l,n,u,a,o):m.nodeType===3&&o&&this._parseText(m,l),m=m.nextSibling},e.prototype._parseText=function(t,r){var n=new ev({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Wi(r,n),di(t,n,this._defsUsePending,!1,!1),wGe(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,r.add(n),n},e.internalField=function(){fM={g:function(t,r){var n=new Me;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Xe;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,r){var n=new Yo;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,r){var n=new mr;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,r){var n=new f0;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,r){var n=t.getAttribute("points"),i;n&&(i=tW(n));var a=new bn({shape:{points:i||[]},silent:!0});return Wi(r,a),di(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=tW(n));var a=new an({shape:{points:i||[]},silent:!0});return Wi(r,a),di(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new Yr;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,r){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new Me;return Wi(r,s),di(t,s,this._defsUsePending,!1,!0),s},tspan:function(t,r){var n=t.getAttribute("x"),i=t.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",s=new Me;return Wi(r,s),di(t,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(t,r){var n=t.getAttribute("d")||"",i=HJ(n);return Wi(r,i),di(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),JG={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),r=parseInt(e.getAttribute("y1")||"0",10),n=parseInt(e.getAttribute("x2")||"10",10),i=parseInt(e.getAttribute("y2")||"0",10),a=new Lf(t,r,n,i);return QG(e,a),eW(e,a),a},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),r=parseInt(e.getAttribute("cy")||"0",10),n=parseInt(e.getAttribute("r")||"0",10),i=new DN(t,r,n);return QG(e,i),eW(e,i),i}};function QG(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function eW(e,t){for(var r=e.firstChild;r;){if(r.nodeType===1&&r.nodeName.toLocaleLowerCase()==="stop"){var n=r.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};Pre(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=On(o),u=l&&l[3];u&&(l[3]*=As(s),o=la(l,"rgba"))}t.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function Wi(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Pe(t.__inheritedStyle,e.__inheritedStyle))}function tW(e){for(var t=eC(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=eC(o);switch(i=i||Wr(),s){case"translate":Ya(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":AT(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Ks(i,i,-parseFloat(l[0])*hM,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*hM);Va(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*hM);Va(i,[1,c,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}t.setLocalTransform(i)}}var nW=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Pre(e,t,r){var n=e.getAttribute("style");if(n){nW.lastIndex=0;for(var i;(i=nW.exec(n))!=null;){var a=i[1],o=xe(Fw,a)?Fw[a]:null;o&&(t[o]=i[2]);var s=xe(Vw,a)?Vw[a]:null;s&&(r[s]=i[2])}}}function PGe(e,t,r){for(var n=0;n0,_={api:n,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:y,isGeo:o,transformInfoRaw:h};l.resourceType==="geoJSON"?this._buildGeoJSON(_):l.resourceType==="geoSVG"&&this._buildSVG(_),this._updateController(t,m,r,n),this._updateMapSelectHandler(t,u,n,i)},e.prototype._buildGeoJSON=function(t){var r=this._regionsGroupByName=_e(),n=_e(),i=this._regionsGroup,a=t.transformInfoRaw,o=t.mapOrGeoModel,s=t.data,l=t.geo.projection,u=l&&l.stream;function c(d,v){return v&&(d=v(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function f(d){for(var v=[],g=!u&&l&&l.project,m=0;m=0)&&(h=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Ur(t,Nr(n),{labelFetcher:h,labelDataIndex:f,defaultText:r},d);var v=t.getTextContent();if(v&&(Lre(v).ignore=v.ignore,t.textConfig&&o)){var g=t.getBoundingRect().clone();t.textConfig.layoutRect=g,t.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function lW(e,t,r,n,i,a){e.data?e.data.setItemGraphicEl(a,t):De(t).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:r,region:n&&n.option||{}}}function uW(e,t,r,n,i){e.data||Qs({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function cW(e,t,r,n,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Gt(t,o,a.get("blurScope"),a.get("disabled")),e.isGeo&&R5e(t,i,r),o}function fW(e,t,r){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=t({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!r&&s.polygonStart(),B(e,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=J.color.neutral00,i.style.lineWidth=2),i},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:J.color.tertiary},itemStyle:{borderWidth:.5,borderColor:J.color.border,areaColor:J.color.background},emphasis:{label:{show:!0,color:J.color.primary},itemStyle:{areaColor:J.color.highlight}},select:{label:{show:!0,color:J.color.primary},itemStyle:{color:J.color.highlight}},nameProperty:"name"},t}(Tt);function YGe(e,t){var r={};return B(e,function(n){n.each(n.mapDimension("value"),function(i,a){var o="ec-"+n.getName(a);r[o]=r[o]||[],isNaN(i)||r[o].push(i)})}),e[0].map(e[0].mapDimension("value"),function(n,i){for(var a="ec-"+e[0].getName(i),o=0,s=1/0,l=-1/0,u=r[a].length,c=0;c1?(b.width=_,b.height=_/g):(b.height=_,b.width=_*g),b.y=y[1]-b.height/2,b.x=y[0]-b.width/2;else{var S=e.getBoxLayoutParams();S.aspect=g,b=zt(S,v),b=CQ(e,b,g)}this.setViewRect(b.x,b.y,b.width,b.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function JGe(e,t){B(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var QGe=function(){function e(){this.dimensions=Ore}return e.prototype.create=function(t,r){var n=[];function i(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}t.eachComponent("geo",function(o,s){var l=o.get("map"),u=new dO(l+s,l,ie({nameMap:o.get("nameMap"),api:r,ecModel:t},i(o)));u.zoomLimit=o.get("scaleLimit"),n.push(u),o.coordinateSystem=u,u.model=o,u.resize=pW,u.resize(o,r)}),t.eachSeries(function(o){g0({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",er).models[0];return s&&s.coordinateSystem},allowNotFound:!0})});var a={};return t.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),B(a,function(o,s){var l=se(o,function(c){return c.get("nameMap")}),u=new dO(s,s,ie({nameMap:ST(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=rn.apply(null,se(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=pW,u.resize(o[0],r),B(o,function(c){c.coordinateSystem=u,JGe(u,c)})}),n},e.prototype.getFilledRegions=function(t,r,n,i){for(var a=(t||[]).slice(),o=_e(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(s)}}function aWe(e,t){var r=e.isExpand?e.children:[],n=e.parentNode.children,i=e.hierNode.i?n[e.hierNode.i-1]:null;if(r.length){sWe(e);var a=(r[0].hierNode.prelim+r[r.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=lWe(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function oWe(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function gW(e){return arguments.length?e:fWe}function Ag(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function sWe(e){for(var t=e.children,r=t.length,n=0,i=0;--r>=0;){var a=t[r];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function lWe(e,t,r,n){if(t){for(var i=e,a=e,o=a.parentNode.children[0],s=t,l=i.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,f=s.hierNode.modifier;s=dM(s),a=vM(a),s&&a;){i=dM(i),o=vM(o),i.hierNode.ancestor=e;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+n(s,a);h>0&&(cWe(uWe(s,e,r),e,h),u+=h,l+=h),f+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!dM(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!vM(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function dM(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function vM(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function uWe(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function cWe(e,t,r){var n=r/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=r,t.hierNode.modifier+=r,t.hierNode.prelim+=r,e.hierNode.change+=n}function fWe(e,t){return e.parentNode===t.parentNode?1:2}var hWe=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),dWe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultStyle=function(){return{stroke:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new hWe},t.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){r.moveTo(o[0],o[1]),r.lineTo(s[0],s[1]);return}var u=n.orient,c=u==="TB"||u==="BT"?0:1,f=1-c,h=ve(n.forkPosition,1),d=[];d[c]=o[c],d[f]=o[f]+(l[f]-o[f])*h,r.moveTo(o[0],o[1]),r.lineTo(d[0],d[1]),r.moveTo(s[0],s[1]),d[c]=s[c],r.lineTo(d[0],d[1]),d[c]=l[c],r.lineTo(d[0],d[1]),r.lineTo(l[0],l[1]);for(var v=1;v_.x,T||(S=S-Math.PI));var A=T?"left":"right",P=s.getModel("label"),I=P.get("rotate"),k=I*(Math.PI/180),E=m.getTextContent();E&&(m.setTextConfig({position:P.get("position")||A,rotation:I==null?-S:k,origin:"center"}),E.setStyle("verticalAlign","middle"))}var D=s.get(["emphasis","focus"]),N=D==="relative"?qd(o.getAncestorsIndices(),o.getDescendantIndices()):D==="ancestor"?o.getAncestorsIndices():D==="descendant"?o.getDescendantIndices():null;N&&(De(r).focus=N),pWe(i,o,c,r,v,d,g,n),r.__edge&&(r.onHoverStateChange=function(z){if(z!=="blur"){var F=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);F&&F.hoverState===c0||pw(r.__edge,z)}})}function pWe(e,t,r,n,i,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),f=e.getOrient(),h=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),v=l.getModel("lineStyle").getLineStyle(),g=n.__edge;if(u==="curve")t.parentNode&&t.parentNode!==r&&(g||(g=n.__edge=new $v({shape:vO(c,f,h,i,i)})),lt(g,{shape:vO(c,f,h,a,o)},e));else if(u==="polyline"&&c==="orthogonal"&&t!==r&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var m=t.children,y=[],_=0;_r&&(r=i.height)}this.height=r+1},e.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var r=0,n=this.children,i=n.length;r=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,r)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostTree,n=r.data.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(t,r){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,r)},e.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,r=0;r=0){var n=r.getData().tree.root,i=e.targetNode;if(pe(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=e.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function Bre(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function Xj(e,t){var r=Bre(e);return We(r,t)>=0}function tC(e,t){for(var r=[];e;){var n=e.dataIndex;r.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return r.reverse(),r}var TWe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.hasSymbolVisual=!0,r.ignoreStyleOnData=!0,r}return t.prototype.getInitialData=function(r){var n={name:r.name,children:r.data},i=r.leaves||{},a=new et(i,this,this.ecModel),o=Yj.createTree(n,this,s);function s(f){f.wrapMethod("getItemModel",function(h,d){var v=o.getNodeByDataIndex(d);return v&&v.children.length&&v.isExpand||(h.parentModel=a),h})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var u=r.expandAndCollapse,c=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var h=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=h&&h.collapsed!=null?!h.collapsed:f.depth<=c}),o.data},t.prototype.getOrient=function(){var r=this.get("orient");return r==="horizontal"?r="LR":r==="vertical"&&(r="TB"),r},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.formatTooltip=function(r,n,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(r),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return Cr("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=tC(i,this),n.collapsed=!i.isExpand,n},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystemUsage:"box",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,roamTrigger:"global",nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:J.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(Tt);function CWe(e,t,r){for(var n=[e],i=[],a;a=n.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)r.push(i[a])}}function AWe(e,t){e.eachSeriesByType("tree",function(r){MWe(r,t)})}function MWe(e,t){var r=jr(e,t).refContainer,n=zt(e.getBoxLayoutParams(),r);e.layoutInfo=n;var i=e.get("layout"),a=0,o=0,s=null;i==="radial"?(a=2*Math.PI,o=Math.min(n.height,n.width)/2,s=gW(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=gW());var l=e.getData().tree.root,u=l.children[0];if(u){iWe(l),CWe(u,aWe,s),l.hierNode.modifier=-u.hierNode.prelim,tg(u,oWe);var c=u,f=u,h=u;tg(u,function(S){var T=S.getLayout().x;Tf.getLayout().x&&(f=S),S.depth>h.depth&&(h=S)});var d=c===f?1:s(c,f)/2,v=d-c.getLayout().x,g=0,m=0,y=0,_=0;if(i==="radial")g=a/(f.getLayout().x+d+v),m=o/(h.depth-1||1),tg(u,function(S){y=(S.getLayout().x+v)*g,_=(S.depth-1)*m;var T=Ag(y,_);S.setLayout({x:T.x,y:T.y,rawX:y,rawY:_},!0)});else{var b=e.getOrient();b==="RL"||b==="LR"?(m=o/(f.getLayout().x+d+v),g=a/(h.depth-1||1),tg(u,function(S){_=(S.getLayout().x+v)*m,y=b==="LR"?(S.depth-1)*g:a-(S.depth-1)*g,S.setLayout({x:y,y:_},!0)})):(b==="TB"||b==="BT")&&(g=a/(f.getLayout().x+d+v),m=o/(h.depth-1||1),tg(u,function(S){y=(S.getLayout().x+v)*g,_=b==="TB"?(S.depth-1)*m:o-(S.depth-1)*m,S.setLayout({x:y,y:_},!0)}))}}}function PWe(e){e.eachSeriesByType("tree",function(t){var r=t.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=r.ensureUniqueItemVisual(i.dataIndex,"style");ie(s,o)})})}function kWe(e){e.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,r){r.eachComponent({mainType:"series",subType:"tree",query:t},function(n){var i=t.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),e.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",subType:"tree",query:t},function(i){var a=i.coordinateSystem,o=QT(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function LWe(e){e.registerChartView(vWe),e.registerSeriesModel(TWe),e.registerLayout(AWe),e.registerVisual(PWe),kWe(e)}var bW=["treemapZoomToNode","treemapRender","treemapMove"];function IWe(e){for(var t=0;t1;)a=a.parentNode;var o=II(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var OWe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.preventUsingHoverLayer=!0,r}return t.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};$re(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new et({itemStyle:o},this,n);a=r.levels=EWe(a,n);var l=se(a||[],function(f){return new et(f,s,n)},this),u=Yj.createTree(i,this,c);function c(f){f.wrapMethod("getItemModel",function(h,d){var v=u.getNodeByDataIndex(d),g=v?l[v.depth]:null;return h.parentModel=g||s,h})}return u.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(r,n,i){var a=this.getData(),o=this.getRawValue(r),s=a.getName(r);return Cr("nameValue",{name:s,value:o})},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=tC(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},ie(this.layoutInfo,r)},t.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=_e(),this._idIndexMapCount=0);var i=n.get(r);return i==null&&n.set(r,i=this._idIndexMapCount++),i},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},t.prototype.enableAriaDecal=function(){zre(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,coordinateSystemUsage:"box",left:J.size.l,top:J.size.xxxl,right:J.size.l,bottom:J.size.xxxl,sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:"global",nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",bottom:J.size.m,emptyItemWidth:25,itemStyle:{color:J.color.backgroundShade,textStyle:{color:J.color.secondary}},emphasis:{itemStyle:{color:J.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:J.color.neutral00,overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:J.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(Tt);function $re(e){var t=0;B(e.children,function(n){$re(n);var i=n.value;ae(i)&&(i=i[0]),t+=i});var r=e.value;ae(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ae(e.value)?e.value[0]=r:e.value=r}function EWe(e,t){var r=Pt(t.get("color")),n=Pt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;B(e,function(s){var l=new et(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=e[0]||(e[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),e}}var DWe=8,wW=8,pM=5,NWe=function(){function e(t){this.group=new Me,t.add(this.group)}return e.prototype.render=function(t,r,n,i){var a=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),f=jr(t,r).refContainer,h={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},d={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},v=zt(h,f);this._prepare(n,d,u),this._renderContent(t,d,v,s,l,u,c,i),VT(o,h,f)}},e.prototype._prepare=function(t,r,n){for(var i=t;i;i=i.parentNode){var a=Ir(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+DWe*2,r.emptyItemWidth);r.totalWidth+=s+wW,r.renderList.push({node:i,text:a,width:s})}},e.prototype._renderContent=function(t,r,n,i,a,o,s,l){for(var u=0,c=r.emptyItemWidth,f=t.get(["breadcrumb","height"]),h=r.totalWidth,d=r.renderList,v=a.getModel("itemStyle").getItemStyle(),g=d.length-1;g>=0;g--){var m=d[g],y=m.node,_=m.width,b=m.text;h>n.width&&(h-=_-c,_=c,b=null);var S=new bn({shape:{points:jWe(u,0,_,f,g===d.length-1,g===0)},style:Pe(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new at({style:Mt(o,{text:b})}),textConfig:{position:"inside"},z2:Bv*1e4,onclick:Fe(l,y)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Mt(s,{text:b}),S.ensureState("emphasis").style=v,Gt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),RWe(S,t,y),u+=_+wW}},e.prototype.remove=function(){this.group.removeAll()},e}();function jWe(e,t,r,n,i,a){var o=[[i?e:e-pM,t],[e+r,t],[e+r,t+n],[i?e:e-pM,t+n]];return!a&&o.splice(2,0,[e+r+pM,t+n/2]),!i&&o.push([e,t+n/2]),o}function RWe(e,t,r){De(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&tC(r,t)}}var BWe=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(t,r,n,i,a){return this._elExistsMap[t.id]?!1:(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:r,duration:n,delay:i,easing:a}),!0)},e.prototype.finished=function(t){return this._finishedCallback=t,this},e.prototype.start=function(){for(var t=this,r=this._storage.length,n=function(){r--,r<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,a=this._storage.length;iTW||Math.abs(r.dy)>TW)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+r.dx,y:i.y+r.dy,width:i.width,height:i.height}})}},t.prototype._onZoom=function(r){var n=r.originX,i=r.originY,a=r.scale;if(this._state!=="animating"){var o=this.seriesModel.getData().tree.root;if(!o)return;var s=o.getLayout();if(!s)return;var l=new Oe(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var f=c.zoom=c.zoom||1;if(f*=a,u){var h=u.min||0,d=u.max||1/0;f=Math.max(Math.min(d,f),h)}var v=f/c.zoom;c.zoom=f;var g=this.seriesModel.layoutInfo;n-=g.x,i-=g.y;var m=Wr();Ya(m,m,[-n,-i]),AT(m,m,[v,v]),Ya(m,m,[n,i]),l.applyTransform(m),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:l.x,y:l.y,width:l.width,height:l.height}})}},t.prototype._initEvents=function(r){var n=this;r.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&xw(u,c)}}}}},this)},t.prototype._renderBreadcrumb=function(r,n,i){var a=this;i||(i=r.get("leafDepth",!0)!=null?{node:r.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:r.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new NWe(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(Xj(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=rg(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(r){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},t.prototype._rootToNode=function(r){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},t.prototype.findTarget=function(r,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(r,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},t.type="treemap",t}(bt);function rg(){return{nodeGroup:[],background:[],content:[]}}function WWe(e,t,r,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),f=e.getData(),h=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,v=c.height,g=c.borderWidth,m=c.invisible,y=o.getRawIndex(),_=s&&s.getRawIndex(),b=o.viewChildren,S=c.upperHeight,T=b&&b.length,C=h.getModel("itemStyle"),A=h.getModel(["emphasis","itemStyle"]),P=h.getModel(["blur","itemStyle"]),I=h.getModel(["select","itemStyle"]),k=C.get("borderRadius")||0,E=le("nodeGroup",pO);if(!E)return;if(l.add(E),E.x=c.x||0,E.y=c.y||0,E.markRedraw(),Gw(E).nodeWidth=d,Gw(E).nodeHeight=v,c.isAboveViewRoot)return E;var D=le("background",SW,u,FWe);D&&G(E,D,T&&c.upperLabelHeight);var N=h.getModel("emphasis"),z=N.get("focus"),F=N.get("blurScope"),$=N.get("disabled"),Z=z==="ancestor"?o.getAncestorsIndices():z==="descendant"?o.getDescendantIndices():z;if(T)_y(E)&&Dc(E,!1),D&&(Dc(D,!$),f.setItemGraphicEl(o.dataIndex,D),_I(D,Z,F));else{var j=le("content",SW,u,VWe);j&&V(E,j),D.disableMorphing=!0,D&&_y(D)&&Dc(D,!1),Dc(E,!$),f.setItemGraphicEl(o.dataIndex,E);var U=h.getShallow("cursor");U&&j.attr("cursor",U),_I(E,Z,F)}return E;function G(ge,ne,fe){var ue=De(ne);if(ue.dataIndex=o.dataIndex,ue.seriesIndex=e.seriesIndex,ne.setShape({x:0,y:0,width:d,height:v,r:k}),m)Y(ne);else{ne.invisible=!1;var te=o.getVisual("style"),Ve=te.stroke,Se=MW(C);Se.fill=Ve;var Ge=pc(A);Ge.fill=A.get("borderColor");var Ye=pc(P);Ye.fill=P.get("borderColor");var vt=pc(I);if(vt.fill=I.get("borderColor"),fe){var Ft=d-2*g;K(ne,Ve,te.opacity,{x:g,y:0,width:Ft,height:S})}else ne.removeTextContent();ne.setStyle(Se),ne.ensureState("emphasis").style=Ge,ne.ensureState("blur").style=Ye,ne.ensureState("select").style=vt,df(ne)}ge.add(ne)}function V(ge,ne){var fe=De(ne);fe.dataIndex=o.dataIndex,fe.seriesIndex=e.seriesIndex;var ue=Math.max(d-2*g,0),te=Math.max(v-2*g,0);if(ne.culling=!0,ne.setShape({x:g,y:g,width:ue,height:te,r:k}),m)Y(ne);else{ne.invisible=!1;var Ve=o.getVisual("style"),Se=Ve.fill,Ge=MW(C);Ge.fill=Se,Ge.decal=Ve.decal;var Ye=pc(A),vt=pc(P),Ft=pc(I);K(ne,Se,Ve.opacity,null),ne.setStyle(Ge),ne.ensureState("emphasis").style=Ye,ne.ensureState("blur").style=vt,ne.ensureState("select").style=Ft,df(ne)}ge.add(ne)}function Y(ge){!ge.invisible&&a.push(ge)}function K(ge,ne,fe,ue){var te=h.getModel(ue?AW:CW),Ve=Ir(h.get("name"),null),Se=te.getShallow("show");Ur(ge,Nr(h,ue?AW:CW),{defaultText:Se?Ve:null,inheritColor:ne,defaultOpacity:fe,labelFetcher:e,labelDataIndex:o.dataIndex});var Ge=ge.getTextContent();if(Ge){var Ye=Ge.style,vt=a0(Ye.padding||0);ue&&(ge.setTextConfig({layoutRect:ue}),Ge.disableLabelLayout=!0),Ge.beforeUpdate=function(){var rr=Math.max((ue?ue.width:ge.shape.width)-vt[1]-vt[3],0),Nn=Math.max((ue?ue.height:ge.shape.height)-vt[0]-vt[2],0);(Ye.width!==rr||Ye.height!==Nn)&&Ge.setStyle({width:rr,height:Nn})},Ye.truncateMinChar=2,Ye.lineOverflow="truncate",ee(Ye,ue,c);var Ft=Ge.getState("emphasis");ee(Ft?Ft.style:null,ue,c)}}function ee(ge,ne,fe){var ue=ge?ge.text:null;if(!ne&&fe.isLeafRoot&&ue!=null){var te=e.get("drillDownIcon",!0);ge.text=te?te+" "+ue:ue}}function le(ge,ne,fe,ue){var te=_!=null&&r[ge][_],Ve=i[ge];return te?(r[ge][_]=null,he(Ve,te)):m||(te=new ne,te instanceof pa&&(te.z2=HWe(fe,ue)),Re(Ve,te)),t[ge][y]=te}function he(ge,ne){var fe=ge[y]={};ne instanceof pO?(fe.oldX=ne.x,fe.oldY=ne.y):fe.oldShape=ie({},ne.shape)}function Re(ge,ne){var fe=ge[y]={},ue=o.parentNode,te=ne instanceof Me;if(ue&&(!n||n.direction==="drillDown")){var Ve=0,Se=0,Ge=i.background[ue.getRawIndex()];!n&&Ge&&Ge.oldShape&&(Ve=Ge.oldShape.width,Se=Ge.oldShape.height),te?(fe.oldX=0,fe.oldY=Se):fe.oldShape={x:Ve,y:Se,width:0,height:0}}fe.fadein=!te}}function HWe(e,t){return e*$We+t}var jy=B,UWe=ke,Ww=-1,Hr=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=Ae(t);this.type=n,this.mappingMethod=r,this._normalizeData=XWe[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(gM(i),ZWe(i)):r==="category"?i.categories?YWe(i):gM(i,!0):(xn(r!=="linear"||i.dataExtent),gM(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return me(this._normalizeData,this)},e.listVisualTypes=function(){return it(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(t,r,n){ke(t)?B(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=ae(t)?[]:ke(t)?{}:(i=!0,null);return e.eachVisual(t,function(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},e.retrieveVisuals=function(t){var r={},n;return t&&jy(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(ae(t))t=t.slice();else if(UWe(t)){var r=[];jy(t,function(n,i){r.push(i)}),t=r}else return[];return t.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),t},e.dependsOn=function(t,r){return r==="color"?!!(t&&t.indexOf(r)===0):t===r},e.findPieceIndex=function(t,r,n){for(var i,a=1/0,o=0,s=r.length;o=0;a--)n[a]==null&&(delete r[t[a]],t.pop())}function gM(e,t){var r=e.visual,n=[];ke(r)?jy(r,function(a){n.push(a)}):r!=null&&n.push(r);var i={color:1,symbol:1};!t&&n.length===1&&!i.hasOwnProperty(e.type)&&(n[1]=n[0]),Fre(e,n)}function x_(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:gO([0,1])}}function PW(e){var t=this.option.visual;return t[Math.round(gt(e,[0,1],[0,t.length-1],!0))]||{}}function ng(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function Mg(e){var t=this.option.visual;return t[this.option.loop&&e!==Ww?e%t.length:e]}function gc(){return this.option.visual[0]}function gO(e){return{linear:function(t){return gt(t,e,this.option.visual,!0)},category:Mg,piecewise:function(t,r){var n=mO.call(this,r);return n==null&&(n=gt(t,e,this.option.visual,!0)),n},fixed:gc}}function mO(e){var t=this.option,r=t.pieceList;if(t.hasSpecialVisual){var n=Hr.findPieceIndex(e,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function Fre(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=se(t,function(r){var n=On(r);return n||[0,0,0,1]})),t}var XWe={linear:function(e){return gt(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,r=Hr.findPieceIndex(e,t,!0);if(r!=null)return gt(r,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return t??Ww},fixed:sr};function __(e,t,r){return e?t<=r:t=r.length||g===r[g.depth]){var y=t8e(i,l,g,m,v,n);Gre(g,y,r,n)}})}}}function JWe(e,t,r){var n=ie({},t),i=r.designatedVisualItemStyle;return B(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function kW(e){var t=mM(e,"color");if(t){var r=mM(e,"colorAlpha"),n=mM(e,"colorSaturation");return n&&(t=Ms(t,null,null,n)),r&&(t=py(t,r)),t}}function QWe(e,t){return t!=null?Ms(t,null,null,e):null}function mM(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function e8e(e,t,r,n,i,a){if(!(!a||!a.length)){var o=yM(t,"color")||i.color!=null&&i.color!=="none"&&(yM(t,"colorAlpha")||yM(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=r.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var c=t.get("colorMappingBy"),f={type:o.name,dataExtent:u,visual:o.range};f.type==="color"&&(c==="index"||c==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var h=new Hr(f);return Vre(h).drColorMappingBy=c,h}}}function yM(e,t){var r=e.get(t);return ae(r)&&r.length?{name:t,range:r}:null}function t8e(e,t,r,n,i,a){var o=ie({},t);if(i){var s=i.type,l=s==="color"&&Vre(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(e.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}var Ry=Math.max,Hw=Math.min,LW=rn,qj=B,Wre=["itemStyle","borderWidth"],r8e=["itemStyle","gapWidth"],n8e=["upperLabel","show"],i8e=["upperLabel","height"];const a8e={seriesType:"treemap",reset:function(e,t,r,n){var i=e.option,a=jr(e,r).refContainer,o=zt(e.getBoxLayoutParams(),a),s=i.size||[],l=ve(LW(o.width,s[0]),a.width),u=ve(LW(o.height,s[1]),a.height),c=n&&n.type,f=["treemapZoomToNode","treemapRootToNode"],h=Ny(n,f,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,v=e.getViewRoot(),g=Bre(v);if(c!=="treemapMove"){var m=c==="treemapZoomToNode"?f8e(e,h,v,l,u):d?[d.width,d.height]:[l,u],y=i.sort;y&&y!=="asc"&&y!=="desc"&&(y="desc");var _={squareRatio:i.squareRatio,sort:y,leafDepth:i.leafDepth};v.hostTree.clearLayouts();var b={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};v.setLayout(b),Hre(v,_,!1,0),b=v.getLayout(),qj(g,function(T,C){var A=(g[C+1]||v).getValue();T.setLayout(ie({dataExtent:[A,A],borderWidth:0,upperHeight:0},b))})}var S=e.getData().tree.root;S.setLayout(h8e(o,d,h),!0),e.setLayoutInfo(o),Ure(S,new Oe(-o.x,-o.y,r.getWidth(),r.getHeight()),g,v,0)}};function Hre(e,t,r,n){var i,a;if(!e.isRemoved()){var o=e.getLayout();i=o.width,a=o.height;var s=e.getModel(),l=s.get(Wre),u=s.get(r8e)/2,c=Zre(s),f=Math.max(l,c),h=l-u,d=f-u;e.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),i=Ry(i-2*h,0),a=Ry(a-h-d,0);var v=i*a,g=o8e(e,s,v,t,r,n);if(g.length){var m={x:h,y:d,width:i,height:a},y=Hw(i,a),_=1/0,b=[];b.area=0;for(var S=0,T=g.length;S=0;l--){var u=i[n==="asc"?o-l-1:l].getValue();u/r*ts[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function c8e(e,t,r){for(var n=0,i=1/0,a=0,o=void 0,s=e.length;an&&(n=o));var l=e.area*e.area,u=t*t*r;return l?Ry(u*n/l,l/(u*i)):1/0}function IW(e,t,r,n,i){var a=t===r.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=r[s[a]],c=t?e.area/t:0;(i||c>r[l[o]])&&(c=r[l[o]]);for(var f=0,h=e.length;fuI&&(u=uI),a=s}un&&(n=t);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(T[0]=-T[0],T[1]=-T[1]);var A=S[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var P=-Math.atan2(S[1],S[0]);f[0].8?"left":h[0]<-.8?"right":"center",g=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":a.x=-h[0]*y+c[0],a.y=-h[1]*_+c[1],v=h[0]>.8?"right":h[0]<-.8?"left":"center",g=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=y*A+c[0],a.y=c[1]+I,v=S[0]<0?"right":"left",a.originX=-y*A,a.originY=-I;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=C[0],a.y=C[1]+I,v="center",a.originY=-I;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*A+f[0],a.y=f[1]+I,v=S[0]>=0?"right":"left",a.originX=y*A,a.originY=-I;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||v})}},t}(Me),tR=function(){function e(t){this.group=new Me,this._LineCtor=t||eR}return e.prototype.updateData=function(t){var r=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=t,a||i.removeAll();var o=RW(t);t.diff(a).add(function(s){r._doAdd(t,s,o)}).update(function(s,l){r._doUpdate(a,t,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},e.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(r,n){r.updateLayout(t,n)},this)},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=RW(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!k8e(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function RW(e){var t=e.hostModel,r=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:r.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:r.get("disabled"),blurScope:r.get("blurScope"),focus:r.get("focus"),labelStatesModels:Nr(t)}}function BW(e){return isNaN(e[0])||isNaN(e[1])}function SM(e){return e&&!BW(e[0])&&!BW(e[1])}var TM=[],CM=[],AM=[],gh=tn,MM=Ul,zW=Math.abs;function $W(e,t,r){for(var n=e[0],i=e[1],a=e[2],o=1/0,s,l=r*r,u=.1,c=.1;c<=.9;c+=.1){TM[0]=gh(n[0],i[0],a[0],c),TM[1]=gh(n[1],i[1],a[1],c);var f=zW(MM(TM,t)-l);f=0?s=s+u:s=s-u:v>=0?s=s-u:s=s+u}return s}function PM(e,t){var r=[],n=dy,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");u.__original||(u.__original=[Eo(u[0]),Eo(u[1])],u[2]&&u.__original.push(Eo(u[2])));var h=u.__original;if(u[2]!=null){if(Mn(i[0],h[0]),Mn(i[1],h[2]),Mn(i[2],h[1]),c&&c!=="none"){var d=kg(s.node1),v=$W(i,h[0],d*t);n(i[0][0],i[1][0],i[2][0],v,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],v,r),i[0][1]=r[3],i[1][1]=r[4]}if(f&&f!=="none"){var d=kg(s.node2),v=$W(i,h[1],d*t);n(i[0][0],i[1][0],i[2][0],v,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],v,r),i[1][1]=r[1],i[2][1]=r[2]}Mn(u[0],i[0]),Mn(u[1],i[2]),Mn(u[2],i[1])}else{if(Mn(a[0],h[0]),Mn(a[1],h[1]),kl(o,a[1],a[0]),kf(o,o),c&&c!=="none"){var d=kg(s.node1);Q1(a[0],a[0],o,d*t)}if(f&&f!=="none"){var d=kg(s.node2);Q1(a[1],a[1],o,-d*t)}Mn(u[0],a[0]),Mn(u[1],a[1])}})}var ene=Je();function L8e(e){if(e)return ene(e).bridge}function FW(e,t){e&&(ene(e).bridge=t)}function VW(e){return e.type==="view"}var I8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){var i=new _0,a=new tR,o=this.group,s=new Me;this._controller=new jf(n.getZr()),this._controllerHost={target:s},s.add(i.group),s.add(a.group),o.add(s),this._symbolDraw=i,this._lineDraw=a,this._mainGroup=s,this._firstRender=!0},t.prototype.render=function(r,n,i){var a=this,o=r.coordinateSystem,s=!1;this._model=r,this._api=i,this._active=!0;var l=this._getThumbnailInfo();l&&l.bridge.reset(i);var u=this._symbolDraw,c=this._lineDraw;if(VW(o)){var f={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(f):lt(this._mainGroup,f,r)}PM(r.getGraph(),Pg(r));var h=r.getData();u.updateData(h);var d=r.getEdgeData();c.updateData(d),this._updateNodeAndLinkScale(),this._updateController(null,r,i),clearTimeout(this._layoutTimeout);var v=r.forceLayout,g=r.get(["force","layoutAnimation"]);v&&(s=!0,this._startForceLayoutIteration(v,i,g));var m=r.get("layout");h.graph.eachNode(function(S){var T=S.dataIndex,C=S.getGraphicEl(),A=S.getModel();if(C){C.off("drag").off("dragend");var P=A.get("draggable");P&&C.on("drag",function(k){switch(m){case"force":v.warmUp(),!a._layouting&&a._startForceLayoutIteration(v,i,g),v.setFixed(T),h.setItemLayout(T,[C.x,C.y]);break;case"circular":h.setItemLayout(T,[C.x,C.y]),S.setLayout({fixed:!0},!0),Qj(r,"symbolSize",S,[k.offsetX,k.offsetY]),a.updateLayout(r);break;case"none":default:h.setItemLayout(T,[C.x,C.y]),Jj(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){v&&v.setUnfixed(T)}),C.setDraggable(P,!!A.get("cursor"));var I=A.get(["emphasis","focus"]);I==="adjacency"&&(De(C).focus=S.getAdjacentDataIndices())}}),h.graph.eachEdge(function(S){var T=S.getGraphicEl(),C=S.getModel().get(["emphasis","focus"]);T&&C==="adjacency"&&(De(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var y=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),_=h.getLayout("cx"),b=h.getLayout("cy");h.graph.eachNode(function(S){Kre(S,y,_,b)}),this._firstRender=!1,s||this._renderThumbnail(r,i,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(r,n,i){var a=this,o=!1;(function s(){r.step(function(l){a.updateLayout(a._model),(l||!o)&&(o=!0,a._renderThumbnail(a._model,n,a._symbolDraw,a._lineDraw)),(a._layouting=!l)&&(i?a._layoutTimeout=setTimeout(s,16):s())})})()},t.prototype._updateController=function(r,n,i){var a=this._controller,o=this._controllerHost,s=n.coordinateSystem;if(!VW(s)){a.disable();return}a.enable(n.get("roam"),{api:i,zInfo:{component:n},triggerInfo:{roamTrigger:n.get("roamTrigger"),isInSelf:function(l,u,c){return s.containPoint([u,c])},isInClip:function(l,u,c){return!r||r.contain(u,c)}}}),o.zoomLimit=n.get("scaleLimit"),o.zoom=s.getZoom(),a.off("pan").off("zoom").on("pan",function(l){i.dispatchAction({seriesId:n.id,type:"graphRoam",dx:l.dx,dy:l.dy})}).on("zoom",function(l){i.dispatchAction({seriesId:n.id,type:"graphRoam",zoom:l.scale,originX:l.originX,originY:l.originY})})},t.prototype.updateViewOnPan=function(r,n,i){this._active&&(Gj(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(Wj(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),PM(r.getGraph(),Pg(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=Pg(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(PM(r.getGraph(),Pg(r)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var r=this._model,n=r.coordinateSystem;if(n.type==="view"){var i=L8e(r);if(i)return{bridge:i,coordSys:n}}},t.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(r.coordSys.transform,this._api)},t.prototype._renderThumbnail=function(r,n,i,a){var o=this._getThumbnailInfo();if(o){var s=new Me,l=i.group.children(),u=a.group.children(),c=new Me,f=new Me;s.add(f),s.add(c);for(var h=0;h=0&&t.call(r,n[a],a)},e.prototype.eachEdge=function(t,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&t.call(r,n[a],a)},e.prototype.breadthFirstTraverse=function(t,r,n,i){if(r instanceof mc||(r=this._nodesMap[mh(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&!t.hasKey(v)&&(t.set(v,!0),o.push(d.node1))}for(l=0;l=0&&!t.hasKey(b)&&(t.set(b,!0),s.push(_.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),tne=function(){function e(t,r,n){this.dataIndex=-1,this.node1=t,this.node2=r,this.dataIndex=n??-1}return e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostGraph,n=r.edgeData.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var t=_e(),r=_e();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!t.hasKey(f)&&(t.set(f,!0),n.push(c.node1))}for(a=0;a=0&&!t.hasKey(g)&&(t.set(g,!0),i.push(v.node2))}return{edge:t.keys(),node:r.keys()}},e}();function rne(e,t){return{getValue:function(r){var n=this[e][t];return n.getStore().get(n.getDimensionIndex(r||"value"),this.dataIndex)},setVisual:function(r,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,r,n)},getVisual:function(r){return this[e][t].getItemVisual(this.dataIndex,r)},setLayout:function(r,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,r,n)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}cr(mc,rne("hostGraph","data"));cr(tne,rne("hostGraph","edgeData"));function rR(e,t,r,n,i){for(var a=new O8e(n),o=0;o "+h)),u++)}var d=r.get("coordinateSystem"),v;if(d==="cartesian2d"||d==="polar"||d==="matrix")v=Xo(e,r);else{var g=Uv.get(d),m=g?g.dimensions||[]:[];We(m,"value")<0&&m.concat(["value"]);var y=qv(e,{coordDimensions:m,encodeDefine:r.getEncode()}).dimensions;v=new En(y,r),v.initData(e)}var _=new En(["value"],r);return _.initData(l,s),i&&i(v,_),jre({mainData:v,struct:a,structAttr:"graph",datas:{node:v,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var E8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new tp(i,i),this.fillDataTextStyle(r.edges||r.links),this._updateCategoriesData()},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(r){e.prototype.mergeDefaultAndTheme.apply(this,arguments),cf(r,"edgeLabel",["show"])},t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],o=this;if(a&&i){x8e(this);var s=rR(a,i,this,!0,l);return B(s.edges,function(u){_8e(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(v){var g=o._categoriesModels,m=v.getShallow("category"),y=g[m];return y&&(y.parentModel=v.parentModel,v.parentModel=y),v});var f=et.prototype.getModel;function h(v,g){var m=f.call(this,v,g);return m.resolveParentPath=d,m}c.wrapMethod("getItemModel",function(v){return v.resolveParentPath=d,v.getModel=h,v});function d(v){if(v&&(v[0]==="label"||v[1]==="label")){var g=v.slice();return v[0]==="label"?g[0]="edgeLabel":v[1]==="label"&&(g[1]="edgeLabel"),g}return v}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(r,n,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(r,i),s=a.graph.getEdgeByIndex(r),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Cr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=aee({series:this,dataIndex:r,multipleSeries:n});return f},t.prototype._updateCategoriesData=function(){var r=se(this.option.categories||[],function(i){return i.value!=null?i:ie({value:0},i)}),n=new En(["value"],this);n.initData(r),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:J.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:J.color.primary}}},t}(Tt);function D8e(e){e.registerChartView(I8e),e.registerSeriesModel(E8e),e.registerProcessor(v8e),e.registerVisual(p8e),e.registerVisual(g8e),e.registerLayout(b8e),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,S8e),e.registerLayout(C8e),e.registerCoordinateSystem("graphView",{dimensions:Rf.dimensions,create:M8e}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},sr),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},sr),e.registerAction({type:"graphRoam",event:"graphRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",query:t},function(i){var a=n.getViewOfSeriesModel(i);a&&(t.dx!=null&&t.dy!=null&&a.updateViewOnPan(i,n,t),t.zoom!=null&&t.originX!=null&&t.originY!=null&&a.updateViewOnZoom(i,n,t));var o=i.coordinateSystem,s=QT(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var GW=function(e){q(t,e);function t(r,n,i){var a=e.call(this)||this;De(a).dataType="node",a.z2=2;var o=new at;return a.setTextContent(o),a.updateData(r,n,i,!0),a}return t.prototype.updateData=function(r,n,i,a){var o=this,s=r.graph.getNodeByIndex(n),l=r.hostModel,u=s.getModel(),c=u.getModel("emphasis"),f=r.getItemLayout(n),h=ie(Mo(u.getModel("itemStyle"),f,!0),f),d=this;if(isNaN(h.startAngle)){d.setShape(h);return}a?d.setShape(h):lt(d,{shape:h},l,n);var v=ie(Mo(u.getModel("itemStyle"),f,!0),f);o.setShape(v),o.useStyle(r.getItemVisual(n,"style")),Dr(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,d),Dr(d,u,"itemStyle");var g=c.get("focus");Gt(this,g==="adjacency"?s.getAdjacentDataIndices():g,c.get("blurScope"),c.get("disabled"))},t.prototype._updateLabel=function(r,n,i){var a=this.getTextContent(),o=i.getLayout(),s=(o.startAngle+o.endAngle)/2,l=Math.cos(s),u=Math.sin(s),c=n.getModel("label");a.ignore=!c.get("show");var f=Nr(n),h=i.getVisual("style");Ur(a,f,{labelFetcher:{getFormattedLabel:function(_,b,S,T,C,A){return r.getFormattedLabel(_,b,"node",T,li(C,f.normal&&f.normal.get("formatter"),n.get("name")),A)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:h.fill,defaultOpacity:h.opacity,defaultOutsidePosition:"startArc"});var d=c.get("position")||"outside",v=c.get("distance")||0,g;d==="outside"?g=o.r+v:g=(o.r+o.r0)/2,this.textConfig={inside:d!=="outside"};var m=d!=="outside"?c.get("align")||"center":l>0?"left":"right",y=d!=="outside"?c.get("verticalAlign")||"middle":u>0?"top":"bottom";a.attr({x:l*g+o.cx,y:u*g+o.cy,rotation:0,style:{align:m,verticalAlign:y}})},t}(_n),N8e=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return De(o).dataType="edge",o.updateData(r,n,i,a,!0),o}return t.prototype.buildPath=function(r,n){r.moveTo(n.s1[0],n.s1[1]);var i=.7,a=n.clockwise;r.arc(n.cx,n.cy,n.r,n.sStartAngle,n.sEndAngle,!a),r.bezierCurveTo((n.cx-n.s2[0])*i+n.s2[0],(n.cy-n.s2[1])*i+n.s2[1],(n.cx-n.t1[0])*i+n.t1[0],(n.cy-n.t1[1])*i+n.t1[1],n.t1[0],n.t1[1]),r.arc(n.cx,n.cy,n.r,n.tStartAngle,n.tEndAngle,!a),r.bezierCurveTo((n.cx-n.t2[0])*i+n.t2[0],(n.cy-n.t2[1])*i+n.t2[1],(n.cx-n.s1[0])*i+n.s1[0],(n.cy-n.s1[1])*i+n.s1[1],n.s1[0],n.s1[1]),r.closePath()},t.prototype.updateData=function(r,n,i,a,o){var s=r.hostModel,l=n.graph.getEdgeByIndex(i),u=l.getLayout(),c=l.node1.getModel(),f=n.getItemModel(l.dataIndex),h=f.getModel("lineStyle"),d=f.getModel("emphasis"),v=d.get("focus"),g=ie(Mo(c.getModel("itemStyle"),u,!0),u),m=this;if(isNaN(g.sStartAngle)||isNaN(g.tStartAngle)){m.setShape(g);return}o?(m.setShape(g),WW(m,l,r,h)):(ga(m),WW(m,l,r,h),lt(m,{shape:g},s,i)),Gt(this,v==="adjacency"?l.getAdjacentDataIndices():v,d.get("blurScope"),d.get("disabled")),Dr(m,f,"lineStyle"),n.setItemGraphicEl(l.dataIndex,m)},t}(tt);function WW(e,t,r,n){var i=t.node1,a=t.node2,o=e.style;e.setStyle(n.getLineStyle());var s=n.get("color");switch(s){case"source":o.fill=r.getItemVisual(i.dataIndex,"style").fill,o.decal=i.getVisual("style").decal;break;case"target":o.fill=r.getItemVisual(a.dataIndex,"style").fill,o.decal=a.getVisual("style").decal;break;case"gradient":var l=r.getItemVisual(i.dataIndex,"style").fill,u=r.getItemVisual(a.dataIndex,"style").fill;if(pe(l)&&pe(u)){var c=e.shape,f=(c.s1[0]+c.s2[0])/2,h=(c.s1[1]+c.s2[1])/2,d=(c.t1[0]+c.t2[0])/2,v=(c.t1[1]+c.t2[1])/2;o.fill=new Lf(f,h,d,v,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var j8e=Math.PI/180,R8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){},t.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group,l=-r.get("startAngle")*j8e;if(a.diff(o).add(function(c){var f=a.getItemLayout(c);if(f){var h=new GW(a,c,l);De(h).dataIndex=c,s.add(h)}}).update(function(c,f){var h=o.getItemGraphicEl(f),d=a.getItemLayout(c);if(!d){h&&Ps(h,r,f);return}h?h.updateData(a,c,l):h=new GW(a,c,l),s.add(h)}).remove(function(c){var f=o.getItemGraphicEl(c);f&&Ps(f,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=ve(u[0],i.getWidth()),this.group.originY=ve(u[1],i.getHeight()),Dt(this.group,{scaleX:1,scaleY:1},r)}this._data=a,this.renderEdges(r,l)},t.prototype.renderEdges=function(r,n){var i=r.getData(),a=r.getEdgeData(),o=this._edgeData,s=this.group;a.diff(o).add(function(l){var u=new N8e(i,a,l,n);De(u).dataIndex=l,s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(i,a,l,n),s.add(c)}).remove(function(l){var u=o.getItemGraphicEl(l);u&&Ps(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(bt),B8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links),this.legendVisualProvider=new tp(me(this.getData,this),me(this.getRawData,this))},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links)},t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[];if(a&&i){var o=rR(a,i,this,!0,s);return o.data}function s(l,u){var c=et.prototype.getModel;function f(d,v){var g=c.call(this,d,v);return g.resolveParentPath=h,g}u.wrapMethod("getItemModel",function(d){return d.resolveParentPath=h,d.getModel=f,d});function h(d){if(d&&(d[0]==="label"||d[1]==="label")){var v=d.slice();return d[0]==="label"?v[0]="edgeLabel":d[1]==="label"&&(v[1]="edgeLabel"),v}return d}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(r,n,i){var a=this.getDataParams(r,i);if(i==="edge"){var o=this.getData(),s=o.graph.getEdgeByIndex(r),l=o.getName(s.node1.dataIndex),u=o.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Cr("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return Cr("nameValue",{name:a.name,value:a.value,noValue:a.value==null})},t.prototype.getDataParams=function(r,n){var i=e.prototype.getDataParams.call(this,r,n);if(n==="node"){var a=this.getData(),o=this.getGraph().getNodeByIndex(r);if(i.name==null&&(i.name=a.getName(r)),i.value==null){var s=o.getLayout().value;i.value=s}}return i},t.type="series.chord",t.defaultOption={z:2,coordinateSystem:"none",legendHoverLink:!0,colorBy:"data",left:0,top:0,right:0,bottom:0,width:null,height:null,center:["50%","50%"],radius:["70%","80%"],clockwise:!0,startAngle:90,endAngle:"auto",minAngle:0,padAngle:3,itemStyle:{borderRadius:[0,0,5,5]},lineStyle:{width:0,color:"source",opacity:.2},label:{show:!0,position:"outside",distance:5},emphasis:{focus:"adjacency",lineStyle:{opacity:.5}}},t}(Tt),kM=Math.PI/180;function z8e(e,t){e.eachSeriesByType("chord",function(r){$8e(r,t)})}function $8e(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=TQ(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=Math.max((e.get("padAngle")||0)*kM,0),h=Math.max((e.get("minAngle")||0)*kM,0),d=-e.get("startAngle")*kM,v=d+Math.PI*2,g=e.get("clockwise"),m=g?1:-1,y=[d,v];NT(y,!g);var _=y[0],b=y[1],S=b-_,T=r.getSum("value")===0&&i.getSum("value")===0,C=[],A=0;n.eachEdge(function(j){var U=T?1:j.getValue("value");T&&(U>0||h)&&(A+=2);var G=j.node1.dataIndex,V=j.node2.dataIndex;C[G]=(C[G]||0)+U,C[V]=(C[V]||0)+U});var P=0;if(n.eachNode(function(j){var U=j.getValue("value");isNaN(U)||(C[j.dataIndex]=Math.max(U,C[j.dataIndex]||0)),!T&&(C[j.dataIndex]>0||h)&&A++,P+=C[j.dataIndex]||0}),!(A===0||P===0)){f*A>=Math.abs(S)&&(f=Math.max(0,(Math.abs(S)-h*A)/A)),(f+h)*A>=Math.abs(S)&&(h=(Math.abs(S)-f*A)/A);var I=(S-f*A*m)/P,k=0,E=0,D=0;n.eachNode(function(j){var U=C[j.dataIndex]||0,G=I*(P?U:1)*m;Math.abs(G)E){var z=k/E;n.eachNode(function(j){var U=j.getLayout().angle;Math.abs(U)>=h?j.setLayout({angle:U*z,ratio:z},!0):j.setLayout({angle:h,ratio:h===0?1:U/h},!0)})}else n.eachNode(function(j){if(!N){var U=j.getLayout().angle,G=Math.min(U/D,1),V=G*k;U-Vh&&h>0){var G=N?1:Math.min(U/D,1),V=U-h,Y=Math.min(V,Math.min(F,k*G));F-=Y,j.setLayout({angle:U-Y,ratio:(U-Y)/U},!0)}else h>0&&j.setLayout({angle:h,ratio:U===0?1:h/U},!0)}});var $=_,Z=[];n.eachNode(function(j){var U=Math.max(j.getLayout().angle,h);j.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:$,endAngle:$+U*m,clockwise:g},!0),Z[j.dataIndex]=$,$+=(U+f)*m}),n.eachEdge(function(j){var U=T?1:j.getValue("value"),G=I*(P?U:1)*m,V=j.node1.dataIndex,Y=Z[V]||0,K=Math.abs((j.node1.getLayout().ratio||1)*G),ee=Y+K*m,le=[s+c*Math.cos(Y),l+c*Math.sin(Y)],he=[s+c*Math.cos(ee),l+c*Math.sin(ee)],Re=j.node2.dataIndex,ge=Z[Re]||0,ne=Math.abs((j.node2.getLayout().ratio||1)*G),fe=ge+ne*m,ue=[s+c*Math.cos(ge),l+c*Math.sin(ge)],te=[s+c*Math.cos(fe),l+c*Math.sin(fe)];j.setLayout({s1:le,s2:he,sStartAngle:Y,sEndAngle:ee,t1:ue,t2:te,tStartAngle:ge,tEndAngle:fe,cx:s,cy:l,r:c,value:U,clockwise:g}),Z[V]=ee,Z[Re]=fe})}}}function F8e(e){e.registerChartView(R8e),e.registerSeriesModel(B8e),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,z8e),e.registerProcessor(Qv("chord"))}var V8e=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),G8e=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="pointer",n}return t.prototype.getDefaultShape=function(){return new V8e},t.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),c=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,c),r.lineTo(n.x+i(l)*s,n.y+a(l)*s),r.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),r.lineTo(n.x-i(l)*s,n.y-a(l)*s),r.lineTo(u,c)},t}(tt);function W8e(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=ve(r[0],t.getWidth()),s=ve(r[1],t.getHeight()),l=ve(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function w_(e,t){var r=e==null?"":e+"";return t&&(pe(t)?r=t.replace("{value}",r):Ce(t)&&(r=t(e))),r}var H8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){this.group.removeAll();var a=r.get(["axisLine","lineStyle","color"]),o=W8e(r,i);this._renderMain(r,n,i,a,o),this._data=r.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(r,n,i,a,o){var s=this.group,l=r.get("clockwise"),u=-r.get("startAngle")/180*Math.PI,c=-r.get("endAngle")/180*Math.PI,f=r.getModel("axisLine"),h=f.get("roundCap"),d=h?Bw:_n,v=f.get("show"),g=f.getModel("lineStyle"),m=g.get("width"),y=[u,c];NT(y,!l),u=y[0],c=y[1];for(var _=c-u,b=u,S=[],T=0;v&&T=I&&(k===0?0:a[k-1][0])Math.PI/2&&(ee+=Math.PI)):K==="tangential"?ee=-P-Math.PI/2:ot(K)&&(ee=K*Math.PI/180),ee===0?f.add(new at({style:Mt(b,{text:U,x:V,y:Y,verticalAlign:F<-.8?"top":F>.8?"bottom":"middle",align:z<-.4?"left":z>.4?"right":"center"},{inheritColor:G}),silent:!0})):f.add(new at({style:Mt(b,{text:U,x:V,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:G}),silent:!0,originX:V,originY:Y,rotation:ee}))}if(_.get("show")&&$!==S){var Z=_.get("distance");Z=Z?Z+c:c;for(var le=0;le<=T;le++){z=Math.cos(P),F=Math.sin(P);var he=new mr({shape:{x1:z*(v-Z)+h,y1:F*(v-Z)+d,x2:z*(v-A-Z)+h,y2:F*(v-A-Z)+d},silent:!0,style:D});D.stroke==="auto"&&he.setStyle({stroke:a(($+le/T)/S)}),f.add(he),P+=k}P-=k}else P+=I}},t.prototype._renderPointer=function(r,n,i,a,o,s,l,u,c){var f=this.group,h=this._data,d=this._progressEls,v=[],g=r.get(["pointer","show"]),m=r.getModel("progress"),y=m.get("show"),_=r.getData(),b=_.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),C=[S,T],A=[s,l];function P(k,E){var D=_.getItemModel(k),N=D.getModel("pointer"),z=ve(N.get("width"),o.r),F=ve(N.get("length"),o.r),$=r.get(["pointer","icon"]),Z=N.get("offsetCenter"),j=ve(Z[0],o.r),U=ve(Z[1],o.r),G=N.get("keepAspect"),V;return $?V=xr($,j-z/2,U-F,z,F,null,G):V=new G8e({shape:{angle:-Math.PI/2,width:z,r:F,x:j,y:U}}),V.rotation=-(E+Math.PI/2),V.x=o.cx,V.y=o.cy,V}function I(k,E){var D=m.get("roundCap"),N=D?Bw:_n,z=m.get("overlap"),F=z?m.get("width"):c/_.count(),$=z?o.r-F:o.r-(k+1)*F,Z=z?o.r:o.r-k*F,j=new N({shape:{startAngle:s,endAngle:E,cx:o.cx,cy:o.cy,clockwise:u,r0:$,r:Z}});return z&&(j.z2=gt(_.get(b,k),[S,T],[100,0],!0)),j}(y||g)&&(_.diff(h).add(function(k){var E=_.get(b,k);if(g){var D=P(k,s);Dt(D,{rotation:-((isNaN(+E)?A[0]:gt(E,C,A,!0))+Math.PI/2)},r),f.add(D),_.setItemGraphicEl(k,D)}if(y){var N=I(k,s),z=m.get("clip");Dt(N,{shape:{endAngle:gt(E,C,A,z)}},r),f.add(N),gI(r.seriesIndex,_.dataType,k,N),v[k]=N}}).update(function(k,E){var D=_.get(b,k);if(g){var N=h.getItemGraphicEl(E),z=N?N.rotation:s,F=P(k,z);F.rotation=z,lt(F,{rotation:-((isNaN(+D)?A[0]:gt(D,C,A,!0))+Math.PI/2)},r),f.add(F),_.setItemGraphicEl(k,F)}if(y){var $=d[E],Z=$?$.shape.endAngle:s,j=I(k,Z),U=m.get("clip");lt(j,{shape:{endAngle:gt(D,C,A,U)}},r),f.add(j),gI(r.seriesIndex,_.dataType,k,j),v[k]=j}}).execute(),_.each(function(k){var E=_.getItemModel(k),D=E.getModel("emphasis"),N=D.get("focus"),z=D.get("blurScope"),F=D.get("disabled");if(g){var $=_.getItemGraphicEl(k),Z=_.getItemVisual(k,"style"),j=Z.fill;if($ instanceof Yr){var U=$.style;$.useStyle(ie({image:U.image,x:U.x,y:U.y,width:U.width,height:U.height},Z))}else $.useStyle(Z),$.type!=="pointer"&&$.setColor(j);$.setStyle(E.getModel(["pointer","itemStyle"]).getItemStyle()),$.style.fill==="auto"&&$.setStyle("fill",a(gt(_.get(b,k),C,[0,1],!0))),$.z2EmphasisLift=0,Dr($,E),Gt($,N,z,F)}if(y){var G=v[k];G.useStyle(_.getItemVisual(k,"style")),G.setStyle(E.getModel(["progress","itemStyle"]).getItemStyle()),G.z2EmphasisLift=0,Dr(G,E),Gt(G,N,z,F)}}),this._progressEls=v)},t.prototype._renderAnchor=function(r,n){var i=r.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),c=xr(s,n.cx-o/2+ve(l[0],n.r),n.cy-o/2+ve(l[1],n.r),o,o,null,u);c.z2=i.get("showAbove")?1:0,c.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(c)}},t.prototype._renderTitleAndDetail=function(r,n,i,a,o){var s=this,l=r.getData(),u=l.mapDimension("value"),c=+r.get("min"),f=+r.get("max"),h=new Me,d=[],v=[],g=r.isAnimationEnabled(),m=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(y){d[y]=new at({silent:!0}),v[y]=new at({silent:!0})}).update(function(y,_){d[y]=s._titleEls[_],v[y]=s._detailEls[_]}).execute(),l.each(function(y){var _=l.getItemModel(y),b=l.get(u,y),S=new Me,T=a(gt(b,[c,f],[0,1],!0)),C=_.getModel("title");if(C.get("show")){var A=C.get("offsetCenter"),P=o.cx+ve(A[0],o.r),I=o.cy+ve(A[1],o.r),k=d[y];k.attr({z2:m?0:2,style:Mt(C,{x:P,y:I,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(k)}var E=_.getModel("detail");if(E.get("show")){var D=E.get("offsetCenter"),N=o.cx+ve(D[0],o.r),z=o.cy+ve(D[1],o.r),F=ve(E.get("width"),o.r),$=ve(E.get("height"),o.r),Z=r.get(["progress","show"])?l.getItemVisual(y,"style").fill:T,k=v[y],j=E.get("formatter");k.attr({z2:m?0:2,style:Mt(E,{x:N,y:z,text:w_(b,j),width:isNaN(F)?null:F,height:isNaN($)?null:$,align:"center",verticalAlign:"middle"},{inheritColor:Z})}),oQ(k,{normal:E},b,function(G){return w_(G,j)}),g&&sQ(k,y,l,r,{getFormattedLabel:function(G,V,Y,K,ee,le){return w_(le?le.interpolatedValue:b,j)}}),S.add(k)}h.add(S)}),this.group.add(h),this._titleEls=d,this._detailEls=v},t.type="gauge",t}(bt),U8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.visualStyleAccessPath="itemStyle",r}return t.prototype.getInitialData=function(r,n){return ep(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,J.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:J.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:J.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:J.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:J.color.neutral00,borderWidth:0,borderColor:J.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:J.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:J.color.transparent,borderWidth:0,borderColor:J.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:J.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Tt);function Z8e(e){e.registerChartView(H8e),e.registerSeriesModel(U8e)}var Y8e=["itemStyle","opacity"],X8e=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new an,s=new at;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(r,n,!0),i}return t.prototype.updateData=function(r,n,i){var a=this,o=r.hostModel,s=r.getItemModel(n),l=r.getItemLayout(n),u=s.getModel("emphasis"),c=s.get(Y8e);c=c??1,i||ga(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Dt(a,{style:{opacity:c}},o,n)):lt(a,{style:{opacity:c},shape:{points:l.points}},o,n),Dr(a,s),this._updateLabel(r,n),Gt(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=r.hostModel,l=r.getItemModel(n),u=r.getItemLayout(n),c=u.label,f=r.getItemVisual(n,"style"),h=f.fill;Ur(o,Nr(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:f.opacity,defaultText:r.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}});var d=l.getModel("label"),v=d.get("color"),g=v==="inherit"?h:null;i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:g,outsideFill:g});var m=c.linePoints;a.setShape({points:m}),i.textGuideLineConfig={anchor:m?new Ie(m[0][0],m[0][1]):null},lt(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),kj(i,Lj(l),{stroke:h})},t}(bn),q8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.ignoreLabelLineUpdate=!0,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new X8e(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);Ps(u,r,l)}).execute(),this._data=a},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(bt),K8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new tp(me(this.getData,this),me(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return ep(this,{coordDimensions:["value"],encodeDefaulter:Fe(nj,this)})},t.prototype._defaultLabelLine=function(r){cf(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},t.prototype.getDataParams=function(r){var n=this.getData(),i=e.prototype.getDataParams.call(this,r),a=n.mapDimension("value"),o=n.getSum(a);return i.percent=o?+(n.get(a,r)/o*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series.funnel",t.defaultOption={coordinateSystemUsage:"box",z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:65,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:J.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:J.color.primary}}},t}(Tt);function J8e(e,t){for(var r=e.mapDimension("value"),n=e.mapArray(r,function(l){return l}),i=[],a=t==="ascending",o=0,s=e.count();ovHe)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!(this._mouseDownPoint||!IM(this,"mousemove"))){var t=this._model,r=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=r.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:r.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function IM(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var mHe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(r){var n=this.option;r&&He(n,r,!0),this._initDimensions()},t.prototype.contains=function(r,n){var i=r.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},t.prototype.setAxisExpand=function(r){B(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){r.hasOwnProperty(n)&&(this.option[n]=r[n])},this)},t.prototype._initDimensions=function(){var r=this.dimensions=[],n=this.parallelAxisIndex=[],i=ht(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);B(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}(Ke),yHe=function(e){q(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return t.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},t}(ba);function hu(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=yh(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=yh(s,[0,o]),i=a=yh(s,[i,a]),n=0}t[0]=yh(t[0],r),t[1]=yh(t[1],r);var l=OM(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=yh(t[n],c);var f;return f=OM(t,n),i!=null&&(f.sign!==l.sign||f.spana&&(t[1-n]=t[n]+f.sign*a),t}function OM(e,t){var r=e[t]-e[1-t];return{span:Math.abs(r),sign:r>0?-1:r<0?1:t?-1:1}}function yh(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var EM=B,ine=Math.min,ane=Math.max,ZW=Math.floor,xHe=Math.ceil,YW=gr,_He=Math.PI,bHe=function(){function e(t,r,n){this.type="parallel",this._axesMap=_e(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,r,n)}return e.prototype._init=function(t,r,n){var i=t.dimensions,a=t.parallelAxisIndex;EM(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new yHe(o,y0(u),[0,0],u.get("type"),l)),f=c.type==="category";c.onBand=f&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},e.prototype.update=function(t,r){this._updateAxesFromSeries(this._model,t)},e.prototype.containPoint=function(t){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,o=t[1-a],s=t[a];return o>=n&&o<=n+r.axisLength&&s>=i&&s<=i+r.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(t,r){r.eachSeries(function(n){if(t.contains(n,r)){var i=n.getData();EM(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),mf(o.scale,o.model)},this)}},this)},e.prototype.resize=function(t,r){var n=jr(t,r).refContainer;this._rect=zt(t.getBoxLayoutParams(),n),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var t=this._model,r=this._rect,n=["x","y"],i=["width","height"],a=t.get("layout"),o=a==="horizontal"?0:1,s=r[i[o]],l=[0,s],u=this.dimensions.length,c=S_(t.get("axisExpandWidth"),l),f=S_(t.get("axisExpandCount")||0,[0,u]),h=t.get("axisExpandable")&&u>3&&u>f&&f>1&&c>0&&s>0,d=t.get("axisExpandWindow"),v;if(d)v=S_(d[1]-d[0],l),d[1]=d[0]+v;else{v=S_(c*(f-1),l);var g=t.get("axisExpandCenter")||ZW(u/2);d=[c*g-v/2],d[1]=d[0]+v}var m=(s-v)/(u-f);m<3&&(m=0);var y=[ZW(YW(d[0]/c,1))+1,xHe(YW(d[1]/c,1))-1],_=m/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:r[n[o]],layoutLength:s,axisBase:r[n[1-o]],axisLength:r[i[1-o]],axisExpandable:h,axisExpandWidth:c,axisCollapseWidth:m,axisExpandWindow:d,axisCount:u,winInnerIndices:y,axisExpandWindow0Pos:_}},e.prototype._layoutAxes=function(){var t=this._rect,r=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;r.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),EM(n,function(o,s){var l=(i.axisExpandable?SHe:wHe)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:_He/2,vertical:0},f=[u[a].x+t.x,u[a].y+t.y],h=c[a],d=Wr();Ks(d,d,h),Ya(d,d,f),this._axesLayout[o]={position:f,rotation:h,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},e.prototype.getAxis=function(t){return this._axesMap.get(t)},e.prototype.dataToPoint=function(t,r){return this.axisCoordToPoint(this._axesMap.get(r).dataToCoord(t),r)},e.prototype.eachActiveState=function(t,r,n,i){n==null&&(n=0),i==null&&(i=t.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];B(o,function(m){s.push(t.mapDimension(m)),l.push(a.get(m).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-f[0])?(u="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=r.axisExpandWidth/c,l?hu(l,i,o,"all"):u="none";else{var d=i[1]-i[0],v=o[1]*s/d;i=[ane(0,v-d/2)],i[1]=ine(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function S_(e,t){return ine(ane(e,t[0]),t[1])}function wHe(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function SHe(e,t){var r=t.layoutLength,n=t.axisExpandWidth,i=t.axisCount,a=t.axisCollapseWidth,o=t.winInnerIndices,s,l=a,u=!1,c;return e=0;i--)Ai(n[i])},t.prototype.getActiveState=function(r){var n=this.activeIntervals;if(!n.length)return"normal";if(r==null||isNaN(+r))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=r&&r<=i[1])return"active"}else for(var a=0,o=n.length;aPHe}function fne(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function hne(e,t,r,n){var i=new Me;return i.add(new Xe({name:"main",style:sR(r),silent:!0,draggable:!0,cursor:"move",drift:Fe(KW,e,t,i,["n","s","w","e"]),ondragend:Fe(xf,t,{isEnd:!0})})),B(n,function(a){i.add(new Xe({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Fe(KW,e,t,i,a),ondragend:Fe(xf,t,{isEnd:!0})}))}),i}function dne(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=cv(i,kHe),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,c=r[0][1],f=r[1][1],h=c-a+i/2,d=f-a+i/2,v=c-o,g=f-s,m=v+i,y=g+i;as(e,t,"main",o,s,v,g),n.transformable&&(as(e,t,"w",l,u,a,y),as(e,t,"e",h,u,a,y),as(e,t,"n",l,u,m,a),as(e,t,"s",l,d,m,a),as(e,t,"nw",l,u,a,a),as(e,t,"ne",h,u,a,a),as(e,t,"sw",l,d,a,a),as(e,t,"se",h,d,a,a))}function SO(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(sR(r)),i.attr({silent:!n,cursor:n?"move":"default"}),B([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?TO(e,a[0]):NHe(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?IHe[s]+"-resize":null})})}function as(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(RHe(lR(e,t,[[n,i],[n+a,i+o]])))}function sR(e){return Pe({strokeNoScale:!0},e.brushStyle)}function vne(e,t,r,n){var i=[zy(e,r),zy(t,n)],a=[cv(e,r),cv(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function DHe(e){return ql(e.group)}function TO(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=zT(r[t],DHe(e));return n[i]}function NHe(e,t){var r=[TO(e,t[0]),TO(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function KW(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=pne(t,i,a);B(n,function(u){var c=LHe[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(vne(s[0][0],s[1][0],s[0][1],s[1][1])),iR(t,r),xf(t,{isEnd:!1})}function jHe(e,t,r,n){var i=t.__brushOption.range,a=pne(e,r,n);B(i,function(o){o[0]+=a[0],o[1]+=a[1]}),iR(e,t),xf(e,{isEnd:!1})}function pne(e,t,r){var n=e.group,i=n.transformCoordToLocal(t,r),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function lR(e,t,r){var n=cne(e,t);return n&&n!==yf?n.clipPath(r,e._transform):Ae(r)}function RHe(e){var t=zy(e[0][0],e[1][0]),r=zy(e[0][1],e[1][1]),n=cv(e[0][0],e[1][0]),i=cv(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function BHe(e,t,r){if(!(!e._brushType||$He(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=oR(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var nC={lineX:e8(0),lineY:e8(1),rect:{createCover:function(e,t){function r(n){return n}return hne({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=fne(e);return vne(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){dne(e,t,r,n)},updateCommon:SO,contain:AO},polygon:{createCover:function(e,t){var r=new Me;return r.add(new an({name:"main",style:sR(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new bn({name:"main",draggable:!0,drift:Fe(jHe,e,t),ondragend:Fe(xf,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:lR(e,t,r)})},updateCommon:SO,contain:AO}};function e8(e){return{createCover:function(t,r){return hne({toRectRange:function(n){var i=[n,[0,100]];return e&&i.reverse(),i},fromRectRange:function(n){return n[e]}},t,r,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var r=fne(t),n=zy(r[0][e],r[1][e]),i=cv(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=cne(t,r);if(o!==yf&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[n,a];e&&l.reverse(),dne(t,r,l,i)},updateCommon:SO,contain:AO}}function mne(e){return e=uR(e),function(t){return BN(t,e)}}function yne(e,t){return e=uR(e),function(r){var n=t??r,i=n?e.width:e.height,a=n?e.x:e.y;return[a,a+(i||0)]}}function xne(e,t,r){var n=uR(e);return function(i,a){return n.contain(a[0],a[1])&&!Tre(i,t,r)}}function uR(e){return Oe.create(e)}var FHe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){e.prototype.init.apply(this,arguments),(this._brushController=new nR(n.getZr())).on("brush",me(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!VHe(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Me,this.group.add(this._axisGroup),!!r.get("show")){var s=WHe(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,f=r.axis.dim,h=l.getAxisLayout(f),d=ie({strokeContainThreshold:c},h),v=new Wn(r,i,d);v.build(),this._axisGroup.add(v.group),this._refreshBrushController(d,u,r,s,c,i),v0(o,this._axisGroup,r)}}},t.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),f=Oe.create({x:l[0],y:-o/2,width:u,height:o});f.x-=c,f.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:mne(f),isTargetByCursor:xne(f,s,a),getLinearBrushOtherExtent:yne(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(GHe(i))},t.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=se(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(kt);function VHe(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function GHe(e){var t=e.axis;return se(e.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(r[0],!0),t.dataToCoord(r[1],!0)]}})}function WHe(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var HHe={type:"axisAreaSelect",event:"axisAreaSelected"};function UHe(e){e.registerAction(HHe,function(t,r){r.eachComponent({mainType:"parallelAxis",query:t},function(n){n.axis.model.setActiveIntervals(t.intervals)})}),e.registerAction("parallelAxisExpand",function(t,r){r.eachComponent({mainType:"parallel",query:t},function(n){n.setAxisExpand(t)})})}var ZHe={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function _ne(e){e.registerComponentView(pHe),e.registerComponentModel(mHe),e.registerCoordinateSystem("parallel",CHe),e.registerPreprocessor(fHe),e.registerComponentModel(bO),e.registerComponentView(FHe),lv(e,"parallel",bO,ZHe),UHe(e)}function YHe(e){Ze(_ne),e.registerChartView(nHe),e.registerSeriesModel(oHe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,cHe)}var XHe=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return e}(),qHe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new XHe},t.prototype.buildPath=function(r,n){var i=n.extent;r.moveTo(n.x1,n.y1),r.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(r.lineTo(n.x2+i,n.y2),r.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(r.lineTo(n.x2,n.y2+i),r.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),r.closePath()},t.prototype.highlight=function(){Fs(this)},t.prototype.downplay=function(){Vs(this)},t}(tt),KHe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._mainGroup=new Me,r._focusAdjacencyDisabled=!1,r}return t.prototype.init=function(r,n){this._controller=new jf(n.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(r,n,i){var a=this,o=r.getGraph(),s=this._mainGroup,l=r.layoutInfo,u=l.width,c=l.height,f=r.getData(),h=r.getData("edge"),d=r.get("orient");this._model=r,s.removeAll(),s.x=l.x,s.y=l.y,this._updateViewCoordSys(r,i),Cre(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(v){var g=new qHe,m=De(g);m.dataIndex=v.dataIndex,m.seriesIndex=r.seriesIndex,m.dataType="edge";var y=v.getModel(),_=y.getModel("lineStyle"),b=_.get("curveness"),S=v.node1.getLayout(),T=v.node1.getModel(),C=T.get("localX"),A=T.get("localY"),P=v.node2.getLayout(),I=v.node2.getModel(),k=I.get("localX"),E=I.get("localY"),D=v.getLayout(),N,z,F,$,Z,j,U,G;g.shape.extent=Math.max(1,D.dy),g.shape.orient=d,d==="vertical"?(N=(C!=null?C*u:S.x)+D.sy,z=(A!=null?A*c:S.y)+S.dy,F=(k!=null?k*u:P.x)+D.ty,$=E!=null?E*c:P.y,Z=N,j=z*(1-b)+$*b,U=F,G=z*b+$*(1-b)):(N=(C!=null?C*u:S.x)+S.dx,z=(A!=null?A*c:S.y)+D.sy,F=k!=null?k*u:P.x,$=(E!=null?E*c:P.y)+D.ty,Z=N*(1-b)+F*b,j=z,U=N*b+F*(1-b),G=$),g.setShape({x1:N,y1:z,x2:F,y2:$,cpx1:Z,cpy1:j,cpx2:U,cpy2:G}),g.useStyle(_.getItemStyle()),t8(g.style,d,v);var V=""+y.get("value"),Y=Nr(y,"edgeLabel");Ur(g,Y,{labelFetcher:{getFormattedLabel:function(le,he,Re,ge,ne,fe){return r.getFormattedLabel(le,he,"edge",ge,li(ne,Y.normal&&Y.normal.get("formatter"),V),fe)}},labelDataIndex:v.dataIndex,defaultText:V}),g.setTextConfig({position:"inside"});var K=y.getModel("emphasis");Dr(g,y,"lineStyle",function(le){var he=le.getItemStyle();return t8(he,d,v),he}),s.add(g),h.setItemGraphicEl(v.dataIndex,g);var ee=K.get("focus");Gt(g,ee==="adjacency"?v.getAdjacentDataIndices():ee==="trajectory"?v.getTrajectoryDataIndices():ee,K.get("blurScope"),K.get("disabled"))}),o.eachNode(function(v){var g=v.getLayout(),m=v.getModel(),y=m.get("localX"),_=m.get("localY"),b=m.getModel("emphasis"),S=m.get(["itemStyle","borderRadius"])||0,T=new Xe({shape:{x:y!=null?y*u:g.x,y:_!=null?_*c:g.y,width:g.dx,height:g.dy,r:S},style:m.getModel("itemStyle").getItemStyle(),z2:10});Ur(T,Nr(m),{labelFetcher:{getFormattedLabel:function(A,P){return r.getFormattedLabel(A,P,"node")}},labelDataIndex:v.dataIndex,defaultText:v.id}),T.disableLabelAnimation=!0,T.setStyle("fill",v.getVisual("color")),T.setStyle("decal",v.getVisual("style").decal),Dr(T,m),s.add(T),f.setItemGraphicEl(v.dataIndex,T),De(T).dataType="node";var C=b.get("focus");Gt(T,C==="adjacency"?v.getAdjacentDataIndices():C==="trajectory"?v.getTrajectoryDataIndices():C,b.get("blurScope"),b.get("disabled"))}),f.eachItemGraphicEl(function(v,g){var m=f.getItemModel(g);m.get("draggable")&&(v.drift=function(y,_){a._focusAdjacencyDisabled=!0,this.shape.x+=y,this.shape.y+=_,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:f.getRawIndex(g),localX:this.shape.x/u,localY:this.shape.y/c})},v.ondragend=function(){a._focusAdjacencyDisabled=!1},v.draggable=!0,v.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(JHe(s.getBoundingRect(),r,function(){s.removeClipPath()})),this._data=r.getData()},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._updateViewCoordSys=function(r,n){var i=r.layoutInfo,a=i.width,o=i.height,s=r.coordinateSystem=new Rf(null,{api:n,ecModel:r.ecModel});s.zoomLimit=r.get("scaleLimit"),s.setBoundingRect(0,0,a,o),s.setCenter(r.get("center")),s.setZoom(r.get("zoom")),this._controllerHost.target.attr({x:s.x,y:s.y,scaleX:s.scaleX,scaleY:s.scaleY})},t.type="sankey",t}(bt);function t8(e,t,r){switch(e.fill){case"source":e.fill=r.node1.getVisual("color"),e.decal=r.node1.getVisual("style").decal;break;case"target":e.fill=r.node2.getVisual("color"),e.decal=r.node2.getVisual("style").decal;break;case"gradient":var n=r.node1.getVisual("color"),i=r.node2.getVisual("color");pe(n)&&pe(i)&&(e.fill=new Lf(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function JHe(e,t,r){var n=new Xe({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Dt(n,{shape:{width:e.width+20}},t,r),n}var QHe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],o=r.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new et(o[l],this,n));var u=rR(a,i,this,!0,c);return u.data;function c(f,h){f.wrapMethod("getItemModel",function(d,v){var g=d.parentModel,m=g.getData().getItemLayout(v);if(m){var y=m.depth,_=g.levelModels[y];_&&(d.parentModel=_)}return d}),h.wrapMethod("getItemModel",function(d,v){var g=d.parentModel,m=g.getGraph().getEdgeByIndex(v),y=m.node1.getLayout();if(y){var _=y.depth,b=g.levelModels[_];b&&(d.parentModel=b)}return d})}},t.prototype.setNodePosition=function(r,n){var i=this.option.data||this.option.nodes,a=i[r];a.localX=n[0],a.localY=n[1]},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(r,n,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var o=this.getDataParams(r,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return Cr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(r),f=c.getLayout().value,h=this.getDataParams(r,i).data.name;return Cr("nameValue",{name:h!=null?h+"":null,value:f,noValue:a(f)})}},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(r,n){var i=e.prototype.getDataParams.call(this,r,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(r),o=a.getLayout().value;i.value=o}return i},t.type="series.sankey",t.layoutMode="box",t.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:J.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:J.color.primary}},animationEasing:"linear",animationDuration:1e3},t}(Tt);function eUe(e,t){e.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=jr(r,t).refContainer,o=zt(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,f=u.edges;rUe(c);var h=ht(c,function(m){return m.getLayout().value===0}),d=h.length!==0?0:r.get("layoutIterations"),v=r.get("orient"),g=r.get("nodeAlign");tUe(c,f,n,i,s,l,d,v,g)})}function tUe(e,t,r,n,i,a,o,s,l){nUe(e,t,r,i,a,s,l),sUe(e,t,a,i,n,o,s),gUe(e,s)}function rUe(e){B(e,function(t){var r=Ql(t.outEdges,Uw),n=Ql(t.inEdges,Uw),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function nUe(e,t,r,n,i,a,o){for(var s=[],l=[],u=[],c=[],f=0,h=0;h=0;y&&m.depth>d&&(d=m.depth),g.setLayout({depth:y?m.depth:f},!0),a==="vertical"?g.setLayout({dy:r},!0):g.setLayout({dx:r},!0);for(var _=0;_f-1?d:f-1;o&&o!=="left"&&iUe(e,o,a,A);var P=a==="vertical"?(i-r)/A:(n-r)/A;oUe(e,P,a)}function bne(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function iUe(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,cUe(s,l,o),DM(s,i,r,n,o),pUe(s,l,o),DM(s,i,r,n,o)}function lUe(e,t){var r=[],n=t==="vertical"?"y":"x",i=fI(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),B(i.keys,function(a){r.push(i.buckets.get(a))}),r}function uUe(e,t,r,n,i,a){var o=1/0;B(e,function(s){var l=s.length,u=0;B(s,function(f){u+=f.getLayout().value});var c=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;c0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[h]+t;var v=i==="vertical"?n:r;if(u=c-t-v,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=f-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[h]+t-c,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function cUe(e,t,r){B(e.slice().reverse(),function(n){B(n,function(i){if(i.outEdges.length){var a=Ql(i.outEdges,fUe,r)/Ql(i.outEdges,Uw);if(isNaN(a)){var o=i.outEdges.length;a=o?Ql(i.outEdges,hUe,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-du(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-du(i,r))*t;i.setLayout({y:l},!0)}}})})}function fUe(e,t){return du(e.node2,t)*e.getValue()}function hUe(e,t){return du(e.node2,t)}function dUe(e,t){return du(e.node1,t)*e.getValue()}function vUe(e,t){return du(e.node1,t)}function du(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function Uw(e){return e.getValue()}function Ql(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),B(n,function(s){var l=new Hr({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:t.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&B(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function yUe(e){e.registerChartView(KHe),e.registerSeriesModel(QHe),e.registerLayout(eUe),e.registerVisual(mUe),e.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,r){r.eachComponent({mainType:"series",subType:"sankey",query:t},function(n){n.setNodePosition(t.dataIndex,[t.localX,t.localY])})}),e.registerAction({type:"sankeyRoam",event:"sankeyRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",subType:"sankey",query:t},function(i){var a=i.coordinateSystem,o=QT(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var wne=function(){function e(){}return e.prototype._hasEncodeRule=function(t){var r=this.getEncode();return r&&r.get(t)!=null},e.prototype.getInitialData=function(t,r){var n,i=r.getComponent("xAxis",this.get("xAxisIndex")),a=r.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(t.layout="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"?(t.layout="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")):t.layout=t.layout||"horizontal";var u=["x","y"],c=t.layout==="horizontal"?0:1,f=this._baseAxisDim=u[c],h=u[1-c],d=[i,a],v=d[c].get("type"),g=d[1-c].get("type"),m=t.data;if(m&&l){var y=[];B(m,function(S,T){var C;ae(S)?(C=S.slice(),S.unshift(T)):ae(S.value)?(C=ie({},S),C.value=C.value.slice(),S.value.unshift(T)):C=S,y.push(C)}),t.data=y}var _=this.defaultValueDimensions,b=[{name:f,type:kw(v),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:kw(g),dimsDef:_.slice()}];return ep(this,{coordDimensions:b,dimensionsCount:_.length+1,encodeDefaulter:Fe(OQ,b,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),Sne=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],r.visualDrawType="stroke",r}return t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:J.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:J.color.shadow}},animationDuration:800},t}(Tt);cr(Sne,wne,!0);var xUe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=r.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),f=r8(c,a,u,l,!0);a.setItemGraphicEl(u,f),o.add(f)}}).update(function(u,c){var f=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(f);return}var h=a.getItemLayout(u);f?(ga(f),Tne(h,f,a,u)):f=r8(h,a,u,l),o.add(f),a.setItemGraphicEl(u,f)}).remove(function(u){var c=s.getItemGraphicEl(u);c&&o.remove(c)}).execute(),this._data=a},t.prototype.remove=function(r){var n=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&n.remove(a)})},t.type="boxplot",t}(bt),_Ue=function(){function e(){}return e}(),bUe=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="boxplotBoxPath",n}return t.prototype.getDefaultShape=function(){return new _Ue},t.prototype.buildPath=function(r,n){var i=n.points,a=0;for(r.moveTo(i[a][0],i[a][1]),a++;a<4;a++)r.lineTo(i[a][0],i[a][1]);for(r.closePath();ag){var S=[y,b];n.push(S)}}}return{boxData:r,outliers:n}}var PUe={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==on){var n="";mt(n)}var i=MUe(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function kUe(e){e.registerSeriesModel(Sne),e.registerChartView(xUe),e.registerLayout(SUe),e.registerTransform(PUe)}var LUe=["itemStyle","borderColor"],IUe=["itemStyle","borderColor0"],OUe=["itemStyle","borderColorDoji"],EUe=["itemStyle","color"],DUe=["itemStyle","color0"];function cR(e,t){return t.get(e>0?EUe:DUe)}function fR(e,t){return t.get(e===0?OUe:e>0?LUe:IUe)}var NUe={seriesType:"candlestick",plan:Zv(),performRawSeries:!0,reset:function(e,t){if(!t.isSeriesFiltered(e)){var r=e.pipelineContext.large;return!r&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=cR(s,o),l.stroke=fR(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");ie(u,l)}}}}}},jUe=["color","borderColor"],RUe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(r),this._isLargeDraw?this._renderLarge(r):this._renderNormal(r)},t.prototype.incrementalPrepareRender=function(r,n,i){this._clear(),this._updateDrawMode(r)},t.prototype.incrementalRender=function(r,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(r,n):this._incrementalRenderNormal(r,n)},t.prototype.eachRendered=function(r){Au(this._progressiveEls||this.group,r)},t.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},t.prototype._renderNormal=function(r){var n=r.getData(),i=this._data,a=this.group,o=n.getLayout("isSimpleBox"),s=r.get("clip",!0),l=r.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),n.diff(i).add(function(c){if(n.hasValue(c)){var f=n.getItemLayout(c);if(s&&n8(u,f))return;var h=NM(f,c,!0);Dt(h,{shape:{points:f.ends}},r,c),jM(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}}).update(function(c,f){var h=i.getItemGraphicEl(f);if(!n.hasValue(c)){a.remove(h);return}var d=n.getItemLayout(c);if(s&&n8(u,d)){a.remove(h);return}h?(lt(h,{shape:{points:d.ends}},r,c),ga(h)):h=NM(d),jM(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}).remove(function(c){var f=i.getItemGraphicEl(c);f&&a.remove(f)}).execute(),this._data=n},t.prototype._renderLarge=function(r){this._clear(),i8(r,this.group);var n=r.get("clip",!0)?b0(r.coordinateSystem,!1,r):null;n?this.group.setClipPath(n):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o;(o=r.next())!=null;){var s=i.getItemLayout(o),l=NM(s);jM(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){i8(n,this.group,this._progressiveEls,!0)},t.prototype.remove=function(r){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(bt),BUe=function(){function e(){}return e}(),zUe=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="normalCandlestickBox",n}return t.prototype.getDefaultShape=function(){return new BUe},t.prototype.buildPath=function(r,n){var i=n.points;this.__simpleBox?(r.moveTo(i[4][0],i[4][1]),r.lineTo(i[6][0],i[6][1])):(r.moveTo(i[0][0],i[0][1]),r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]),r.lineTo(i[3][0],i[3][1]),r.closePath(),r.moveTo(i[4][0],i[4][1]),r.lineTo(i[5][0],i[5][1]),r.moveTo(i[6][0],i[6][1]),r.lineTo(i[7][0],i[7][1]))},t}(tt);function NM(e,t,r){var n=e.ends;return new zUe({shape:{points:r?$Ue(n,e):n},z2:100})}function n8(e,t){for(var r=!0,n=0;nT?E[a]:k[a],ends:z,brushRect:U(C,A,b)})}function Z(V,Y){var K=[];return K[i]=Y,K[a]=V,isNaN(Y)||isNaN(V)?[NaN,NaN]:t.dataToPoint(K)}function j(V,Y,K){var ee=Y.slice(),le=Y.slice();ee[i]=lb(ee[i]+n/2,1,!1),le[i]=lb(le[i]-n/2,1,!0),K?V.push(ee,le):V.push(le,ee)}function U(V,Y,K){var ee=Z(V,K),le=Z(Y,K);return ee[i]-=n/2,le[i]-=n/2,{x:ee[0],y:ee[1],width:n,height:le[1]-ee[1]}}function G(V){return V[i]=lb(V[i],1),V}}function v(g,m){for(var y=Co(g.count*4),_=0,b,S=[],T=[],C,A=m.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(C=g.next())!=null;){var I=A.get(s,C),k=A.get(u,C),E=A.get(c,C),D=A.get(f,C),N=A.get(h,C);if(isNaN(I)||isNaN(D)||isNaN(N)){y[_++]=NaN,_+=3;continue}y[_++]=a8(A,C,k,E,c,P),S[i]=I,S[a]=D,b=t.dataToPoint(S,null,T),y[_++]=b?b[0]:NaN,y[_++]=b?b[1]:NaN,S[a]=N,b=t.dataToPoint(S,null,T),y[_++]=b?b[1]:NaN}m.setLayout("largePoints",y)}}};function a8(e,t,r,n,i,a){var o;return r>n?o=-1:r0?e.get(i,t-1)<=n?1:-1:1,o}function WUe(e,t){var r=e.getBaseAxis(),n,i=r.type==="category"?r.getBandWidth():(n=r.getExtent(),Math.abs(n[1]-n[0])/t.count()),a=ve(be(e.get("barMaxWidth"),i),i),o=ve(be(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?ve(s,i):Math.max(Math.min(i/2,a),o)}function HUe(e){e.registerChartView(RUe),e.registerSeriesModel(Cne),e.registerPreprocessor(VUe),e.registerVisual(NUe),e.registerLayout(GUe)}function o8(e,t){var r=t.rippleEffectColor||t.color;e.eachChild(function(n){n.attr({z:t.z,zlevel:t.zlevel,style:{stroke:t.brushType==="stroke"?r:null,fill:t.brushType==="fill"?r:null}})})}var UUe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new x0(r,n),o=new Me;return i.add(a),i.add(o),i.updateData(r,n),i}return t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(r){for(var n=r.symbolType,i=r.color,a=r.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var h=void 0;Ce(f)?h=f(i):h=f,a.__t>0&&(h=-s*a.__t),this._animateSymbol(a,s,h,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},t.prototype._animateSymbol=function(r,n,i,a,o){if(n>0){r.__t=0;var s=this,l=r.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(r)});a||l.done(function(){s.remove(r)}),l.start()}},t.prototype._getLineLength=function(r){return ms(r.__p1,r.__cp1)+ms(r.__cp1,r.__p2)},t.prototype._updateAnimationPoints=function(r,n){r.__p1=n[0],r.__p2=n[1],r.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},t.prototype.updateData=function(r,n,i){this.childAt(0).updateData(r,n,i),this._updateEffectSymbol(r,n)},t.prototype._updateSymbolPosition=function(r){var n=r.__p1,i=r.__p2,a=r.__cp1,o=r.__t<1?r.__t:2-r.__t,s=[r.x,r.y],l=s.slice(),u=tn,c=XL;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var f=r.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),h=r.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(h,f)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(r.__lastT!==void 0&&r.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-2)}var c=(n-a[l])/(a[l+1]-a[l]),f=i[l],h=i[l+1];r.x=f[0]*(1-c)+c*h[0],r.y=f[1]*(1-c)+c*h[1];var d=r.__t<1?h[0]-f[0]:f[0]-h[0],v=r.__t<1?h[1]-f[1]:f[1]-h[1];r.rotation=-Math.atan2(v,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},t}(Ane),KUe=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),JUe=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new KUe},t.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){r.moveTo(i[o++],i[o++]);for(var l=1;l0){var d=(u+f)/2-(c-h)*a,v=(c+h)/2-(f-u)*a;r.quadraticCurveTo(d,v,f,h)}else r.lineTo(f,h)}this.incremental&&(this._off=o,this.notClear=!0)},t.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var f=a[u++],h=a[u++],d=1;d0){var m=(f+v)/2-(h-g)*o,y=(h+g)/2-(v-f)*o;if(MJ(f,h,m,y,v,g,s,r,n))return l}else if(xl(f,h,v,g,s,r,n))return l;l++}return-1},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+t.__startIndex)})},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),Pne={seriesType:"lines",plan:Zv(),reset:function(e){var t=e.coordinateSystem;if(t){var r=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var u=0,c=i.start;c0&&(c||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var f=r.get("clip",!0)&&b0(r.coordinateSystem,!1,r);f?this.group.setClipPath(f):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},t.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateLineDraw(a,r);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},t.prototype.incrementalRender=function(r,n,i){this._lineDraw.incrementalUpdate(r,n.getData()),this._finished=r.end===n.getData().count()},t.prototype.eachRendered=function(r){this._lineDraw&&this._lineDraw.eachRendered(r)},t.prototype.updateTransform=function(r,n,i){var a=r.getData(),o=r.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=Pne.reset(r,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},t.prototype._updateLineDraw=function(r,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new QUe:new tR(o?a?qUe:Mne:a?Ane:eR),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},t.prototype._showEffect=function(r){return!!r.get(["effect","show"])},t.prototype._clearLayer=function(r){var n=r.getZr(),i=n.painter.getType()==="svg";!i&&this._lastZlevel!=null&&n.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(r,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},t.prototype.dispose=function(r,n){this.remove(r,n)},t.type="lines",t}(bt),t7e=typeof Uint32Array>"u"?Array:Uint32Array,r7e=typeof Float64Array>"u"?Array:Float64Array;function s8(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=se(t,function(r){var n=[r[0].coord,r[1].coord],i={coords:n};return r[0].name&&(i.fromName=r[0].name),r[1].name&&(i.toName=r[1].name),ST([i,r[0],r[1]])}))}var n7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.visualStyleAccessPath="lineStyle",r.visualDrawType="stroke",r}return t.prototype.init=function(r){r.data=r.data||[],s8(r);var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(r){if(s8(r),r.data){var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(r){var n=this._processFlatCoordsArray(r.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=qd(this._flatCoords,n.flatCoords),this._flatCoordsOffset=qd(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),r.data=new Float32Array(n.count)),this.getRawData().appendData(r.data)},t.prototype._getCoordsFromItemModel=function(r){var n=this.getData().getItemModel(r),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},t.prototype.getLineCoordsCount=function(r){return this._flatCoordsOffset?this._flatCoordsOffset[r*2+1]:this._getCoordsFromItemModel(r).length},t.prototype.getLineCoords=function(r,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[r*2],a=this._flatCoordsOffset[r*2+1],o=0;o ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?1e4:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?2e4:this.get("progressiveThreshold"))},t.prototype.getZLevelKey=function(){var r=this.getModel("effect"),n=r.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:r.get("show")&&n>0?n+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(Tt);function T_(e){return e instanceof Array||(e=[e,e]),e}var i7e={seriesType:"lines",reset:function(e){var t=T_(e.get("symbol")),r=T_(e.get("symbolSize")),n=e.getData();n.setVisual("fromSymbol",t&&t[0]),n.setVisual("toSymbol",t&&t[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,o){var s=a.getItemModel(o),l=T_(s.getShallow("symbol",!0)),u=T_(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function a7e(e){e.registerChartView(e7e),e.registerSeriesModel(n7e),e.registerLayout(Pne),e.registerVisual(i7e)}var o7e=256,s7e=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=ui.createCanvas();this.canvas=t}return e.prototype.update=function(t,r,n,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,f=this.canvas,h=f.getContext("2d"),d=t.length;f.width=r,f.height=n;for(var v=0;v0){var D=o(b)?l:u;b>0&&(b=b*k+P),T[C++]=D[E],T[C++]=D[E+1],T[C++]=D[E+2],T[C++]=D[E+3]*b*256}else C+=4}return h.putImageData(S,0,0),f},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=ui.createCanvas()),r=this.pointSize+this.blurSize,n=r*2;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor=J.color.neutral99,i.beginPath(),i.arc(-r,r,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),t},e.prototype._getGradient=function(t,r){for(var n=this._gradientPixels,i=n[r]||(n[r]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)t[r](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},e}();function l7e(e,t,r){var n=e[1]-e[0];t=se(t,function(o){return{interval:[(o.interval[0]-e[0])/n,(o.interval[1]-e[0])/n]}});var i=t.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=t[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=t[0]&&n<=t[1]}}function l8(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var c7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a;n.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===r&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=r.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"||o.type==="matrix"?this._renderOnGridLike(r,i,0,r.getData().count()):l8(o)&&this._renderOnGeo(o,r,a,i)},t.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},t.prototype.incrementalRender=function(r,n,i,a){var o=n.coordinateSystem;o&&(l8(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){Au(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=fu(s,"cartesian2d"),u=fu(s,"matrix"),c,f,h,d;if(l){var v=s.getAxis("x"),g=s.getAxis("y");c=v.getBandWidth()+.5,f=g.getBandWidth()+.5,h=v.scale.getExtent(),d=g.scale.getExtent()}for(var m=this.group,y=r.getData(),_=r.getModel(["emphasis","itemStyle"]).getItemStyle(),b=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),C=Nr(r),A=r.getModel("emphasis"),P=A.get("focus"),I=A.get("blurScope"),k=A.get("disabled"),E=l||u?[y.mapDimension("x"),y.mapDimension("y"),y.mapDimension("value")]:[y.mapDimension("time"),y.mapDimension("value")],D=i;Dh[1]||$d[1])continue;var Z=s.dataToPoint([F,$]);N=new Xe({shape:{x:Z[0]-c/2,y:Z[1]-f/2,width:c,height:f},style:z})}else if(u){var j=s.dataToLayout([y.get(E[0],D),y.get(E[1],D)]).rect;if(gn(j.x))continue;N=new Xe({z2:1,shape:j,style:z})}else{if(isNaN(y.get(E[1],D)))continue;var U=s.dataToLayout([y.get(E[0],D)]),j=U.contentRect||U.rect;if(gn(j.x)||gn(j.y))continue;N=new Xe({z2:1,shape:j,style:z})}if(y.hasItemOption){var G=y.getItemModel(D),V=G.getModel("emphasis");_=V.getModel("itemStyle").getItemStyle(),b=G.getModel(["blur","itemStyle"]).getItemStyle(),S=G.getModel(["select","itemStyle"]).getItemStyle(),T=G.get(["itemStyle","borderRadius"]),P=V.get("focus"),I=V.get("blurScope"),k=V.get("disabled"),C=Nr(G)}N.shape.r=T;var Y=r.getRawValue(D),K="-";Y&&Y[2]!=null&&(K=Y[2]+""),Ur(N,C,{labelFetcher:r,labelDataIndex:D,defaultOpacity:z.opacity,defaultText:K}),N.ensureState("emphasis").style=_,N.ensureState("blur").style=b,N.ensureState("select").style=S,Gt(N,P,I,k),N.incremental=o,o&&(N.states.emphasis.hoverLayer=!0),m.add(N),y.setItemGraphicEl(D,N),this._progressiveEls&&this._progressiveEls.push(N)}},t.prototype._renderOnGeo=function(r,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new s7e;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var c=r.getViewRect().clone(),f=r.getRoamTransform();c.applyTransform(f);var h=Math.max(c.x,0),d=Math.max(c.y,0),v=Math.min(c.width+c.x,a.getWidth()),g=Math.min(c.height+c.y,a.getHeight()),m=v-h,y=g-d,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],b=l.mapArray(_,function(A,P,I){var k=r.dataToPoint([A,P]);return k[0]-=h,k[1]-=d,k.push(I),k}),S=i.getExtent(),T=i.type==="visualMap.continuous"?u7e(S,i.option.range):l7e(S,i.getPieceList(),i.option.selected);u.update(b,m,y,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var C=new Yr({style:{width:m,height:y,x:h,y:d,image:u.canvas},silent:!0});this.group.add(C)},t.type="heatmap",t}(bt),f7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return Xo(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=Uv.get(this.get("coordinateSystem"));if(r&&r.dimensions)return r.dimensions[0]==="lng"&&r.dimensions[1]==="lat"},t.type="series.heatmap",t.dependencies=["grid","geo","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:J.color.primary}}},t}(Tt);function h7e(e){e.registerChartView(c7e),e.registerSeriesModel(f7e)}var d7e=["itemStyle","borderWidth"],u8=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],zM=new Yo,v7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group,o=r.getData(),s=this._data,l=r.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),f=l.master.getRect(),h={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:c,valueDim:u8[+c],categoryDim:u8[1-+c]};o.diff(s).add(function(v){if(o.hasValue(v)){var g=f8(o,v),m=c8(o,v,g,h),y=h8(o,h,m);o.setItemGraphicEl(v,y),a.add(y),v8(y,h,m)}}).update(function(v,g){var m=s.getItemGraphicEl(g);if(!o.hasValue(v)){a.remove(m);return}var y=f8(o,v),_=c8(o,v,y,h),b=Dne(o,_);m&&b!==m.__pictorialShapeStr&&(a.remove(m),o.setItemGraphicEl(v,null),m=null),m?b7e(m,h,_):m=h8(o,h,_,!0),o.setItemGraphicEl(v,m),m.__pictorialSymbolMeta=_,a.add(m),v8(m,h,_)}).remove(function(v){var g=s.getItemGraphicEl(v);g&&d8(s,v,g.__pictorialSymbolMeta.animationModel,g)}).execute();var d=r.get("clip",!0)?b0(r.coordinateSystem,!1,r):null;return d?a.setClipPath(d):a.removeClipPath(),this._data=o,this.group},t.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(o){d8(a,De(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(bt);function c8(e,t,r,n){var i=e.getItemLayout(t),a=r.get("symbolRepeat"),o=r.get("symbolClip"),s=r.get("symbolPosition")||"start",l=r.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=r.get("symbolPatternSize")||2,f=r.isAnimationEnabled(),h={dataIndex:t,layout:i,itemModel:r,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:r.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:f?r:null,hoverScale:f&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};p7e(r,a,i,n,h),g7e(e,t,i,a,o,h.boundingLength,h.pxSign,c,n,h),m7e(r,h.symbolScale,u,n,h);var d=h.symbolSize,v=Df(r.get("symbolOffset"),d);return y7e(r,d,i,a,o,v,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,n,h),h}function p7e(e,t,r,n,i){var a=n.valueDim,o=e.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(r[a.wh]<=0),c;if(ae(o)){var f=[$M(s,o[0])-l,$M(s,o[1])-l];f[1]=0?1:-1:c>0?1:-1}function $M(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function g7e(e,t,r,n,i,a,o,s,l,u){var c=l.valueDim,f=l.categoryDim,h=Math.abs(r[f.wh]),d=e.getItemVisual(t,"symbolSize"),v;ae(d)?v=d.slice():d==null?v=["100%","100%"]:v=[d,d],v[f.index]=ve(v[f.index],h),v[c.index]=ve(v[c.index],n?h:Math.abs(a)),u.symbolSize=v;var g=u.symbolScale=[v[0]/s,v[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*o}function m7e(e,t,r,n,i){var a=e.get(d7e)||0;a&&(zM.attr({scaleX:t[0],scaleY:t[1],rotation:r}),zM.updateTransform(),a/=zM.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function y7e(e,t,r,n,i,a,o,s,l,u,c,f){var h=c.categoryDim,d=c.valueDim,v=f.pxSign,g=Math.max(t[d.index]+s,0),m=g;if(n){var y=Math.abs(l),_=rn(e.get("symbolMargin"),"15%")+"",b=!1;_.lastIndexOf("!")===_.length-1&&(b=!0,_=_.slice(0,_.length-1));var S=ve(_,t[d.index]),T=Math.max(g+S*2,0),C=b?0:S*2,A=bN(n),P=A?n:p8((y+C)/T),I=y-P*g;S=I/2/(b?P:Math.max(P-1,1)),T=g+S*2,C=b?0:S*2,!A&&n!=="fixed"&&(P=u?p8((Math.abs(u)+C)/T):0),m=P*T-C,f.repeatTimes=P,f.symbolMargin=S}var k=v*(m/2),E=f.pathPosition=[];E[h.index]=r[h.wh]/2,E[d.index]=o==="start"?k:o==="end"?l-k:l/2,a&&(E[0]+=a[0],E[1]+=a[1]);var D=f.bundlePosition=[];D[h.index]=r[h.xy],D[d.index]=r[d.xy];var N=f.barRectShape=ie({},r);N[d.wh]=v*Math.max(Math.abs(r[d.wh]),Math.abs(E[d.index]+k)),N[h.wh]=r[h.wh];var z=f.clipShape={};z[h.xy]=-r[h.xy],z[h.wh]=c.ecSize[h.wh],z[d.xy]=0,z[d.wh]=r[d.wh]}function kne(e){var t=e.symbolPatternSize,r=xr(e.symbolType,-t/2,-t/2,t,t);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function Lne(e,t,r,n){var i=e.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=t.valueDim,u=r.repeatTimes||0,c=0,f=a[t.valueDim.index]+o+r.symbolMargin*2;for(hR(e,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c0:y<0)&&(_=u-1-g),m[l.index]=f*(_-u/2+.5)+s[l.index],{x:m[0],y:m[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function Ine(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?gd(a,null,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation},r,n):(a=e.__pictorialMainPath=kne(r),i.add(a),gd(a,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:0,scaleY:0,rotation:r.rotation},{scaleX:r.symbolScale[0],scaleY:r.symbolScale[1]},r,n))}function One(e,t,r){var n=ie({},t.barRectShape),i=e.__pictorialBarRect;i?gd(i,null,{shape:n},t,r):(i=e.__pictorialBarRect=new Xe({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function Ene(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=ie({},r.clipShape),o=t.valueDim,s=r.animationModel,l=r.dataIndex;if(i)lt(i,{shape:a},s,l);else{a[o.wh]=0,i=new Xe({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],If[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function f8(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=x7e,r.isAnimationEnabled=_7e,r}function x7e(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function _7e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function h8(e,t,r,n){var i=new Me,a=new Me;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?Lne(i,t,r):Ine(i,t,r),One(i,r,n),Ene(i,t,r,n),i.__pictorialShapeStr=Dne(e,r),i.__pictorialSymbolMeta=r,i}function b7e(e,t,r){var n=r.animationModel,i=r.dataIndex,a=e.__pictorialBundle;lt(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?Lne(e,t,r,!0):Ine(e,t,r,!0),One(e,r,!0),Ene(e,t,r,!0)}function d8(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];hR(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),B(a,function(o){cu(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function Dne(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function hR(e,t,r){B(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function gd(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&If[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function v8(e,t,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=a.get("focus"),f=a.get("blurScope"),h=a.get("scale");hR(e,function(g){if(g instanceof Yr){var m=g.style;g.useStyle(ie({image:m.image,x:m.x,y:m.y,width:m.width,height:m.height},r.style))}else g.useStyle(r.style);var y=g.ensureState("emphasis");y.style=o,h&&(y.scaleX=g.scaleX*1.1,y.scaleY=g.scaleY*1.1),g.ensureState("blur").style=s,g.ensureState("select").style=l,u&&(g.cursor=u),g.z2=r.z2});var d=t.valueDim.posDesc[+(r.boundingLength>0)],v=e.__pictorialBarRect;v.ignoreClip=!0,Ur(v,Nr(i),{labelFetcher:t.seriesModel,labelDataIndex:n,defaultText:sv(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Gt(e,c,f,a.get("disabled"))}function p8(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var w7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r.defaultSymbol="roundRect",r}return t.prototype.getInitialData=function(r){return r.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=Mu(Ey.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:J.color.primary}}}),t}(Ey);function S7e(e){e.registerChartView(v7e),e.registerSeriesModel(w7e),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(ete,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,tte("pictorialBar"))}var T7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._layers=[],r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this,s=this.group,l=r.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,f=u.boundaryGap;s.x=0,s.y=c.y+f[0];function h(m){return m.name}var d=new Gs(this._layersSeries||[],l,h,h),v=[];d.add(me(g,this,"add")).update(me(g,this,"update")).remove(me(g,this,"remove")).execute();function g(m,y,_){var b=o._layers;if(m==="remove"){s.remove(b[y]);return}for(var S=[],T=[],C,A=l[y].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=f)}return{y0:i,max:a}}function k7e(e){e.registerChartView(T7e),e.registerSeriesModel(A7e),e.registerLayout(M7e),e.registerProcessor(Qv("themeRiver"))}var L7e=2,I7e=4,m8=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=L7e,o.textConfig={inside:!0},De(o).seriesIndex=n.seriesIndex;var s=new at({z2:I7e,silent:r.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,r,n,i,a),o}return t.prototype.updateData=function(r,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;De(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),c=n.getLayout(),f=ie({},c);f.label=null;var h=n.getVisual("style");h.lineJoin="bevel";var d=n.getVisual("decal");d&&(h.decal=iv(d,o));var v=Mo(l.getModel("itemStyle"),f,!0);ie(f,v),B(Zn,function(_){var b=s.ensureState(_),S=l.getModel([_,"itemStyle"]);b.style=S.getItemStyle();var T=Mo(S,f);T&&(b.shape=T)}),r?(s.setShape(f),s.shape.r=c.r0,Dt(s,{shape:{r:c.r}},i,n.dataIndex)):(lt(s,{shape:f},i),ga(s)),s.useStyle(h),this._updateLabel(i);var g=l.getShallow("cursor");g&&s.attr("cursor",g),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var m=u.get("focus"),y=m==="relative"?qd(n.getAncestorsIndices(),n.getDescendantIndices()):m==="ancestor"?n.getAncestorsIndices():m==="descendant"?n.getDescendantIndices():m;Gt(this,y,u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),f=this,h=f.getTextContent(),d=this.node.dataIndex,v=a.get("minAngle")/180*Math.PI,g=a.get("show")&&!(v!=null&&Math.abs(s)z&&!Qd($-z)&&$0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,r,n,i):(o.virtualPiece=new m8(_,r,n,i),c.add(o.virtualPiece)),b.piece.off("click"),o.virtualPiece.on("click",function(S){o._rootToNode(b.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},t.prototype._initEvents=function(){var r=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=r.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")r._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";xw(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:MO,from:this.uid,seriesId:this.seriesModel.id,targetNode:r})},t.prototype.containPoint=function(r,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=r[0]-a.cx,s=r[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},t.type="sunburst",t}(bt),N7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.ignoreStyleOnData=!0,r}return t.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};Nne(i);var a=this._levelModels=se(r.levels||[],function(l){return new et(l,this,n)},this),o=Yj.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var f=o.getNodeByDataIndex(c),h=a[f.depth];return h&&(u.parentModel=h),u})}return o.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treePathInfo=tC(i,this),n},t.prototype.getLevelModel=function(r){return this._levelModels&&this._levelModels[r.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},t.prototype.enableAriaDecal=function(){zre(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t}(Tt);function Nne(e){var t=0;B(e.children,function(n){Nne(n);var i=n.value;ae(i)&&(i=i[0]),t+=i});var r=e.value;ae(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ae(e.value)?e.value[0]=r:e.value=r}var x8=Math.PI/180;function j7e(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");ae(a)||(a=[0,a]),ae(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=ve(i[0],o),c=ve(i[1],s),f=ve(a[0],l/2),h=ve(a[1],l/2),d=-n.get("startAngle")*x8,v=n.get("minAngle")*x8,g=n.getData().tree.root,m=n.getViewRoot(),y=m.depth,_=n.get("sort");_!=null&&jne(m,_);var b=0;B(m.children,function($){!isNaN($.getValue())&&b++});var S=m.getValue(),T=Math.PI/(S||b)*2,C=m.depth>0,A=m.height-(C?-1:1),P=(h-f)/(A||1),I=n.get("clockwise"),k=n.get("stillShowZeroSum"),E=I?1:-1,D=function($,Z){if($){var j=Z;if($!==g){var U=$.getValue(),G=S===0&&k?T:U*T;G1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&pe(s)&&(s=aw(s,(n.depth-1)/(a-1)*.5)),s}e.eachSeriesByType("sunburst",function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");ie(u,l)})})}function z7e(e){e.registerChartView(D7e),e.registerSeriesModel(N7e),e.registerLayout(Fe(j7e,"sunburst")),e.registerProcessor(Fe(Qv,"sunburst")),e.registerVisual(B7e),E7e(e)}var _8={color:"fill",borderColor:"stroke"},$7e={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},ks=Je(),F7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(r,n){return Xo(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=ks(i).info),a},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(Tt);function V7e(e,t){return t=t||[0,0],se(["x","y"],function(r,n){var i=this.getAxis(r),a=t[n],o=e[n]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function G7e(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r){return e.dataToPoint(r)},size:me(V7e,e)}}}function W7e(e,t){return t=t||[0,0],se([0,1],function(r){var n=t[r],i=e[r]/2,a=[],o=[];return a[r]=n-i,o[r]=n+i,a[1-r]=o[1-r]=t[1-r],Math.abs(this.dataToPoint(a)[r]-this.dataToPoint(o)[r])},this)}function H7e(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(r){return e.dataToPoint(r)},size:me(W7e,e)}}}function U7e(e,t){var r=this.getAxis(),n=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return r.type==="category"?r.getBandWidth():Math.abs(r.dataToCoord(n-i)-r.dataToCoord(n+i))}function Z7e(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r){return e.dataToPoint(r)},size:me(U7e,e)}}}function Y7e(e,t){return t=t||[0,0],se(["Radius","Angle"],function(r,n){var i="get"+r+"Axis",a=this[i](),o=t[n],s=e[n]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return r==="Angle"&&(l=l*Math.PI/180),l},this)}function X7e(e){var t=e.getRadiusAxis(),r=e.getAngleAxis(),n=t.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=t.dataToRadius(i[0]),o=r.dataToAngle(i[1]),s=e.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:me(Y7e,e)}}}function q7e(e){var t=e.getRect(),r=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:r.start,end:r.end,weeks:r.weeks,dayCount:r.allDay}},api:{coord:function(n,i){return e.dataToPoint(n,i)},layout:function(n,i){return e.dataToLayout(n,i)}}}}function K7e(e){var t=e.getRect();return{coordSys:{type:"matrix",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r,n){return e.dataToPoint(r,n)},layout:function(r,n){return e.dataToLayout(r,n)}}}}function Rne(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||xe(e,"text")))}function Bne(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},xe(n,"text")&&(o.text=n.text),xe(n,"rich")&&(o.rich=n.rich),xe(n,"textFill")&&(o.fill=n.textFill),xe(n,"textStroke")&&(o.stroke=n.textStroke),xe(n,"fontFamily")&&(o.fontFamily=n.fontFamily),xe(n,"fontSize")&&(o.fontSize=n.fontSize),xe(n,"fontStyle")&&(o.fontStyle=n.fontStyle),xe(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=xe(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),xe(n,"textPosition")&&(i.position=n.textPosition),xe(n,"textOffset")&&(i.offset=n.textOffset),xe(n,"textRotation")&&(i.rotation=n.textRotation),xe(n,"textDistance")&&(i.distance=n.textDistance)}return b8(o,e),B(o.rich,function(l){b8(l,l)}),{textConfig:i,textContent:a}}function b8(e,t){t&&(t.font=t.textFont||t.font,xe(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),xe(t,"textAlign")&&(e.align=t.textAlign),xe(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),xe(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),xe(t,"textWidth")&&(e.width=t.textWidth),xe(t,"textHeight")&&(e.height=t.textHeight),xe(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),xe(t,"textPadding")&&(e.padding=t.textPadding),xe(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),xe(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),xe(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),xe(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),xe(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),xe(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),xe(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function w8(e,t,r){var n=e;n.textPosition=n.textPosition||r.position||"inside",r.offset!=null&&(n.textOffset=r.offset),r.rotation!=null&&(n.textRotation=r.rotation),r.distance!=null&&(n.textDistance=r.distance);var i=n.textPosition.indexOf("inside")>=0,a=e.fill||J.color.neutral99;S8(n,t);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||J.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=e.fill||r.outsideFill||J.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,B(t.rich,function(s){S8(s,s)}),n}function S8(e,t){t&&(xe(t,"fill")&&(e.textFill=t.fill),xe(t,"stroke")&&(e.textStroke=t.fill),xe(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),xe(t,"font")&&(e.font=t.font),xe(t,"fontStyle")&&(e.fontStyle=t.fontStyle),xe(t,"fontWeight")&&(e.fontWeight=t.fontWeight),xe(t,"fontSize")&&(e.fontSize=t.fontSize),xe(t,"fontFamily")&&(e.fontFamily=t.fontFamily),xe(t,"align")&&(e.textAlign=t.align),xe(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),xe(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),xe(t,"width")&&(e.textWidth=t.width),xe(t,"height")&&(e.textHeight=t.height),xe(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),xe(t,"padding")&&(e.textPadding=t.padding),xe(t,"borderColor")&&(e.textBorderColor=t.borderColor),xe(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),xe(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),xe(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),xe(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),xe(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),xe(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),xe(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),xe(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),xe(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),xe(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var zne={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},T8=it(zne);da(zo,function(e,t){return e[t]=1,e},{});zo.join(", ");var Zw=["","style","shape","extra"],fv=Je();function dR(e,t,r,n,i){var a=e+"Animation",o=Fv(e,n,i)||{},s=fv(t).userDuring;return o.duration>0&&(o.during=s?me(r9e,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),ie(o,r[a]),o}function gb(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=fv(e),u=t.style;l.userDuring=t.during;var c={},f={};if(i9e(e,t,f),e.type==="compound")for(var h=e.shape.paths,d=t.shape.paths,v=0;v0&&e.animateFrom(m,y)}else Q7e(e,t,i||0,r,c);$ne(e,t),u?e.dirty():e.markRedraw()}function $ne(e,t){for(var r=fv(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function e9e(e,t){xe(t,"silent")&&(e.silent=t.silent),xe(t,"ignore")&&(e.ignore=t.ignore),e instanceof pa&&xe(t,"invisible")&&(e.invisible=t.invisible),e instanceof tt&&xe(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var ho={},t9e={setTransform:function(e,t){return ho.el[e]=t,this},getTransform:function(e){return ho.el[e]},setShape:function(e,t){var r=ho.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=ho.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=ho.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=ho.el.style;if(t)return t[e]},setExtra:function(e,t){var r=ho.el.extra||(ho.el.extra={});return r[e]=t,this},getExtra:function(e){var t=ho.el.extra;if(t)return t[e]}};function r9e(){var e=this,t=e.el;if(t){var r=fv(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}ho.el=t,n(t9e)}}function C8(e,t,r,n){var i=r[e];if(i){var a=t[e],o;if(a){var s=r.transition,l=i.transition;if(l)if(!o&&(o=n[e]={}),qc(l))ie(o,a);else for(var u=Pt(l),c=0;c=0){!o&&(o=n[e]={});for(var d=it(a),c=0;c=0)){var h=e.getAnimationStyleProps(),d=h?h.style:null;if(d){!a&&(a=n.style={});for(var v=it(r),u=0;u=0?t.getStore().get(j,$):void 0}var U=t.get(Z.name,$),G=Z&&Z.ordinalMeta;return G?G.categories[U]:U}function A(F,$){$==null&&($=c);var Z=t.getItemVisual($,"style"),j=Z&&Z.fill,U=Z&&Z.opacity,G=b($,Dl).getItemStyle();j!=null&&(G.fill=j),U!=null&&(G.opacity=U);var V={inheritColor:pe(j)?j:J.color.neutral99},Y=S($,Dl),K=Mt(Y,null,V,!1,!0);K.text=Y.getShallow("show")?be(e.getFormattedLabel($,Dl),sv(t,$)):null;var ee=gw(Y,V,!1);return k(F,G),G=w8(G,K,ee),F&&I(G,F),G.legacy=!0,G}function P(F,$){$==null&&($=c);var Z=b($,Ls).getItemStyle(),j=S($,Ls),U=Mt(j,null,null,!0,!0);U.text=j.getShallow("show")?li(e.getFormattedLabel($,Ls),e.getFormattedLabel($,Dl),sv(t,$)):null;var G=gw(j,null,!0);return k(F,Z),Z=w8(Z,U,G),F&&I(Z,F),Z.legacy=!0,Z}function I(F,$){for(var Z in $)xe($,Z)&&(F[Z]=$[Z])}function k(F,$){F&&(F.textFill&&($.textFill=F.textFill),F.textPosition&&($.textPosition=F.textPosition))}function E(F,$){if($==null&&($=c),xe(_8,F)){var Z=t.getItemVisual($,"style");return Z?Z[_8[F]]:null}if(xe($7e,F))return t.getItemVisual($,F)}function D(F){if(o.type==="cartesian2d"){var $=o.getBaseAxis();return c$e(Pe({axis:$},F))}}function N(){return r.getCurrentSeriesIndices()}function z(F){return FN(F,r)}}function p9e(e){var t={};return B(e.dimensions,function(r){var n=e.getDimensionInfo(r);if(!n.isExtraCoord){var i=n.coordDim,a=t[i]=t[i]||[];a[n.coordDimIndex]=e.getDimensionIndex(r)}}),t}function HM(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=yR(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Gt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function yR(e,t,r,n,i,a){var o=-1,s=t;t&&Wne(t,n,i)&&(o=We(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=gR(n),s&&f9e(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),Hi.normal.cfg=Hi.normal.conOpt=Hi.emphasis.cfg=Hi.emphasis.conOpt=Hi.blur.cfg=Hi.blur.conOpt=Hi.select.cfg=Hi.select.conOpt=null,Hi.isLegacy=!1,m9e(u,r,n,i,l,Hi),g9e(u,r,n,i,l),mR(e,u,r,n,Hi,i,l),xe(n,"info")&&(ks(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function Wne(e,t,r){var n=ks(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&w9e(a)&&Hne(a)!==n.customPathData||i==="image"&&xe(o,"image")&&o.image!==n.customImagePath}function g9e(e,t,r,n,i){var a=r.clipPath;if(a===!1)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&Wne(o,a,n)&&(o=null),o||(o=gR(a),e.setClipPath(o)),mR(null,o,t,a,null,n,i)}}function m9e(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){M8(r,null,a),M8(r,Ls,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=e.getTextContent();if(o===!1)c&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=gR(o),e.setTextContent(c)),mR(null,c,t,o,null,n,i);for(var f=o&&o.style,h=0;h=c;d--){var v=t.childAt(d);x9e(t,v,i)}}}function x9e(e,t,r){t&&iC(t,ks(e).option,r)}function _9e(e){new Gs(e.oldChildren,e.newChildren,P8,P8,e).add(k8).update(k8).remove(b9e).execute()}function P8(e,t){var r=e&&e.name;return r??u9e+t}function k8(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;yR(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function b9e(e){var t=this.context,r=t.oldChildren[e];r&&iC(r,ks(r).option,t.seriesModel)}function Hne(e){return e&&(e.pathData||e.d)}function w9e(e){return e&&(xe(e,"pathData")||xe(e,"d"))}function S9e(e){e.registerChartView(h9e),e.registerSeriesModel(F7e)}var bc=Je(),L8=Ae,UM=me,_R=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(t,r,n,i){var a=r.get("value"),o=r.get("status");if(this._axisModel=t,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,t,r,n);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=c;var f=this._moveAnimation=this.determineAnimation(t,r);if(!s)s=this._group=new Me,this.createPointerEl(s,u,t,r),this.createLabelEl(s,u,t,r),n.getZr().add(s);else{var h=Fe(I8,r,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,r)}E8(s,r,!0),this._renderHandle(a)}},e.prototype.remove=function(t){this.clear(t)},e.prototype.dispose=function(t){this.clear(t)},e.prototype.determineAnimation=function(t,r){var n=r.get("animation"),i=t.axis,a=i.type==="category",o=r.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=Fj(t).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},e.prototype.makeElOption=function(t,r,n,i,a){},e.prototype.createPointerEl=function(t,r,n,i){var a=r.pointer;if(a){var o=bc(t).pointerEl=new If[a.type](L8(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=bc(t).labelEl=new at(L8(r.label));t.add(a),O8(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=bc(t).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},e.prototype.updateLabelEl=function(t,r,n,i){var a=bc(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),O8(a,i))},e.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=Vv(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){$s(u.event)},onmousedown:UM(this._onHandleDragMove,this,0,0),drift:UM(this._onHandleDragMove,this),ondragend:UM(this._onHandleDragEnd,this)}),n.add(i)),E8(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");ae(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,Yv(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){I8(this._axisPointerModel,!r&&this._moveAnimation,this._handle,ZM(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(t,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(ZM(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(ZM(i)),bc(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var r=t.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),Cy(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(t,r,n){return n=n||0,{x:t[n],y:t[1-n],width:r[n],height:r[1-n]}},e}();function I8(e,t,r,n){Une(bc(r).lastProp,n)||(bc(r).lastProp=n,t?lt(r,n,e):(r.stopAnimation(),r.attr(n)))}function Une(e,t){if(ke(e)&&ke(t)){var r=!0;return B(t,function(n,i){r=r&&Une(e[i],n)}),!!r}else return e===t}function O8(e,t){e[t.get(["label","show"])?"show":"hide"]()}function ZM(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function E8(e,t,r){var n=t.get("z"),i=t.get("zlevel");e&&e.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function bR(e){var t=e.get("type"),r=e.getModel(t+"Style"),n;return t==="line"?(n=r.getLineStyle(),n.fill=null):t==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function Zne(e,t,r,n,i){var a=r.get("value"),o=Yne(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=Hv(s.get("padding")||0),u=s.getFont(),c=PT(o,u),f=i.position,h=c.width+l[1]+l[3],d=c.height+l[0]+l[2],v=i.align;v==="right"&&(f[0]-=h),v==="center"&&(f[0]-=h/2);var g=i.verticalAlign;g==="bottom"&&(f[1]-=d),g==="middle"&&(f[1]-=d/2),T9e(f,h,d,n);var m=s.get("backgroundColor");(!m||m==="auto")&&(m=t.get(["axisLine","lineStyle","color"])),e.label={x:f[0],y:f[1],style:Mt(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:m}),z2:10}}function T9e(e,t,r,n){var i=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+r,a)-r,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function Yne(e,t,r,n,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:Lw(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};B(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),pe(o)?a=o.replace("{value}",a):Ce(o)&&(a=o(s))}return a}function wR(e,t,r){var n=Wr();return Ks(n,n,r.rotation),Ya(n,n,r.position),Wa([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function Xne(e,t,r,n,i,a){var o=Wn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Zne(t,n,i,a,{position:wR(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function SR(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function qne(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function D8(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var C9e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),c=N8(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var h=bR(a),d=A9e[u](s,f,c);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=$w(l.getRect(),i);Xne(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=$w(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=wR(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=N8(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,f=[r.x,r.y];f[c]+=n[c],f[c]=Math.min(l[1],f[c]),f[c]=Math.max(l[0],f[c]);var h=(u[1]+u[0])/2,d=[h,h];d[c]=f[c];var v=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:d,tooltipOption:v[c]}},t}(_R);function N8(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var A9e={line:function(e,t,r){var n=SR([t,r[0]],[t,r[1]],j8(e));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(e,t,r){var n=Math.max(1,e.getBandWidth()),i=r[1]-r[0];return{type:"Rect",shape:qne([t-n/2,r[0]],[n,i],j8(e))}}};function j8(e){return e.dim==="x"?0:1}var M9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:J.color.border,width:1,type:"dashed"},shadowStyle:{color:J.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:J.color.neutral00,padding:[5,7,5,7],backgroundColor:J.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:J.color.accent40,throttle:40}},t}(Ke),bs=Je(),P9e=B;function Kne(e,t,r){if(!nt.node){var n=t.getZr();bs(n).records||(bs(n).records={}),k9e(n,t);var i=bs(n).records[e]||(bs(n).records[e]={});i.handler=r}}function k9e(e,t){if(bs(e).initialized)return;bs(e).initialized=!0,r("click",Fe(R8,"click")),r("mousemove",Fe(R8,"mousemove")),r("globalout",I9e);function r(n,i){e.on(n,function(a){var o=O9e(t);P9e(bs(e).records,function(s){s&&i(s,a,o.dispatchAction)}),L9e(o.pendings,t)})}}function L9e(e,t){var r=e.showTip.length,n=e.hideTip.length,i;r?i=e.showTip[r-1]:n&&(i=e.hideTip[n-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function I9e(e,t,r){e.handler("leave",null,r)}function R8(e,t,r,n){t.handler(e,r,n)}function O9e(e){var t={showTip:[],hideTip:[]},r=function(n){var i=t[n.type];i?i.push(n):(n.dispatchAction=r,e.dispatchAction(n))};return{dispatchAction:r,pendings:t}}function LO(e,t){if(!nt.node){var r=t.getZr(),n=(bs(r).records||{})[e];n&&(bs(r).records[e]=null)}}var E9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";Kne("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(r,n){LO("axisPointer",n)},t.prototype.dispose=function(r,n){LO("axisPointer",n)},t.type="axisPointer",t}(kt);function Jne(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=ff(a,e);if(o==null||o<0||ae(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),f=c.dim,h=u.dim,d=f==="x"||f==="radius"?1:0,v=a.mapDimension(h),g=[];g[d]=a.get(v,o),g[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(g)||[]}else r=l.dataToPoint(a.getValues(se(l.dimensions,function(y){return a.mapDimension(y)}),o))||[];else if(s){var m=s.getBoundingRect().clone();m.applyTransform(s.transform),r=[m.x+m.width/2,m.y+m.height/2]}return{point:r,el:s}}var B8=Je();function D9e(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||me(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){mb(i)&&(i=Jne({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=mb(i),u=a.axesInfo,c=s.axesInfo,f=n==="leave"||mb(i),h={},d={},v={list:[],map:{}},g={showPointer:Fe(j9e,d),showTooltip:Fe(R9e,v)};B(s.coordSysMap,function(y,_){var b=l||y.containPoint(i);B(s.coordSysAxesInfo[_],function(S,T){var C=S.axis,A=F9e(u,S);if(!f&&b&&(!u||A)){var P=A&&A.value;P==null&&!l&&(P=C.pointToData(i)),P!=null&&z8(S,P,g,!1,h)}})});var m={};return B(c,function(y,_){var b=y.linkGroup;b&&!d[_]&&B(b.axesInfo,function(S,T){var C=d[T];if(S!==y&&C){var A=C.value;b.mapper&&(A=y.axis.scale.parse(b.mapper(A,$8(S),$8(y)))),m[y.key]=A}})}),B(m,function(y,_){z8(c[_],y,g,!0,h)}),B9e(d,c,h),z9e(v,i,e,o),$9e(c,o,r),h}}function z8(e,t,r,n,i){var a=e.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!e.involveSeries){r.showPointer(e,t);return}var o=N9e(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&ie(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function N9e(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return B(t.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,e,r);h=d.dataIndices,f=d.nestestValue}else{if(h=l.indicesOfNearest(n,c[0],e,r.type==="category"?.5:null),!h.length)return;f=l.getData().get(c[0],h[0])}if(!(f==null||!isFinite(f))){var v=e-f,g=Math.abs(v);g<=o&&((g=0&&s<0)&&(o=g,s=v,i=f,a.length=0),B(h,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:i}}function j9e(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function R9e(e,t,r,n){var i=r.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!i.length)){var l=t.coordSys.model,u=Dy(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function B9e(e,t,r){var n=r.axesInfo=[];B(t,function(i,a){var o=i.axisPointerModel.option,s=e[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function z9e(e,t,r,n){if(mb(t)||!e.list.length){n({type:"hideTip"});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function $9e(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=B8(n)[i]||{},o=B8(n)[i]={};B(e,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&B(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];B(a,function(u,c){!o[c]&&l.push(u)}),B(o,function(u,c){!a[c]&&s.push(u)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function F9e(e,t){for(var r=0;r<(e||[]).length;r++){var n=e[r];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}function $8(e){var t=e.axis.model,r={},n=r.axisDim=e.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=t.componentIndex,r.axisName=r[n+"AxisName"]=t.name,r.axisId=r[n+"AxisId"]=t.id,r}function mb(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function T0(e){Nf.registerAxisPointerClass("CartesianAxisPointer",C9e),e.registerComponentModel(M9e),e.registerComponentView(E9e),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!ae(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=V6e(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},D9e)}function V9e(e){Ze(wre),Ze(T0)}var G9e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),c=u.getExtent(),f=s.dataToCoord(n),h=a.get("type");if(h&&h!=="none"){var d=bR(a),v=H9e[h](s,l,f,c);v.style=d,r.graphicKey=v.type,r.pointer=v}var g=a.get(["label","margin"]),m=W9e(n,i,a,l,g);Zne(r,i,a,o,m)},t}(_R);function W9e(e,t,r,n,i){var a=t.axis,o=a.dataToCoord(e),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,c,f;if(a.dim==="radius"){var h=Wr();Ks(h,h,s),Ya(h,h,[n.cx,n.cy]),u=Wa([o,-i],h);var d=t.getModel("axisLabel").get("rotate")||0,v=Wn.innerTextLayout(s,d*Math.PI/180,-1);c=v.textAlign,f=v.textVerticalAlign}else{var g=l[1];u=n.coordToPoint([g+i,o]);var m=n.cx,y=n.cy;c=Math.abs(u[0]-m)/g<.3?"center":u[0]>m?"left":"right",f=Math.abs(u[1]-y)/g<.3?"middle":u[1]>y?"top":"bottom"}return{position:u,align:c,verticalAlign:f}}var H9e={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:SR(t.coordToPoint([n[0],r]),t.coordToPoint([n[1],r]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r}}},shadow:function(e,t,r,n){var i=Math.max(1,e.getBandWidth()),a=Math.PI/180;return e.dim==="angle"?{type:"Sector",shape:D8(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:D8(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},U9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.findAxisModel=function(r){var n,i=this.ecModel;return i.eachComponent(r,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}(Ke),TR=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",er).models[0]},t.type="polarAxis",t}(Ke);cr(TR,Jv);var Z9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="angleAxis",t}(TR),Y9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="radiusAxis",t}(TR),CR=function(e){q(t,e);function t(r,n){return e.call(this,"radius",r,n)||this}return t.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},t}(ba);CR.prototype.dataToRadius=ba.prototype.dataToCoord;CR.prototype.radiusToData=ba.prototype.coordToData;var X9e=Je(),AR=function(e){q(t,e);function t(r,n){return e.call(this,"angle",r,n||[0,360])||this}return t.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},t.prototype.calculateCategoryInterval=function(){var r=this,n=r.getLabelModel(),i=r.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=r.dataToCoord(s+1)-r.dataToCoord(s),u=Math.abs(l),c=PT(s==null?"":s+"",n.getFont(),"center","top"),f=Math.max(c.height,7),h=f/u;isNaN(h)&&(h=1/0);var d=Math.max(0,Math.floor(h)),v=X9e(r.model),g=v.lastAutoInterval,m=v.lastTickCount;return g!=null&&m!=null&&Math.abs(g-d)<=1&&Math.abs(m-o)<=1&&g>d?d=g:(v.lastTickCount=o,v.lastAutoInterval=d),d},t}(ba);AR.prototype.dataToAngle=ba.prototype.dataToCoord;AR.prototype.angleToData=ba.prototype.coordToData;var Qne=["radius","angle"],q9e=function(){function e(t){this.dimensions=Qne,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new CR,this._angleAxis=new AR,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(t){var r=this.pointToCoord(t);return this._radiusAxis.contain(r[0])&&this._angleAxis.contain(r[1])},e.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},e.prototype.getAxis=function(t){var r="_"+t+"Axis";return this[r]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(t){var r=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&r.push(n),i.scale.type===t&&r.push(i),r},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(t){var r=this._angleAxis;return t===r?this._radiusAxis:r},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(t){var r=t!=null&&t!=="auto"?this.getAxis(t):this.getBaseAxis();return{baseAxes:[r],otherAxes:[this.getOtherAxis(r)]}},e.prototype.dataToPoint=function(t,r,n){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],r),this._angleAxis.dataToAngle(t[1],r)],n)},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.pointToCoord(t);return n[0]=this._radiusAxis.radiusToData(i[0],r),n[1]=this._angleAxis.angleToData(i[1],r),n},e.prototype.pointToCoord=function(t){var r=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var u=Math.atan2(-n,r)/Math.PI*180,c=us;)u+=c*360;return[l,u]},e.prototype.coordToPoint=function(t,r){r=r||[];var n=t[0],i=t[1]/180*Math.PI;return r[0]=Math.cos(i)*n+this.cx,r[1]=-Math.sin(i)*n+this.cy,r},e.prototype.getArea=function(){var t=this.getAngleAxis(),r=this.getRadiusAxis(),n=r.getExtent().slice();n[0]>n[1]&&n.reverse();var i=t.getExtent(),a=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:t.inverse,contain:function(s,l){var u=s-this.cx,c=l-this.cy,f=u*u+c*c,h=this.r,d=this.r0;return h!==d&&f-o<=h*h&&f+o>=d*d},x:this.cx-n[1],y:this.cy-n[1],width:n[1]*2,height:n[1]*2}},e.prototype.convertToPixel=function(t,r,n){var i=F8(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=F8(r);return i===this?this.pointToData(n):null},e}();function F8(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function K9e(e,t,r){var n=t.get("center"),i=jr(t,r).refContainer;e.cx=ve(n[0],i.width)+i.x,e.cy=ve(n[1],i.height)+i.y;var a=e.getRadiusAxis(),o=Math.min(i.width,i.height)/2,s=t.get("radius");s==null?s=[0,"100%"]:ae(s)||(s=[0,s]);var l=[ve(s[0],o),ve(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function J9e(e,t){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),e.eachSeries(function(s){if(s.coordinateSystem===r){var l=s.getData();B(Iw(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),B(Iw(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),mf(n.scale,n.model),mf(i.scale,i.model),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function Q9e(e){return e.mainType==="angleAxis"}function V8(e,t){var r;if(e.type=t.get("type"),e.scale=y0(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),Q9e(t)){e.inverse=e.inverse!==t.get("clockwise");var n=t.get("startAngle"),i=(r=t.get("endAngle"))!==null&&r!==void 0?r:n+(e.inverse?-360:360);e.setExtent(n,i)}t.axis=e,e.model=t}var eZe={dimensions:Qne,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new q9e(i+"");a.update=J9e;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");V8(o,l),V8(s,u),K9e(a,n,t),r.push(a),n.coordinateSystem=a,a.model=n}),e.eachSeries(function(n){if(n.get("coordinateSystem")==="polar"){var i=n.getReferringComponents("polar",er).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},tZe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function C_(e,t,r){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],r]),i=e.coordToPoint([t[1],r]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function A_(e){var t=e.getRadiusAxis();return t.inverse?0:1}function G8(e){var t=e[0],r=e[e.length-1];t&&r&&Math.abs(Math.abs(t.coord-r.coord)-360)<1e-4&&e.pop()}var rZe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.axisPointerClass="PolarAxisPointer",r}return t.prototype.render=function(r,n){if(this.group.removeAll(),!!r.get("show")){var i=r.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords({breakTicks:"none"}),l=i.getMinorTicksCoords(),u=se(i.getViewLabels(),function(c){c=Ae(c);var f=i.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(h),c});G8(u),G8(s),B(tZe,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&nZe[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(Nf),nZe={axisLine:function(e,t,r,n,i,a){var o=t.getModel(["axisLine","lineStyle"]),s=r.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=A_(r),f=c?0:1,h,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new If[d]({shape:{cx:r.cx,cy:r.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):h=new zv({shape:{cx:r.cx,cy:r.cy,r:a[c],r0:a[f]},style:o.getLineStyle(),z2:1,silent:!0}),h.style.fill=null,e.add(h)},axisTick:function(e,t,r,n,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[A_(r)],u=se(n,function(c){return new mr({shape:C_(r,[l,l+s],c.coord)})});e.add(Si(u,{style:Pe(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,r,n,i,a){if(i.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[A_(r)],c=[],f=0;fy?"left":"right",S=Math.abs(m[1]-_)/g<.3?"middle":m[1]>_?"top":"bottom";if(s&&s[v]){var T=s[v];ke(T)&&T.textStyle&&(d=new et(T.textStyle,l,l.ecModel))}var C=new at({silent:Wn.isLabelSilent(t),style:Mt(d,{x:m[0],y:m[1],fill:d.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:b,verticalAlign:S})});if(e.add(C),Qs({el:C,componentModel:t,itemName:f.formattedLabel,formatterParamsExtra:{isTruncated:function(){return C.isTruncated},value:f.rawLabel,tickIndex:h}}),c){var A=Wn.makeAxisEventDataBase(t);A.targetType="axisLabel",A.value=f.rawLabel,De(C).eventData=A}},this)},splitLine:function(e,t,r,n,i,a){var o=t.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],f=0;f=0?"p":"n",F=I;T&&(n[c][N]||(n[c][N]={p:I,n:I}),F=n[c][N][z]);var $=void 0,Z=void 0,j=void 0,U=void 0;if(v.dim==="radius"){var G=v.dataToCoord(D)-I,V=l.dataToCoord(N);Math.abs(G)=U})}}})}function uZe(e){var t={};B(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=tie(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),f=t[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=f.stacks;t[l]=f;var d=eie(n);h[d]||f.autoWidthCount++,h[d]=h[d]||{width:0,maxWidth:0};var v=ve(n.get("barWidth"),c),g=ve(n.get("barMaxWidth"),c),m=n.get("barGap"),y=n.get("barCategoryGap");v&&!h[d].width&&(v=Math.min(f.remainedWidth,v),h[d].width=v,f.remainedWidth-=v),g&&(h[d].maxWidth=g),m!=null&&(f.gap=m),y!=null&&(f.categoryGap=y)});var r={};return B(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=ve(n.categoryGap,o),l=ve(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),B(a,function(g,m){var y=g.maxWidth;y&&y=r.y&&t[1]<=r.y+r.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=r.y&&t[0]<=r.y+r.height},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.getAxis();return n[0]=i.coordToData(i.toLocalCoord(t[i.orient==="horizontal"?0:1])),n},e.prototype.dataToPoint=function(t,r,n){var i=this.getAxis(),a=this.getRect();n=n||[];var o=i.orient==="horizontal"?0:1;return t instanceof Array&&(t=t[0]),n[o]=i.toGlobalCoord(i.dataToCoord(+t)),n[1-o]=o===0?a.y+a.height/2:a.x+a.width/2,n},e.prototype.convertToPixel=function(t,r,n){var i=W8(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=W8(r);return i===this?this.pointToData(n):null},e}();function W8(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function xZe(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new yZe(n,e,t);a.name="single_"+i,a.resize(n,t),n.coordinateSystem=a,r.push(a)}),e.eachSeries(function(n){if(n.get("coordinateSystem")==="singleAxis"){var i=n.getReferringComponents("singleAxis",er).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var _Ze={create:xZe,dimensions:rie},H8=["x","y"],bZe=["width","height"],wZe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=YM(l,1-qw(s)),c=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var h=bR(a),d=SZe[f](s,c,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=IO(i);Xne(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=IO(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=wR(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.coordinateSystem,l=qw(o),u=YM(s,l),c=[r.x,r.y];c[l]+=n[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var f=YM(s,1-l),h=(f[1]+f[0])/2,d=[h,h];return d[l]=c[l],{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},t}(_R),SZe={line:function(e,t,r){var n=SR([t,r[0]],[t,r[1]],qw(e));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(e,t,r){var n=e.getBandWidth(),i=r[1]-r[0];return{type:"Rect",shape:qne([t-n/2,r[0]],[n,i],qw(e))}}};function qw(e){return e.isHorizontal()?0:1}function YM(e,t){var r=e.getRect();return[r[H8[t]],r[H8[t]]+r[bZe[t]]]}var TZe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="single",t}(kt);function CZe(e){Ze(T0),Nf.registerAxisPointerClass("SingleAxisPointer",wZe),e.registerComponentView(TZe),e.registerComponentView(pZe),e.registerComponentModel(yb),lv(e,"single",yb,yb.defaultOption),e.registerCoordinateSystem("single",_Ze)}var AZe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n,i){var a=Of(r);e.prototype.init.apply(this,arguments),U8(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),U8(this.option,r)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.layoutMode="box",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:J.color.axisLine,width:1,type:"solid"}},itemStyle:{color:J.color.neutral00,borderWidth:1,borderColor:J.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:J.size.s,color:J.color.secondary},monthLabel:{show:!0,position:"start",margin:J.size.s,align:"center",formatter:null,color:J.color.secondary},yearLabel:{show:!0,position:null,margin:J.size.xl,formatter:null,color:J.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(Ke);function U8(e,t){var r=e.cellSize,n;ae(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=se([0,1],function(a){return YBe(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Vo(e,t,{type:"box",ignoreSize:i})}var MZe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group;a.removeAll();var o=r.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(r,s,a),this._renderLines(r,s,l,a),this._renderYearText(r,s,l,a),this._renderMonthText(r,u,l,a),this._renderWeekText(r,u,s,l,a)},t.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,o=r.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToCalendarLayout([u],!1).tl,f=new Xe({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(f)}},t.prototype._renderLines=function(r,n,i,a){var o=this,s=r.coordinateSystem,l=r.getModel(["splitLine","lineStyle"]).getLineStyle(),u=r.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var f=n.start,h=0;f.time<=n.end.time;h++){v(f.formatedDate),h===0&&(f=s.getDateInfo(n.start.y+"-"+n.start.m));var d=f.date;d.setMonth(d.getMonth()+1),f=s.getDateInfo(d)}v(s.getNextNDay(n.end.time,1).formatedDate);function v(g){o._firstDayOfMonth.push(s.getDateInfo(g)),o._firstDayPoints.push(s.dataToCalendarLayout([g],!1).tl);var m=o._getLinePointsOfOneWeek(r,g,i);o._tlpoints.push(m[0]),o._blpoints.push(m[m.length-1]),u&&o._drawSplitline(m,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,i),l,a)},t.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},t.prototype._drawSplitline=function(r,n,i){var a=new an({z2:20,shape:{points:r},style:n});i.add(a)},t.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToCalendarLayout([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[i==="horizontal"?"bl":"tr"]}return s},t.prototype._formatterLabel=function(r,n){return pe(r)&&r?FBe(r,n):Ce(r)?r(n):n.nameMap},t.prototype._yearTextPositionControl=function(r,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},t.prototype._renderYearText=function(r,n,i,a){var o=r.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,f=(u[0][1]+u[1][1])/2,h=i==="horizontal"?0:1,d={top:[c,u[h][1]],bottom:[c,u[1-h][1]],left:[u[1-h][0],f],right:[u[h][0],f]},v=n.start.y;+n.end.y>+n.start.y&&(v=v+"-"+n.end.y);var g=o.get("formatter"),m={start:n.start.y,end:n.end.y,nameMap:v},y=this._formatterLabel(g,m),_=new at({z2:30,style:Mt(o,{text:y}),silent:o.get("silent")});_.attr(this._yearTextPositionControl(_,d[l],i,l,s)),a.add(_)}},t.prototype._monthTextPositionControl=function(r,n,i,a,o){var s="left",l="top",u=r[0],c=r[1];return i==="horizontal"?(c=c+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},t.prototype._renderMonthText=function(r,n,i,a){var o=r.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),f=[this._tlpoints,this._blpoints];(!s||pe(s))&&(s&&(n=AI(s)||n),s=n.get(["time","monthAbbr"])||[]);var h=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var v=c==="center",g=o.get("silent"),m=0;m=a.start.time&&i.times.end.time&&r.reverse(),r},e.prototype._getRangeInfo=function(t){var r=[this.getDateInfo(t[0]),this.getDateInfo(t[1])],n;r[0].time>r[1].time&&(n=!0,r.reverse());var i=Math.floor(r[1].time/XM)-Math.floor(r[0].time/XM)+1,a=new Date(r[0].time),o=a.getDate(),s=r[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-r[1].time)*u>0;)i-=u,a.setDate(l-u);var c=Math.floor((i+r[0].day+6)/7),f=n?-c+1:c-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:c,nthWeek:f,fweek:r[0].day,lweek:r[1].day}},e.prototype._getDateByWeeksAndDay=function(t,r,n){var i=this._getRangeInfo(n);if(t>i.weeks||t===0&&ri.lweek)return null;var a=(t-1)*7-i.fweek+r,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},e.create=function(t,r){var n=[];return t.eachComponent("calendar",function(i){var a=new e(i,t,r);n.push(a),i.coordinateSystem=a}),t.eachComponent(function(i,a){g0({targetModel:a,coordSysType:"calendar",coordSysProvider:bQ})}),n},e.dimensions=["time","value"],e}();function qM(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function kZe(e){e.registerComponentModel(AZe),e.registerComponentView(MZe),e.registerCoordinateSystem("calendar",PZe)}var hs={level:1,leaf:2,nonLeaf:3},Is={none:0,all:1,body:2,corner:3};function OO(e,t,r){var n=t[Be[r]].getCell(e);return!n&&ot(e)&&e<0&&(n=t[Be[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function nie(e){var t=e||[];return t[0]=t[0]||[],t[1]=t[1]||[],t[0][0]=t[0][1]=t[1][0]=t[1][1]=NaN,t}function iie(e,t,r,n,i){Z8(e[0],t,i,r,n,0),Z8(e[1],t,i,r,n,1)}function Z8(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=ae(o)?o:[o],l=s.length,u=!!r;if(l>=1?(Y8(e,t,s,u,i,a,0),l>1&&Y8(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Be[1-a]].getLocatorCount(a),f=i[Be[a]].getLocatorCount(a)-1;r===Is.body?c=pr(0,c):r===Is.corner&&(f=Li(-1,f)),f=t[0]&&e[0]<=t[1]}function K8(e,t){e.id.set(t[0][0],t[1][0]),e.span.set(t[0][1]-e.id.x+1,t[1][1]-e.id.y+1)}function OZe(e,t){e[0][0]=t[0][0],e[0][1]=t[0][1],e[1][0]=t[1][0],e[1][1]=t[1][1]}function J8(e,t,r,n){var i=OO(t[n][0],r,n),a=OO(t[n][1],r,n);e[Be[n]]=e[Tr[n]]=NaN,i&&a&&(e[Be[n]]=i.xy,e[Tr[n]]=a.xy+a.wh-i.xy)}function ig(e,t,r,n){return e[Be[t]]=r,e[Be[1-t]]=n,e}function EZe(e){return e&&(e.type===hs.leaf||e.type===hs.nonLeaf)?e:null}function Kw(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var Q8=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=DZe(t);var n=r.get("data",!0);n!=null&&!ae(n)&&(n=[]),n?this._initByDimModelData(n):this._initBySeriesData()}return e.prototype._initByDimModelData=function(t){var r=this,n=r._cells,i=r._levels,a=[],o=0;r._leavesCount=s(t,0,0),l();return;function s(u,c,f){var h=0;return u&&B(u,function(d,v){var g;pe(d)?g={value:d}:ke(d)?(g=d,d.value!=null&&!pe(d.value)&&(g={value:null})):g={value:null};var m={type:hs.nonLeaf,ordinal:NaN,level:f,firstLeafLocator:c,id:new Ie,span:ig(new Ie,r.dimIdx,1,1),option:g,xy:NaN,wh:NaN,dim:r,rect:Kw()};o++,(a[c]||(a[c]=[])).push(m),i[f]||(i[f]={type:hs.level,xy:NaN,wh:NaN,option:null,id:new Ie,dim:r});var y=s(g.children,c,f+1),_=Math.max(1,y);m.span[Be[r.dimIdx]]=_,h+=_,c+=_}),h}function l(){for(var u=[];n.length=1,b=r[Be[n]],S=a.getLocatorCount(n)-1,T=new Yl;for(o.resetLayoutIterator(T,n);T.next();)C(T.item);for(a.resetLayoutIterator(T,n);T.next();)C(T.item);function C(A){gn(A.wh)&&(A.wh=y),A.xy=b,A.id[Be[n]]===S&&!_&&(A.wh=r[Be[n]]+r[Tr[n]]-A.xy),b+=A.wh}}function oH(e,t){for(var r=t[Be[e]].resetCellIterator();r.next();){var n=r.item;Jw(n.rect,e,n.id,n.span,t),Jw(n.rect,1-e,n.id,n.span,t),n.type===hs.nonLeaf&&(n.xy=n.rect[Be[e]],n.wh=n.rect[Tr[e]])}}function sH(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;Jw(i,0,a,n,t),Jw(i,1,a,n,t)}})}function Jw(e,t,r,n,i){e[Tr[t]]=0;var a=r[Be[t]],o=a<0?i[Be[1-t]]:i[Be[t]],s=o.getUnitLayoutInfo(t,r[Be[t]]);if(e[Be[t]]=s.xy,e[Tr[t]]=s.wh,n[Be[t]]>1){var l=o.getUnitLayoutInfo(t,r[Be[t]]+n[Be[t]]-1);e[Tr[t]]=l.xy+l.wh-s.xy}}function ZZe(e,t,r){var n=fw(e,r[Tr[t]]);return DO(n,r[Tr[t]])}function DO(e,t){return Math.max(Math.min(e,be(t,1/0)),0)}function QM(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var hn={inBody:1,inCorner:2,outside:3},co={x:null,y:null,point:[]};function lH(e,t,r,n,i){var a=r[Be[t]],o=r[Be[1-t]],s=a.getUnitLayoutInfo(t,a.getLocatorCount(t)-1),l=a.getUnitLayoutInfo(t,0),u=o.getUnitLayoutInfo(t,-o.getLocatorCount(t)),c=o.shouldShow()?o.getUnitLayoutInfo(t,-1):null,f=e.point[t]=n[t];if(!l&&!c){e[Be[t]]=hn.outside;return}if(i===Is.body){l?(e[Be[t]]=hn.inBody,f=Li(s.xy+s.wh,pr(l.xy,f)),e.point[t]=f):e[Be[t]]=hn.outside;return}else if(i===Is.corner){c?(e[Be[t]]=hn.inCorner,f=Li(c.xy+c.wh,pr(u.xy,f)),e.point[t]=f):e[Be[t]]=hn.outside;return}var h=l?l.xy:c?c.xy+c.wh:NaN,d=u?u.xy:h,v=s?s.xy+s.wh:h;if(fv){if(!i){e[Be[t]]=hn.outside;return}f=v}e.point[t]=f,e[Be[t]]=h<=f&&f<=v?hn.inBody:d<=f&&f<=h?hn.inCorner:hn.outside}function uH(e,t,r,n){var i=1-r;if(e[Be[r]]!==hn.outside)for(n[Be[r]].resetCellIterator(JM);JM.next();){var a=JM.item;if(fH(e.point[r],a.rect,r)&&fH(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Be[i]];return}}}function cH(e,t,r,n){if(e[Be[r]]!==hn.outside){var i=e[Be[r]]===hn.inCorner?n[Be[1-r]]:n[Be[r]];for(i.resetLayoutIterator(I_,r);I_.next();)if(YZe(e.point[r],I_.item)){t[r]=I_.item.id[Be[r]];return}}}function YZe(e,t){return t.xy<=e&&e<=t.xy+t.wh}function fH(e,t,r){return t[Be[r]]<=e&&e<=t[Be[r]]+t[Tr[r]]}function XZe(e){e.registerComponentModel(BZe),e.registerComponentView(GZe),e.registerCoordinateSystem("matrix",UZe)}function qZe(e,t){var r=e.existing;if(t.id=e.keyInfo.id,!t.type&&r&&(t.type=r.type),t.parentId==null){var n=t.parentOption;n?t.parentId=n.id:r&&(t.parentId=r.parentId)}t.parentOption=null}function hH(e,t){var r;return B(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function KZe(e,t,r){var n=ie({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(He(i,n,!0),Vo(i,n,{ignoreSize:!0}),AQ(r,i),O_(r,i),O_(r,i,"shape"),O_(r,i,"style"),O_(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var oie=["transition","enterFrom","leaveTo"],JZe=oie.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function O_(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?oie:JZe,i=0;i=0;c--){var f=i[c],h=Ir(f.id,null),d=h!=null?o.get(h):null;if(d){var v=d.parent,y=qi(v),_=v===a?{width:s,height:l}:{width:y.width,height:y.height},b={},S=VT(d,f,_,null,{hv:f.hv,boundingMode:f.bounding},b);if(!qi(d).isNew&&S){for(var T=f.transition,C={},A=0;A=0)?C[P]=I:d[P]=I}lt(d,C,r,0)}else d.attr(b)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){xb(i,qi(i).option,n,r._lastGraphicModel)}),this._elMap=_e()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(kt);function NO(e){var t=xe(dH,e)?dH[e]:by(e),r=new t({});return qi(r).type=e,r}function vH(e,t,r,n){var i=NO(r);return t.add(i),n.set(e,i),qi(i).id=e,qi(i).isNew=!0,i}function xb(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){xb(a,t,r,n)}),iC(e,t,n),r.removeKey(qi(e).id))}function pH(e,t,r,n){e.isGroup||B([["cursor",pa.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];xe(t,a)?e[a]=be(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),B(it(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=Ce(a)?a:null}}),xe(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function rYe(e){return e=ie({},e),B(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(wQ),function(t){delete e[t]}),e}function nYe(e,t,r){var n=De(e).eventData;!e.silent&&!e.ignore&&!n&&(n=De(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),n&&(n.info=r.info)}function iYe(e){e.registerComponentModel(eYe),e.registerComponentView(tYe),e.registerPreprocessor(function(t){var r=t.graphic;ae(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var gH=["x","y","radius","angle","single"],aYe=["cartesian2d","polar","singleAxis"];function oYe(e){var t=e.get("coordinateSystem");return We(aYe,t)>=0}function Nl(e){return e+"Axis"}function sYe(e,t){var r=_e(),n=[],i=_e();e.eachComponent({mainType:"dataZoom",query:t},function(c){i.get(c.uid)||s(c)});var a;do a=!1,e.eachComponent("dataZoom",o);while(a);function o(c){!i.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){i.set(c.uid,!0),n.push(c),u(c)}function l(c){var f=!1;return c.eachTargetAxis(function(h,d){var v=r.get(h);v&&v[d]&&(f=!0)}),f}function u(c){c.eachTargetAxis(function(f,h){(r.get(f)||r.set(f,[]))[h]=!0})}return n}function sie(e){var t=e.ecModel,r={infoList:[],infoMap:_e()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(Nl(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}var eP=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},e}(),$y=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return t.prototype.init=function(r,n,i){var a=mH(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=mH(r);He(this.option,r,!0),He(this.settledOption,n,!0),this._doInit(n)},t.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var i=this.settledOption;B([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=_e(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return B(gH,function(i){var a=this.getReferringComponents(Nl(i),CRe);if(a.specified){n=!0;var o=new eP;B(a.models,function(s){o.add(s.componentIndex)}),r.set(i,o)}},this),n},t.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===n}});l(s,"single")}function l(u,c){var f=u[0];if(f){var h=new eP;if(h.add(f.componentIndex),r.set(c,h),a=!1,c==="x"||c==="y"){var d=f.getReferringComponents("grid",er).models[0];d&&B(u,function(v){f.componentIndex!==v.componentIndex&&d===v.getReferringComponents("grid",er).models[0]&&h.add(v.componentIndex)})}}}a&&B(gH,function(u){if(a){var c=i.findComponents({mainType:Nl(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new eP;f.add(c[0].componentIndex),r.set(u,f),a=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(r){var n=this._rangePropMode,i=this.get("rangeMode");B([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,i){r==null&&(r=this.ecModel.getComponent(Nl(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){B(i.indexList,function(o){r.call(n,a,o)})})},t.prototype.getAxisProxy=function(r,n){var i=this.getAxisModel(r,n);if(i)return i.__dzAxisProxy},t.prototype.getAxisModel=function(r,n){var i=this._targetAxisInfoMap.get(r);if(i&&i.indexMap[n])return this.ecModel.getComponent(Nl(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;B([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(n[a[0]]=i[a[0]]=r[a[0]],n[a[1]]=i[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},t.prototype.setCalculatedRange=function(r){var n=this.option;B(["start","startValue","end","endValue"],function(i){n[i]=r[i]})},t.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},t.prototype.getValueRange=function(r,n){if(r==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(r,n).getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(b&&!S&&!T)return!0;b&&(m=!0),S&&(v=!0),T&&(g=!0)}return m&&v&&g})}else kh(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(g){return s(g)?g:NaN}));else{var v={};v[d]=o,u.selectRange(v)}});kh(c,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},e.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;kh(["min","max"],function(i){var a=r.get(i+"Span"),o=r.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=gt(n[0]+o,n,[0,100],!0):a!=null&&(o=gt(a,[0,100],n,!0)-n[0]),t[i+"Span"]=a,t[i+"ValueSpan"]=o},this)},e.prototype._setAxisModel=function(){var t=this.getAxisModel(),r=this._percentWindow,n=this._valueWindow;if(r){var i=yN(n,[0,500]);i=Math.min(i,20);var a=t.axis.scale.rawExtentInfo;r[0]!==0&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),r[1]!==100&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},e}();function fYe(e,t,r){var n=[1/0,-1/0];kh(r,function(o){k$e(n,o.getData(),t)});var i=e.getAxisModel(),a=ote(i.axis.scale,i,n).calculate();return[a.min,a.max]}var hYe={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(Nl(o),s);i(o,s,l,a)})})}t(function(i,a,o,s){o.__dzAxisProxy=null});var r=[];t(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new cYe(i,a,s,e),r.push(o.__dzAxisProxy))});var n=_e();return B(r,function(i){B(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(e,t){e.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(n,i){r.getAxisProxy(n,i).reset(r)}),r.eachTargetAxis(function(n,i){r.getAxisProxy(n,i).filterData(r,t)})}),e.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var i=n.getDataPercentWindow(),a=n.getDataValueWindow();r.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};function dYe(e){e.registerAction("dataZoom",function(t,r){var n=sYe(r,t);B(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var xH=!1;function LR(e){xH||(xH=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,hYe),dYe(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function vYe(e){e.registerComponentModel(lYe),e.registerComponentView(uYe),LR(e)}var ea=function(){function e(){}return e}(),lie={};function Lh(e,t){lie[e]=t}function uie(e){return lie[e]}var pYe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var r=this.ecModel;B(this.option.feature,function(n,i){var a=uie(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),He(n,a.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:J.color.border,borderRadius:0,borderWidth:0,padding:J.size.m,itemSize:15,itemGap:J.size.s,showTitle:!0,iconStyle:{borderColor:J.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:J.color.accent50}},tooltip:{show:!1,position:"bottom"}},t}(Ke);function cie(e,t){var r=Hv(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new Xe({shape:{x:e.x-r[3],y:e.y-r[0],width:e.width+r[1]+r[3],height:e.height+r[0]+r[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1});return i}var gYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i,a){var o=this.group;if(o.removeAll(),!r.get("show"))return;var s=+r.get("itemSize"),l=r.get("orient")==="vertical",u=r.get("feature")||{},c=this._features||(this._features={}),f=[];B(u,function(_,b){f.push(b)}),new Gs(this._featureNames||[],f).add(h).update(h).remove(Fe(h,null)).execute(),this._featureNames=f;function h(_,b){var S=f[_],T=f[b],C=u[S],A=new et(C,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(C.title=a.newTitle),S&&!T){if(mYe(S))P={onclick:A.option.onclick,featureName:S};else{var I=uie(S);if(!I)return;P=new I}c[S]=P}else if(P=c[T],!P)return;P.uid=Wv("toolbox-feature"),P.model=A,P.ecModel=n,P.api=i;var k=P instanceof ea;if(!S&&T){k&&P.dispose&&P.dispose(n,i);return}if(!A.get("show")||k&&P.unusable){k&&P.remove&&P.remove(n,i);return}d(A,P,S),A.setIconStatus=function(E,D){var N=this.option,z=this.iconPaths;N.iconStatus=N.iconStatus||{},N.iconStatus[E]=D,z[E]&&(D==="emphasis"?Fs:Vs)(z[E])},P instanceof ea&&P.render&&P.render(A,n,i,a)}function d(_,b,S){var T=_.getModel("iconStyle"),C=_.getModel(["emphasis","iconStyle"]),A=b instanceof ea&&b.getIcons?b.getIcons():_.get("icon"),P=_.get("title")||{},I,k;pe(A)?(I={},I[S]=A):I=A,pe(P)?(k={},k[S]=P):k=P;var E=_.iconPaths={};B(I,function(D,N){var z=Vv(D,{},{x:-s/2,y:-s/2,width:s,height:s});z.setStyle(T.getItemStyle());var F=z.ensureState("emphasis");F.style=C.getItemStyle();var $=new at({style:{text:k[N],align:C.get("textAlign"),borderRadius:C.get("textBorderRadius"),padding:C.get("textPadding"),fill:null,font:FN({fontStyle:C.get("textFontStyle"),fontFamily:C.get("textFontFamily"),fontSize:C.get("textFontSize"),fontWeight:C.get("textFontWeight")},n)},ignore:!0});z.setTextContent($),Qs({el:z,componentModel:r,itemName:N,formatterParamsExtra:{title:k[N]}}),z.__title=k[N],z.on("mouseover",function(){var Z=C.getItemStyle(),j=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";$.setStyle({fill:C.get("textFill")||Z.fill||Z.stroke||J.color.neutral99,backgroundColor:C.get("textBackgroundColor")}),z.setTextConfig({position:C.get("textPosition")||j}),$.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){_.get(["iconStatus",N])!=="emphasis"&&i.leaveEmphasis(this),$.hide()}),(_.get(["iconStatus",N])==="emphasis"?Fs:Vs)(z),o.add(z),z.on("click",me(b.onclick,b,n,i,N)),E[N]=z})}var v=jr(r,i).refContainer,g=r.getBoxLayoutParams(),m=r.get("padding"),y=zt(g,v,m);Zc(r.get("orient"),o,r.get("itemGap"),y.width,y.height),VT(o,g,v,m),o.add(cie(o.getBoundingRect(),r)),l||o.eachChild(function(_){var b=_.__title,S=_.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),C=_.getTextContent(),A=C&&C.ensureState("emphasis");if(A&&!Ce(A)&&b){var P=A.style||(A.style={}),I=PT(b,at.makeFont(P)),k=_.x+o.x,E=_.y+o.y+s,D=!1;E+I.height>i.getHeight()&&(T.position="top",D=!0);var N=D?-5-I.height:s+10;k+I.width/2>i.getWidth()?(T.position=["100%",N],P.align="right"):k-I.width/2<0&&(T.position=[0,N],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){B(this._features,function(o){o instanceof ea&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){B(this._features,function(i){i instanceof ea&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){B(this._features,function(i){i instanceof ea&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(kt);function mYe(e){return e.indexOf("my")===0}var yYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){var i=this.model,a=i.get("name")||r.get("title.0.text")||"echarts",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||J.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=nt.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(f)}else if(window.navigator.msSaveOrOpenBlob||o){var h=l.split(","),d=h[0].indexOf("base64")>-1,v=o?decodeURIComponent(h[1]):h[1];d&&(v=window.atob(v));var g=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var m=v.length,y=new Uint8Array(m);m--;)y[m]=v.charCodeAt(m);var _=new Blob([y]);window.navigator.msSaveOrOpenBlob(_,g)}else{var b=document.createElement("iframe");document.body.appendChild(b);var S=b.contentWindow,T=S.document;T.open("image/svg+xml","replace"),T.write(v),T.close(),S.focus(),T.execCommand("SaveAs",!0,g),document.body.removeChild(b)}}else{var C=i.get("lang"),A='',P=window.open();P.document.write(A),P.document.title=a}},t.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:J.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(ea),_H="__ec_magicType_stack__",xYe=[["line","bar"],["stack"]],_Ye=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var r=this.model,n=r.get("icon"),i={};return B(r.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},t.getDefaultOption=function(r){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:r.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},t.prototype.onclick=function(r,n,i){var a=this.model,o=a.get(["seriesIndex",i]);if(bH[i]){var s={series:[]},l=function(f){var h=f.subType,d=f.id,v=bH[i](h,d,f,a);v&&(Pe(v,f.option),s.series.push(v));var g=f.coordinateSystem;if(g&&g.type==="cartesian2d"&&(i==="line"||i==="bar")){var m=g.getAxesByScale("ordinal")[0];if(m){var y=m.dim,_=y+"Axis",b=f.getReferringComponents(_,er).models[0],S=b.componentIndex;s[_]=s[_]||[];for(var T=0;T<=S;T++)s[_][S]=s[_][S]||{};s[_][S].boundaryGap=i==="bar"}}};B(xYe,function(f){We(f,i)>=0&&B(f,function(h){a.setIconStatus(h,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=He({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(c="tiled")),n.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},t}(ea),bH={line:function(e,t,r,n){if(e==="bar")return He({id:t,type:"line",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(e,t,r,n){if(e==="line")return He({id:t,type:"bar",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(e,t,r,n){var i=r.get("stack")===_H;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),He({id:t,stack:i?"":_H},n.get(["option","stack"])||{},!0)}};Qa({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var aC=new Array(60).join("-"),hv=" ";function bYe(e){var t={},r=[],n=[];return e.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;t[s]||(t[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),t[s].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:t,other:r,meta:n}}function wYe(e){var t=[];return B(e,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(se(r.series,function(d){return d.name})),l=[i.model.getCategories()];B(r.series,function(d){var v=d.getRawData();l.push(d.getRawData().mapArray(v.mapDimension(o),function(g){return g}))});for(var u=[s.join(hv)],c=0;c1||r>0&&!e.noHeader;return B(e.blocks,function(i){var a=aee(i);a>=t&&(t=a+ +(n&&(!a||zI(i)&&!i.noHeader)))}),t}return 0}function rze(e,t,r,n){var i=t.noHeader,a=ize(aee(t)),o=[],s=t.blocks||[];xn(!s||ae(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(xe(u,l)){var c=new KQ(u[l],null);s.sort(function(g,m){return c.evaluate(g.sortParam,m.sortParam)})}else l==="seriesDesc"&&s.reverse()}B(s,function(g,m){var x=t.valueFormatter,_=iee(g)(x?ie(ie({},e),{valueFormatter:x}):e,g,m>0?a.html:0,n);_!=null&&o.push(_)});var f=e.renderMode==="richText"?o.join(a.richText):$I(n,o.join(""),i?r:a.html);if(i)return f;var h=EI(t.header,"ordinal",e.useUTC),d=nee(n,e.renderMode).nameStyle,v=ree(n);return e.renderMode==="richText"?oee(e,h,d)+a.richText+f:$I(n,'
'+In(h)+"
"+f,r)}function nze(e,t,r,n){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(S){return S=ae(S)?S:[S],se(S,function(T,C){return EI(T,ae(d)?d[C]:d,u)})};if(!(a&&o)){var f=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||J.color.secondary,i),h=a?"":EI(l,"ordinal",u),d=t.valueType,v=o?[]:c(t.value,t.dataIndex),g=!s||!a,m=!s&&a,x=nee(n,i),_=x.nameStyle,b=x.valueStyle;return i==="richText"?(s?"":f)+(a?"":oee(e,h,_))+(o?"":sze(e,v,g,m,b)):$I(n,(s?"":f)+(a?"":aze(h,!s,_))+(o?"":oze(v,g,m,b)),r)}}function a6(e,t,r,n,i,a){if(e){var o=iee(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function ize(e){return{html:eze[e],richText:tze[e]}}function $I(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=ree(e);return'
'+t+n+"
"}function aze(e,t,r){var n=t?"margin-left:2px":"";return''+In(e)+""}function oze(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=ae(e)?e:[e],''+se(e,function(o){return In(o)}).join("  ")+""}function oee(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function sze(e,t,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(ae(t)?t.join(" "):t,a)}function see(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return gf(n)}function lee(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var z2=function(){function e(){this.richTextStyles={},this._nextStyleNameId=pJ()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(t,r,n){var i=n==="richText"?this._generateStyleName():null,a=wQ({color:r,type:t,renderMode:n,markerId:i});return pe(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};ae(r)?B(r,function(a){return ie(n,a)}):ie(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function uee(e){var t=e.series,r=e.dataIndex,n=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(r),l=ae(s),u=see(t,r),c,f,h,d;if(o>1||l&&!o){var v=lze(s,t,r,a,u);c=v.inlineValues,f=v.inlineValueTypes,h=v.blocks,d=v.inlineValues[0]}else if(o){var g=i.getDimensionInfo(a[0]);d=c=nv(i,r,a[0]),f=g.type}else d=c=l?s[0]:s;var m=AN(t),x=m&&t.name||"",_=i.getName(r),b=n?x:_;return Cr("section",{header:x,noHeader:n||!m,sortParam:d,blocks:[Cr("nameValue",{markerType:"item",markerColor:u,name:b,noName:!Ci(b),value:c,valueType:f,dataIndex:r})].concat(h||[])})}function lze(e,t,r,n,i){var a=t.getData(),o=da(e,function(f,h,d){var v=a.getDimensionInfo(d);return f=f||v&&v.tooltip!==!1&&v.displayName!=null},!1),s=[],l=[],u=[];n.length?B(n,function(f){c(nv(a,r,f),f)}):B(e,c);function c(f,h){var d=a.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?u.push(Cr("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var sl=Je();function Qx(e,t){return e.getName(t)||e.getId(t)}var gb="__universalTransitionEnabled",Tt=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return t.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=im({count:cze,reset:fze}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=sl(this).sourceManager=new tee(this);a.prepareSource();var o=this.getInitialData(r,i);s6(o,this),this.dataTask.context.data=o,sl(this).dataBeforeProcessed=o,o6(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=Cy(this),a=i?Of(r):{},o=this.subType;Ke.hasClass(o)&&(o+="Series"),He(r,n.getTheme().get(this.subType)),He(r,this.getDefaultOption()),cf(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Ho(r,a,i)},t.prototype.mergeOption=function(r,n){r=He(this.option,r,!0),this.fillDataTextStyle(r.data);var i=Cy(this);i&&Ho(this.option,r,i);var a=sl(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);s6(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,sl(this).dataBeforeProcessed=o,o6(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!Un(r))for(var n=["show"],i=0;i=0&&h<0)&&(f=_,h=x,d=0),x===h&&(c[d++]=g))}),c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return uee({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(nt.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,o=uj.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},t.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},t.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},t.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[Qx(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[gb])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},t.prototype._innerSelect=function(r,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){ke(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return Ke.registerClass(r)},t.protoInitialize=function(){var r=t.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),t}(Ke);cr(Tt,ZT);cr(Tt,uj);CJ(Tt,Ke);function o6(e){var t=e.name;AN(e)||(e.name=uze(e)||t)}function uze(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return B(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function cze(e){return e.model.getRawData().count()}function fze(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),hze}function hze(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function s6(e,t){B(qd(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Fe(dze,t))})}function dze(e,t){var r=FI(e);return r&&r.setOutputEnd((t||this).count()),t}function FI(e){var t=(e.ecModel||{}).scheduler,r=t&&t.getPipeline(e.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(e.uid))}return n}}var kt=function(){function e(){this.group=new Me,this.uid=Uv("viewComponent")}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){},e.prototype.updateLayout=function(t,r,n,i){},e.prototype.updateVisual=function(t,r,n,i){},e.prototype.toggleBlurSeries=function(t,r,n){},e.prototype.eachRendered=function(t){var r=this.group;r&&r.traverse(t)},e}();PN(kt);DT(kt);function Xv(){var e=Je();return function(t){var r=e(t),n=t.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var cee=Je(),vze=Xv(),bt=function(){function e(){this.group=new Me,this.uid=Uv("viewChart"),this.renderTask=im({plan:pze,reset:gze}),this.renderTask.context={view:this}}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.highlight=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&u6(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&u6(a,i,"normal")},e.prototype.remove=function(t,r){this.group.removeAll()},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateLayout=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateVisual=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.eachRendered=function(t){Au(this.group,t)},e.markUpdateMethod=function(t,r){cee(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function l6(e,t,r){e&&wy(e)&&(t==="emphasis"?Gs:Ws)(e,r)}function u6(e,t,r){var n=ff(e,t),i=t&&t.highlightKey!=null?V5e(t.highlightKey):null;n!=null?B(Pt(n),function(a){l6(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){l6(a,r,i)})}PN(bt);DT(bt);function pze(e){return vze(e.model)}function gze(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&cee(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),mze[l]}var mze={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},Sw="\0__throttleOriginMethod",c6="\0__throttleRate",f6="\0__throttleType";function XT(e,t,r){var n,i=0,a=0,o=null,s,l,u,c;t=t||0;function f(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var h=function(){for(var d=[],v=0;v=0?f():o=setTimeout(f,-s),i=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){c=d},h}function qv(e,t,r,n){var i=e[t];if(i){var a=i[Sw]||i,o=i[f6],s=i[c6];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=XT(a,r,n==="debounce"),i[Sw]=a,i[f6]=n,i[c6]=r}return i}}function My(e,t){var r=e[t];r&&r[Sw]&&(r.clear&&r.clear(),e[t]=r[Sw])}var h6=Je(),d6={itemStyle:hf(dQ,!0),lineStyle:hf(hQ,!0)},yze={lineStyle:"stroke",itemStyle:"fill"};function fee(e,t){var r=e.visualStyleMapper||d6[t];return r||(console.warn("Unknown style type '"+t+"'."),d6.itemStyle)}function hee(e,t){var r=e.visualDrawType||yze[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var xze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=fee(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=hee(e,n),u=o[l],c=Ce(u)?u:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||f){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=h,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Ce(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||Ce(o.stroke)?h:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&c)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,v){var g=e.getDataParams(v),m=ie({},o);m[l]=c(g),d.setItemVisual(v,"style",m)}}}},Gp=new et,_ze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=fee(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Gp.option=l[n];var u=i(Gp),c=o.ensureUniqueItemVisual(s,"style");ie(c,u),Gp.option.decal&&(o.setItemVisual(s,"decal",Gp.option.decal),Gp.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},bze={performRawSeries:!0,overallReset:function(e){var t=_e();e.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var i=r.type+"-"+n,a=t.get(i);a||(a={},t.set(i,a)),h6(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=h6(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=hee(r,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],f=a.getItemVisual(c,"colorFromPalette");if(f){var h=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",v=n.count();h[l]=r.getColorFromPalette(d,o,v)}})}})}},e_=Math.PI;function wze(e,t){t=t||{},Pe(t,{text:"loading",textColor:J.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:J.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new Me,n=new Xe({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new at({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Xe({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});r.add(a);var o;return t.showSpinner&&(o=new p0({shape:{startAngle:-e_/2,endAngle:-e_/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:e_*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:e_*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(e.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),c=e.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},r.resize(),r}var dee=function(){function e(t,r,n,i){this._stageTaskMap=_e(),this.ecInstance=t,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(t,r){t.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},e.prototype.getPerformArgs=function(t,r){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},e.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},e.prototype.updateStreamModes=function(t,r){var n=this._pipelineMap.get(t.uid),i=t.getData(),a=i.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&a>=n.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},e.prototype.restorePipelines=function(t){var r=this,n=r._pipelineMap=_e();t.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),r._pipe(i,i.dataTask)})},e.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,r=this.api.getModel(),n=this.api;B(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";xn(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},e.prototype.prepareView=function(t,r,n,i){var a=t.renderTask,o=a.context;o.model=r,o.ecModel=n,o.api=i,a.__block=!t.incrementalPrepareRender,this._pipe(r,a)},e.prototype.performDataProcessorTasks=function(t,r){this._performStageTasks(this._dataProcessorHandlers,t,r,{block:!0})},e.prototype.performVisualTasks=function(t,r,n){this._performStageTasks(this._visualHandlers,t,r,n)},e.prototype._performStageTasks=function(t,r,n,i){i=i||{};var a=!1,o=this;B(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),f=c.seriesTaskMap,h=c.overallTask;if(h){var d,v=h.agentStubMap;v.each(function(m){s(i,m)&&(m.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var g=o.getPerformArgs(h,i.block);v.each(function(m){m.perform(g)}),h.perform(g)&&(a=!0)}else f&&f.each(function(m,x){s(i,m)&&m.dirty();var _=o.getPerformArgs(m,i.block);_.skip=!l.performRawSeries&&r.isSeriesFiltered(m.context.model),o.updatePayload(m,n),m.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},e.prototype.performSeriesTasks=function(t){var r;t.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(t){var r=t.tail;do{if(r.__block){t.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},e.prototype.updatePayload=function(t,r){r!=="remain"&&(t.context.payload=r)},e.prototype._createSeriesStageTask=function(t,r,n,i){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=_e(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(f){var h=f.uid,d=s.set(h,o&&o.get(h)||im({plan:Mze,reset:Pze,count:Lze}));d.context={model:f,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(f,d)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||im({reset:Sze});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=_e(),u=t.seriesType,c=t.getTargetSeries,f=!0,h=!1,d="";xn(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,v):c?c(n,i).each(v):(f=!1,B(n.getSeries(),v));function v(g){var m=g.uid,x=l.set(m,s&&s.get(m)||(h=!0,im({reset:Tze,onDirty:Aze})));x.context={model:g,overallProgress:f},x.agent=o,x.__block=f,a._pipe(g,x)}h&&o.dirty()},e.prototype._pipe=function(t,r){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},e.wrapStageHandler=function(t,r){return Ce(t)&&(t={overallReset:t,seriesType:Ize(t)}),t.uid=Uv("stageHandler"),r&&(t.visualType=r),t},e}();function Sze(e){e.overallReset(e.ecModel,e.api,e.payload)}function Tze(e){return e.overallProgress&&Cze}function Cze(){this.agent.dirty(),this.getDownstream().dirty()}function Aze(){this.agent&&this.agent.dirty()}function Mze(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Pze(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Pt(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?se(t,function(r,n){return vee(n)}):kze}var kze=vee(0);function vee(e){return function(t,r){var n=r.data,i=r.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&d===u.length-h.length){var v=u.slice(0,d);v!=="data"&&(r.mainType=v,r[h.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(n[u]=l,c=!0),c||(i[u]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},e.prototype.filter=function(t,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,r.otherQuery,i,a));function c(f,h,d,v){return f[d]==null||h[v||d]===f[d]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),VI=["symbol","symbolSize","symbolRotate","symbolOffset"],p6=VI.concat(["symbolKeepAspect"]),Dze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData();if(e.legendIcon&&r.setVisual("legendIcon",e.legendIcon),!e.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&Rc(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function GI(e,t,r){for(var n=t.type==="radial"?Xze(e,t,r):Yze(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:ot(e)?[e]:ae(e)?e:null}function gj(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&Kze(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=se(r,function(a){return a/i}),n/=i)}return[r,n]}var Jze=new Wo(!0);function Aw(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function g6(e){return typeof e=="string"&&e!=="none"}function Mw(e){var t=e.fill;return t!=null&&t!=="none"}function m6(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function y6(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function WI(e,t,r){var n=kN(t.image,t.__image,r);if(NT(n)){var i=e.createPattern(n,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Zg),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function Qze(e,t,r,n){var i,a=Aw(r),o=Mw(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||Jze,f=t.__dirty;if(!n){var h=r.fill,d=r.stroke,v=o&&!!h.colorStops,g=a&&!!d.colorStops,m=o&&!!h.image,x=a&&!!d.image,_=void 0,b=void 0,S=void 0,T=void 0,C=void 0;(v||g)&&(C=t.getBoundingRect()),v&&(_=f?GI(e,h,C):t.__canvasFillGradient,t.__canvasFillGradient=_),g&&(b=f?GI(e,d,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),m&&(S=f||!t.__canvasFillPattern?WI(e,h,t):t.__canvasFillPattern,t.__canvasFillPattern=S),x&&(T=f||!t.__canvasStrokePattern?WI(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),v?e.fillStyle=_:m&&(S?e.fillStyle=S:o=!1),g?e.strokeStyle=b:x&&(T?e.strokeStyle=T:a=!1)}var A=t.getGlobalScale();c.setScale(A[0],A[1],t.segmentIgnoreThreshold);var P,I;e.setLineDash&&r.lineDash&&(i=gj(t),P=i[0],I=i[1]);var k=!0;(u||f&Mh)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),k=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),k&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=I),n||(r.strokeFirst?(a&&y6(e,r),o&&m6(e,r)):(o&&m6(e,r),a&&y6(e,r))),P&&e.setLineDash([])}function e4e(e,t,r){var n=t.__image=kN(r.image,t.__image,t,t.onload);if(!(!n||!NT(n))){var i=r.x||0,a=r.y||0,o=t.getWidth(),s=t.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var u=r.sx||0,c=r.sy||0;e.drawImage(n,u,c,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,c=r.sy,f=o-u,h=s-c;e.drawImage(n,u,c,f,h,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function t4e(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||Fs,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=gj(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(Aw(r)&&e.strokeText(i,r.x,r.y),Mw(r)&&e.fillText(i,r.x,r.y)):(Mw(r)&&e.fillText(i,r.x,r.y),Aw(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var x6=["shadowBlur","shadowOffsetX","shadowOffsetY"],_6=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function _ee(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){ri(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?Hc.opacity:o}(n||t.blend!==r.blend)&&(a||(ri(e,i),a=!0),e.globalCompositeOperation=t.blend||Hc.blend);for(var s=0;s0&&r.unfinished);r.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(r,n,i){if(!this[Pr]){if(this._disposed){this.id;return}var a,o,s;if(ke(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Pr]=!0,hh(this),!this._model||n){var l=new pBe(this._api),u=this._theme,c=this._model=new cj;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},YI);var f={seriesTransition:s,optionChanged:!0};if(i)this[Kr]={silent:a,updateParams:f},this[Pr]=!1,this.getZr().wakeUp();else{try{nc(this),os.update.call(this,null,f)}catch(h){throw this[Kr]=null,this[Pr]=!1,h}this._ssr||this._zr.flush(),this[Kr]=null,this[Pr]=!1,ch.call(this,a),fh.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[Pr]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Kr]&&(a==null&&(a=this[Kr].silent),o=this[Kr].updateParams,this[Kr]=null),this[Pr]=!0,hh(this);try{this._updateTheme(r),i.setTheme(this._theme),nc(this),os.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Pr]=!1,s}this[Pr]=!1,ch.call(this,a),fh.call(this,a)}}},t.prototype._updateTheme=function(r){pe(r)&&(r=zee[r]),r&&(r=Ae(r),r&&VQ(r,!0),this._theme=r)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||nt.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},t.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},t.prototype.getSvgDataURL=function(){var r=this._zr,n=r.storage.getDisplayList();return B(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()},t.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],o=this;B(n,function(l){i.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return B(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(Iw[i]){var l=s,u=s,c=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();B(Yc,function(b,S){if(b.group===i){var T=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(Ae(r)),C=b.getDom().getBoundingClientRect();l=a(C.left,l),u=a(C.top,u),c=o(C.right,c),f=o(C.bottom,f),h.push({dom:T,left:C.left,top:C.top})}}),l*=d,u*=d,c*=d,f*=d;var v=c-l,g=f-u,m=ui.createCanvas(),x=hI(m,{renderer:n?"svg":"canvas"});if(x.resize({width:v,height:g}),n){var _="";return B(h,function(b){var S=b.left-l,T=b.top-u;_+=''+b.dom+""}),x.painter.getSvgRoot().innerHTML=_,r.connectedBackgroundColor&&x.painter.setBackgroundColor(r.connectedBackgroundColor),x.refreshImmediately(),x.painter.toDataURL()}else return r.connectedBackgroundColor&&x.add(new Xe({shape:{x:0,y:0,width:v,height:g},style:{fill:r.connectedBackgroundColor}})),B(h,function(b){var S=new Yr({style:{x:b.left*d-l,y:b.top*d-u,image:b.dom}});x.add(S)}),x.refreshImmediately(),m.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},t.prototype.convertToPixel=function(r,n,i){return i_(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return i_(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return i_(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=dd(i,r);return B(o,function(s,l){l.indexOf("Models")>=0&&B(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[u.__viewId];f&&f.containPoint&&(a=a||f.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=dd(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?pj(s,l,n):_0(s,n)},t.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},t.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},t.prototype._initEvents=function(){var r=this;B(M4e,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&jc(l,function(g){var m=De(g);if(m&&m.dataIndex!=null){var x=m.dataModel||s.getSeriesByIndex(m.seriesIndex);return u=x&&x.getDataParams(m.dataIndex,m.dataType,l)||{},!0}else if(m.eventData)return u=ie({},m.eventData),!0},!0),u){var f=u.componentType,h=u.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=u.seriesIndex);var d=f&&h!=null&&s.getComponent(f,h),v=d&&r[d.mainType==="series"?"_chartsMap":"_componentsMap"][d.__viewId];u.event=o,u.type=i,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:d,view:v},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;B(UI,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),jze(n,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&wJ(this.getDom(),_j,"");var n=this,i=n._api,a=n._model;B(n._componentsViews,function(o){o.dispose(a,i)}),B(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete Yc[n.id]},t.prototype.resize=function(r){if(!this[Pr]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[Kr]&&(a==null&&(a=this[Kr].silent),i=!0,this[Kr]=null),this[Pr]=!0,hh(this);try{i&&nc(this),os.update.call(this,{type:"resize",animation:ie({duration:0},r&&r.animation)})}catch(o){throw this[Pr]=!1,o}this[Pr]=!1,ch.call(this,a),fh.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(ke(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!XI[r]){var i=XI[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(r){var n=ie({},r);return n.type=HI[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ke(n)||(n={silent:!!n}),!!kw[r.type]&&this._model){if(this[Pr]){this._pendingActions.push(r);return}var i=n.silent;H2.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&nt.browser.weChat&&this._throttledZrFlush(),ch.call(this,i),fh.call(this,i)}},t.prototype.updateLabelLayout=function(){La.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){nc=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),G2(f,!0),G2(f,!1),h.plan()},G2=function(f,h){for(var d=f._model,v=f._scheduler,g=h?f._componentsViews:f._chartsViews,m=h?f._componentsMap:f._chartsMap,x=f._zr,_=f._api,b=0;bh.get("hoverLayerThreshold")&&!nt.node&&!nt.worker&&h.eachSeries(function(m){if(!m.preventUsingHoverLayer){var x=f._chartsMap[m.__viewId];x.__alive&&x.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function s(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(v){v.isGroup||(v.style.blend=d)})}function l(f,h){if(!f.preventAutoZ){var d=pf(f);h.eachRendered(function(v){return GT(v,d.z,d.zlevel),!0})}}function u(f,h){h.eachRendered(function(d){if(!vd(d)){var v=d.getTextContent(),g=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(f,h){var d=f.getModel("stateAnimation"),v=f.isAnimationEnabled(),g=d.get("duration"),m=g>0?{duration:g,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(x){if(x.states&&x.states.emphasis){if(vd(x))return;if(x instanceof tt&&G5e(x),x.__dirty){var _=x.prevStates;_&&x.useStates(_)}if(v){x.stateTransition=m;var b=x.getTextContent(),S=x.getTextGuideLine();b&&(b.stateTransition=m),S&&(S.stateTransition=m)}x.__dirty&&a(x)}})}E6=function(f){return new(function(h){q(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(v){for(;v;){var g=v.__ecComponentInfo;if(g!=null)return f._model.getComponent(g.mainType,g.index);v=v.parent}},d.prototype.enterEmphasis=function(v,g){Gs(v,g),Gi(f)},d.prototype.leaveEmphasis=function(v,g){Ws(v,g),Gi(f)},d.prototype.enterBlur=function(v){$J(v),Gi(f)},d.prototype.leaveBlur=function(v){NN(v),Gi(f)},d.prototype.enterSelect=function(v){FJ(v),Gi(f)},d.prototype.leaveSelect=function(v){VJ(v),Gi(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(v){return f.getViewOfComponentModel(v)},d.prototype.getViewOfSeriesModel=function(v){return f.getViewOfSeriesModel(v)},d.prototype.getMainProcessVersion=function(){return f[r_]},d}($Q))(f)},Bee=function(f){function h(d,v){for(var g=0;g=0)){N6.push(r);var a=dee.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function Aj(e,t){XI[e]=t}function R4e(e){MK({createCanvas:e})}function Hee(e,t,r){var n=Aee("registerMap");n&&n(e,t,r)}function B4e(e){var t=Aee("getMap");return t&&t(e)}var Uee=ZBe;Pu(yj,xze);Pu(qT,_ze);Pu(qT,bze);Pu(yj,Dze);Pu(qT,Nze);Pu(Iee,u4e);Sj(VQ);Tj(g4e,MBe);Aj("default",wze);eo({type:Uc,event:Uc,update:Uc},sr);eo({type:cb,event:cb,update:cb},sr);eo({type:gw,event:EN,update:gw,action:sr,refineEvent:Mj,publishNonRefinedEvent:!0});eo({type:wI,event:EN,update:wI,action:sr,refineEvent:Mj,publishNonRefinedEvent:!0});eo({type:mw,event:EN,update:mw,action:sr,refineEvent:Mj,publishNonRefinedEvent:!0});function Mj(e,t,r,n){return{eventContent:{selected:B5e(r),isFromClick:t.isFromClick||!1}}}wj("default",{});wj("dark",mee);var z4e={},j6=[],$4e={registerPreprocessor:Sj,registerProcessor:Tj,registerPostInit:Fee,registerPostUpdate:Vee,registerUpdateLifecycle:KT,registerAction:eo,registerCoordinateSystem:Gee,registerLayout:Wee,registerVisual:Pu,registerTransform:Uee,registerLoading:Aj,registerMap:Hee,registerImpl:c4e,PRIORITY:Oee,ComponentModel:Ke,ComponentView:kt,SeriesModel:Tt,ChartView:bt,registerComponentModel:function(e){Ke.registerClass(e)},registerComponentView:function(e){kt.registerClass(e)},registerSeriesModel:function(e){Tt.registerClass(e)},registerChartView:function(e){bt.registerClass(e)},registerCustomSeries:function(e,t){Pee(e,t)},registerSubTypeDefaulter:function(e,t){Ke.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){lJ(e,t)}};function Ze(e){if(ae(e)){B(e,function(t){Ze(t)});return}We(j6,e)>=0||(j6.push(e),Ce(e)&&(e={install:e}),e.install($4e))}function Hp(e){return e==null?0:e.length||1}function R6(e){return e}var Hs=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||R6,this._newKeyGetter=i||R6,this.context=a,this._diffModeMultiple=o==="multiple"}return e.prototype.add=function(t){return this._add=t,this},e.prototype.update=function(t){return this._update=t,this},e.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},e.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},e.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},e.prototype.remove=function(t){return this._remove=t,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var t=this._old,r=this._new,n={},i=new Array(t.length),a=new Array(r.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var o=0;o1){var c=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(c,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},e.prototype._executeMultiple=function(){var t=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(t,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&h===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(f===1&&h===1)this._update&&this._update(c,u),i[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(f>1)for(var d=0;d1)for(var s=0;s30}var Up=ke,ll=se,U4e=typeof Int32Array>"u"?Array:Int32Array,Z4e="e\0\0",B6=-1,Y4e=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],X4e=["_approximateExtent"],z6,o_,Zp,Yp,Y2,Xp,X2,En=function(){function e(t,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;Yee(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===Ni;if(l&&!i.pure)for(var u=[],c=t;c0},e.prototype.ensureUniqueItemVisual=function(t,r){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var a=i[r];return a==null&&(a=this.getVisual(r),ae(a)?a=a.slice():Up(a)&&(a=ie({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Up(r)?ie(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){Up(t)?ie(this._layout,t):this._layout[t]=r},e.prototype.getLayout=function(t){return this._layout[t]},e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},e.prototype.setItemLayout=function(t,r,n){this._itemLayouts[t]=n?ie(this._itemLayouts[t]||{},r):r},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(t,r){var n=this.hostModel&&this.hostModel.seriesIndex;bI(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){B(this._graphicEls,function(n,i){n&&t&&t.call(r,n,i)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:ll(this.dimensions,this._getDimInfo,this),this.hostModel)),Y2(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Ce(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(MT(arguments)))})},e.internalField=function(){z6=function(t){var r=t._invertedIndicesMap;B(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new U4e(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function q4e(e,t){return Jv(e,t).dimensions}function Jv(e,t){fj(e)||(e=hj(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=_e(),a=[],o=J4e(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Kee(o),l=n===e.dimensionsDefine,u=l?qee(e):Xee(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var f=_e(c),h=new QQ(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function J4e(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return B(t,function(a){var o;ke(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function Q4e(e,t,r){if(r||t.hasKey(e)){for(var n=0;t.hasKey(e+n);)n++;e+=n}return t.set(e,!0),e}var e$e=function(){function e(t){this.coordSysDims=[],this.axisMap=_e(),this.categoryAxisMap=_e(),this.coordSysName=t}return e}();function t$e(e){var t=e.get("coordinateSystem"),r=new e$e(t),n=r$e[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var r$e={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",er).models[0],a=e.getReferringComponents("yAxis",er).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),dh(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),dh(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",er).models[0];t.coordSysDims=["single"],r.set("single",i),dh(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",er).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),dh(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),dh(o)&&(n.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(e,t,r,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,r,n){var i=e.ecModel,a=i.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();B(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),dh(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",er).models[0];t.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),o=i.getDimensionModel("y");r.set("x",a),r.set("y",o),n.set("x",a),n.set("y",o)}};function dh(e){return e.get("type")==="category"}function Jee(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;n$e(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,f,h;if(B(a,function(_,b){pe(_)&&(a[b]=_={name:_}),l&&!_.isExtraCoord&&(!n&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!i||i===_.coordDim)&&(c=_))}),c&&!n&&!u&&(n=!0),c){f="__\0ecstackresult_"+e.id,h="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,v=c.type,g=0;B(a,function(_){_.coordDim===d&&g++});var m={name:f,coordDim:d,coordDimIndex:g,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},x={name:h,coordDim:h,coordDimIndex:g+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(m.storeDimIndex=s.ensureCalculationDimension(h,v),x.storeDimIndex=s.ensureCalculationDimension(f,v)),o.appendCalculationDimension(m),o.appendCalculationDimension(x)):(a.push(m),a.push(x))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function n$e(e){return!Yee(e.schema)}function Us(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function Pj(e,t){return Us(e,t)?e.getCalculationInfo("stackResultDimension"):t}function i$e(e,t){var r=e.get("coordinateSystem"),n=Yv.get(r),i;return t&&t.coordSysDims&&(i=se(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=Ow(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function a$e(e,t,r){var n,i;return r&&B(e,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(e[n].otherDims.itemName=0),n}function Jo(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=hj(e)):(i=n.getSource(),a=i.sourceFormat===Ni);var o=t$e(t),s=i$e(t,o),l=r.useEncodeDefaulter,u=Ce(l)?l:l?Fe(jQ,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=Jv(i,c),h=a$e(f.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(f),v=Jee(t,{schema:f,store:d}),g=new En(f,t);g.setCalculationInfo(v);var m=h!=null&&o$e(i)?function(x,_,b,S){return S===h?b:this.defaultDimValueGetter(x,_,b,S)}:null;return g.hasItemOption=!1,g.initData(a?i:d,null,m),g}function o$e(e){if(e.sourceFormat===Ni){var t=s$e(e.data||[]);return!ae(Bv(t))}}function s$e(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=Ly(o),l=a.niceTickExtent=[gr(Math.ceil(e[0]/o)*o,s),gr(Math.floor(e[1]/o)*o,s)];return u$e(l,e),a}function q2(e){var t=Math.pow(10,ET(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,gr(r*t)}function Ly(e){return za(e)+2}function $6(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function u$e(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),$6(e,0,t),$6(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function kj(e,t){return e>=t[0]&&e<=t[1]}var c$e=function(){function e(){this.normalize=F6,this.scale=V6}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=me(t.normalize,t),this.scale=me(t.scale,t)):(this.normalize=F6,this.scale=V6)},e}();function F6(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function V6(e,t){return e*(t[1]-t[0])+t[0]}function KI(e,t,r){var n=Math.log(e);return[Math.log(r?t[0]:Math.max(0,t[0]))/n,Math.log(r?t[1]:Math.max(0,t[1]))/n]}var ku=function(){function e(t){this._calculator=new c$e,this._setting=t||{},this._extent=[1/0,-1/0];var r=Sr();r&&(this._brkCtx=r.createScaleBreakContext(),this._brkCtx.update(this._extent))}return e.prototype.getSetting=function(t){return this._setting[t]},e.prototype._innerUnionExtent=function(t){var r=this._extent;this._innerSetExtent(t[0]r[1]?t[1]:r[1])},e.prototype.unionExtentFromData=function(t,r){this._innerUnionExtent(t.getApproximateExtent(r))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(t,r){this._innerSetExtent(t,r)},e.prototype._innerSetExtent=function(t,r){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(r)||(n[1]=r),this._brkCtx&&this._brkCtx.update(n)},e.prototype.setBreaksFromOption=function(t){var r=Sr();r&&this._innerSetBreak(r.parseAxisBreakOption(t,me(this.parse,this)))},e.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},e.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},e.prototype.hasBreaks=function(){return this._brkCtx?this._brkCtx.hasBreaks():!1},e.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},e.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(t){this._isBlank=t},e}();DT(ku);var f$e=0,Iy=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++f$e,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&se(n,h$e);return new e({categories:i,needCollect:!i,deduplication:r.dedplication!==!1})},e.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},e.prototype.parseAndCollect=function(t){var r,n=this._needCollect;if(!pe(t)&&!n)return t;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=t,this._onCollect&&this._onCollect(t,r),r;var i=this._getOrCreateMap();return r=i.get(t),r==null&&(n?(r=this.categories.length,this.categories[r]=t,i.set(t,r),this._onCollect&&this._onCollect(t,r)):r=NaN),r},e.prototype._getOrCreateMap=function(){return this._map||(this._map=_e(this.categories))},e}();function h$e(e){return ke(e)&&e.value!=null?e.value:e+""}var av=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new Iy({})),ae(i)&&(i=new Iy({categories:se(i,function(a){return ke(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return t.prototype.parse=function(r){return r==null?NaN:pe(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return kj(r,this._extent)&&r>=0&&r=0&&r=0&&r=r},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(ku);ku.registerClass(av);var ul=gr,Zs=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return t.prototype.parse=function(r){return r==null||r===""?NaN:Number(r)},t.prototype.contain=function(r){return kj(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=Ly(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=Sr(),l=[];if(!n)return l;if(r.breakTicks==="only_break"&&s)return s.addBreaksToTicks(l,this._brkCtx.breaks,this._extent),l;var u=1e4;i[0]=0&&(f=ul(f+h*n,o))}if(l.length>0&&f===l[l.length-1].value)break;if(l.length>u)return[]}var d=l.length?l[l.length-1].value:a[1];return i[1]>d&&(r.expandToNicedExtent?l.push({value:ul(d+n,o)}):l.push({value:i[1]})),s&&s.pruneTicksByBreak(r.pruneByBreak,l,this._brkCtx.breaks,function(v){return v.value},this._interval,this._extent),r.breakTicks!=="none"&&s&&s.addBreaksToTicks(l,this._brkCtx.breaks,this._extent),l},t.prototype.getMinorTicks=function(r){for(var n=this.getTicks({expandToNicedExtent:!0}),i=[],a=this.getExtent(),o=1;oa[0]&&v0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function rte(e){var t=p$e(e),r=[];return B(e,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],c=Math.abs(o[1]-o[0]),f=a.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=u?c/h*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var v=ve(n.get("barWidth"),s),g=ve(n.get("barMaxWidth"),s),m=ve(n.get("barMinWidth")||(ste(n)?.5:1),s),x=n.get("barGap"),_=n.get("barCategoryGap"),b=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:v,barMaxWidth:g,barMinWidth:m,barGap:x,barCategoryGap:_,defaultBarGap:b,axisKey:Lj(a),stackId:ete(n)})}),nte(r)}function nte(e){var t={};B(e,function(n,i){var a=n.axisKey,o=n.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:n.defaultBarGap||0,stacks:{}},l=s.stacks;t[a]=s;var u=n.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=n.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var f=n.barMaxWidth;f&&(l[u].maxWidth=f);var h=n.barMinWidth;h&&(l[u].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var v=n.barCategoryGap;v!=null&&(s.categoryGap=v)});var r={};return B(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=it(a).length;s=Math.max(35-l*4,15)+"%"}var u=ve(s,o),c=ve(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-u)/(h+(h-1)*c);d=Math.max(d,0),B(a,function(x){var _=x.maxWidth,b=x.minWidth;if(x.width){var S=x.width;_&&(S=Math.min(S,_)),b&&(S=Math.max(S,b)),x.width=S,f-=S+c*S,h--}else{var S=d;_&&_S&&(S=b),S!==d&&(x.width=S,f-=S+c*S,h--)}}),d=(f-u)/(h+(h-1)*c),d=Math.max(d,0);var v=0,g;B(a,function(x,_){x.width||(x.width=d),g=x,v+=x.width*(1+c)}),g&&(v-=g.width*c);var m=-v/2;B(a,function(x,_){r[i][_]=r[i][_]||{bandWidth:o,offset:m,width:x.width},m+=x.width*(1+c)})}),r}function g$e(e,t,r){if(e&&t){var n=e[Lj(t)];return n}}function ite(e,t){var r=tte(e,t),n=rte(r);B(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=ete(i),u=n[Lj(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function ate(e){return{seriesType:e,plan:Xv(),reset:function(t){if(ote(t)){var r=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(i.dim)),l=t.get("showBackground",!0),u=r.mapDimension(a.dim),c=r.getCalculationInfo("stackResultDimension"),f=Us(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),d=m$e(i,a),v=ste(t),g=t.get("barMinHeight")||0,m=c&&r.getDimensionIndex(c),x=r.getLayout("size"),_=r.getLayout("offset");return{progress:function(b,S){for(var T=b.count,C=v&&Ao(T*3),A=v&&l&&Ao(T*3),P=v&&Ao(T),I=n.master.getRect(),k=h?I.width:I.height,E,D=S.getStore(),N=0;(E=b.next())!=null;){var z=D.get(f?m:o,E),F=D.get(s,E),$=d,Z=void 0;f&&(Z=+z-D.get(o,E));var j=void 0,U=void 0,G=void 0,V=void 0;if(h){var Y=n.dataToPoint([z,F]);if(f){var K=n.dataToPoint([Z,F]);$=K[0]}j=$,U=Y[1]+_,G=Y[0]-$,V=x,Math.abs(G)0?r:1:r))}var y$e=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=s_.length,s=Math.min(y$e(s_,this._approxInterval,0,o),o-1);this._interval=s_[s][1],this._intervalPrecision=Ly(this._interval),this._minLevelUnit=s_[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return ot(r)?r:+qo(r)},t.prototype.contain=function(r){return kj(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.type="time",t}(Zs),s_=[["second",XN],["minute",qN],["hour",rm],["quarter-day",rm*6],["half-day",rm*12],["day",ta*1.2],["half-week",ta*3.5],["week",ta*7],["month",ta*31],["quarter",ta*95],["half-year",OV/2],["year",OV]];function lte(e,t,r,n){return bw(new Date(t),e,n).getTime()===bw(new Date(r),e,n).getTime()}function x$e(e,t){return e/=ta,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function _$e(e){var t=30*ta;return e/=t,e>6?6:e>3?3:e>2?2:1}function b$e(e){return e/=rm,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function G6(e,t){return e/=t?qN:XN,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function w$e(e){return TN(e,!0)}function S$e(e,t,r){var n=Math.max(0,We(xi,t)-1);return bw(new Date(e),xi[n],r).getTime()}function T$e(e,t){var r=new Date(0);r[e](1);var n=r.getTime();r[e](1+t);var i=r.getTime()-n;return function(a,o){return Math.max(0,Math.round((o-a)/i))}}function C$e(e,t,r,n,i,a){var o=1e4,s=R3e,l=0;function u(N,z,F,$,Z,j,U){for(var G=T$e(Z,N),V=z,Y=new Date(V);Vo));)if(Y[Z](Y[$]()+N),V=Y.getTime(),a){var K=a.calcNiceTickMultiple(V,G);K>0&&(Y[Z](Y[$]()+K*N),V=Y.getTime())}U.push({value:V,notAdd:!0})}function c(N,z,F){var $=[],Z=!z.length;if(!lte(nm(N),n[0],n[1],r)){Z&&(z=[{value:S$e(n[0],N,r)},{value:n[1]}]);for(var j=0;j=n[0]&&U<=n[1]&&u(V,U,G,Y,K,ee,$),N==="year"&&F.length>1&&j===0&&F.unshift({value:F[0].value-V})}}for(var j=0;j<$.length;j++)F.push($[j])}}for(var f=[],h=[],d=0,v=0,g=0;g=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&v>T/1.5||(f.push(_),d>T||e===s[g]))break}h=[]}}}for(var C=ht(se(f,function(N){return ht(N,function(z){return z.value>=n[0]&&z.value<=n[1]&&!z.notAdd})}),function(N){return N.length>0}),A=[],P=C.length-1,g=0;g0;)a*=10;var s=[QI(M$e(n[0]/a)*a),QI(A$e(n[1]/a)*a)];this._interval=a,this._intervalPrecision=Ly(a),this._niceExtent=s}},t.prototype.calcNiceExtent=function(r){e.prototype.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},t.prototype.contain=function(r){return r=u_(r)/u_(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=u_(r)/u_(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),l_(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=Sr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,me(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(Zs);function c_(e,t){return QI(e,za(t))}ku.registerClass(ute);var P$e=function(){function e(t,r,n){this._prepareParams(t,r,n)}return e.prototype._prepareParams=function(t,r,n){n[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:f}},e.prototype.modifyDataMinMax=function(t,r){this[L$e[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=k$e[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),k$e={min:"_determinedMin",max:"_determinedMax"},L$e={min:"_dataMin",max:"_dataMax"};function cte(e,t,r){var n=e.rawExtentInfo;return n||(n=new P$e(e,t,r),e.rawExtentInfo=n,n)}function f_(e,t){return t==null?null:gn(t)?NaN:e.parse(t)}function fte(e,t){var r=e.type,n=cte(e,t,e.getExtent()).calculate();e.setBlank(n.isBlank);var i=n.min,a=n.max,o=t.ecModel;if(o&&r==="time"){var s=tte("bar",o),l=!1;if(B(s,function(f){l=l||f.getBaseAxis()===t.axis}),l){var u=rte(s),c=I$e(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function I$e(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=g$e(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;B(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;B(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,f=1-(s+l)/a,h=c/f-c;return t+=h*(l/u),e-=h*(s/u),{min:e,max:t}}function mf(e,t){var r=t,n=fte(e,r),i=n.extent,a=r.get("splitNumber");e instanceof ute&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(dte(r)),e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&e.setInterval&&e.setInterval(s)}function b0(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new av({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new Ij({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(ku.getClass(t)||Zs)}}function O$e(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function Qv(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=B3e(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(pe(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Ce(t)){if(e.type==="category")return function(i,a){return t(Ew(e,i),i.value-e.scale.getExtent()[0],null)};var n=Sr();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(Ew(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function Ew(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function Oj(e){var t=e.get("interval");return t??"auto"}function hte(e){return e.type==="category"&&Oj(e.getLabelModel())===0}function Dw(e,t){var r={};return B(e.mapDimensionsAll(t),function(n){r[Pj(e,n)]=!0}),it(r)}function E$e(e,t,r){t&&B(Dw(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function ov(e){return e==="middle"||e==="center"}function Oy(e){return e.getShallow("show")}function dte(e){var t=e.get("breaks",!0);if(t!=null)return!Sr()||!D$e(e.axis)?void 0:t}function D$e(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var ep=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function N$e(e){return Jo(null,e)}var j$e={isDimensionStacked:Us,enableDataStack:Jee,getStackedDimension:Pj};function R$e(e,t){var r=t;t instanceof et||(r=new et(t));var n=b0(r);return n.setExtent(e[0],e[1]),mf(n,r),n}function B$e(e){cr(e,ep)}function z$e(e,t){return t=t||{},Mt(e,null,null,t.state!=="normal")}const $$e=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:q4e,createList:N$e,createScale:R$e,createSymbol:xr,createTextStyle:z$e,dataStack:j$e,enableHoverEmphasis:Kl,getECData:De,getLayoutRect:zt,mixinAxisModelCommonMethods:B$e},Symbol.toStringTag,{value:"Module"}));var F$e=1e-8;function W6(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return G$e(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},t.prototype.getBoundingRect=function(r){var n=this._rect;if(n&&!r)return n;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return B(o,function(s){s.type==="polygon"?H6(s.exterior,i,a,r):B(s.points,function(l){H6(l,i,a,r)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new Oe(i[0],i[1],a[0]-i[0],a[1]-i[1]),r||(this._rect=n),n},t.prototype.contain=function(r){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(r[0],r[1]))return!1;e:for(var a=0,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/r,l/r])}return n}function eO(e,t){return e=H$e(e),se(ht(e.features,function(r){return r.geometry&&r.properties&&r.geometry.coordinates.length>0}),function(r){var n=r.properties,i=r.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new U6(o[0],o.slice(1)));break;case"MultiPolygon":B(i.coordinates,function(l){l[0]&&a.push(new U6(l[0],l.slice(1)))});break;case"LineString":a.push(new Z6([i.coordinates]));break;case"MultiLineString":a.push(new Z6(i.coordinates))}var s=new pte(n[t||"name"],a,n.cp);return s.properties=n,s})}const U$e=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:vI,asc:Ai,getPercentWithPrecision:fRe,getPixelPrecision:wN,getPrecision:za,getPrecisionSafe:hJ,isNumeric:CN,isRadianAroundZero:Qd,linearMap:gt,nice:TN,numericToNumber:Go,parseDate:qo,parsePercent:ve,quantile:ub,quantity:vJ,quantityExponent:ET,reformIntervals:pI,remRadian:SN,round:gr},Symbol.toStringTag,{value:"Module"})),Z$e=Object.freeze(Object.defineProperty({__proto__:null,format:y0,parse:qo,roundTime:bw},Symbol.toStringTag,{value:"Module"})),Y$e=Object.freeze(Object.defineProperty({__proto__:null,Arc:p0,BezierCurve:Vv,BoundingRect:Oe,Circle:Ko,CompoundPath:g0,Ellipse:v0,Group:Me,Image:Yr,IncrementalDisplayable:eQ,Line:mr,LinearGradient:Lf,Polygon:bn,Polyline:an,RadialGradient:BN,Rect:Xe,Ring:Fv,Sector:_n,Text:at,clipPointsByRect:VN,clipRectByRect:aQ,createIcon:Wv,extendPath:nQ,extendShape:rQ,getShapeClass:Sy,getTransform:Jl,initProps:Dt,makeImage:$N,makePath:tv,mergePath:Si,registerShape:_a,resizePath:FN,updateProps:lt},Symbol.toStringTag,{value:"Module"})),X$e=Object.freeze(Object.defineProperty({__proto__:null,addCommas:nj,capitalFirst:Z3e,encodeHTML:In,formatTime:U3e,formatTpl:aj,getTextRect:W3e,getTooltipMarker:wQ,normalizeCssArray:Zv,toCamelCase:ij,truncateText:WRe},Symbol.toStringTag,{value:"Module"})),q$e=Object.freeze(Object.defineProperty({__proto__:null,bind:me,clone:Ae,curry:Fe,defaults:Pe,each:B,extend:ie,filter:ht,indexOf:We,inherits:vN,isArray:ae,isFunction:Ce,isObject:ke,isString:pe,map:se,merge:He,reduce:da},Symbol.toStringTag,{value:"Module"}));var K$e=Je(),am=Je(),Ka={estimate:1,determine:2};function Nw(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function mte(e,t){var r=se(t,function(n){return e.scale.parse(n)});return e.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function J$e(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=Qv(e),i=e.scale.getExtent(),a=mte(e,r),o=ht(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:se(o,function(s){var l={value:s};return{formattedLabel:n(l),rawLabel:e.scale.getLabel(l),tickValue:s,time:void 0,break:void 0}})}}return e.type==="category"?eFe(e,t):rFe(e)}function Q$e(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=mte(e,n);return{ticks:ht(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?tFe(e,t):{ticks:se(e.scale.getTicks(r),function(o){return o.value})}}function eFe(e,t){var r=e.getLabelModel(),n=yte(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function yte(e,t,r){var n=iFe(e),i=Oj(t),a=r.kind===Ka.estimate;if(!a){var o=_te(n,i);if(o)return o}var s,l;Ce(i)?s=Ste(e,i):(l=i==="auto"?aFe(e,r):i,s=wte(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return tO(n,i,u),!0}):tO(n,i,u),u}function tFe(e,t){var r=nFe(e),n=Oj(t),i=_te(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Ce(n))a=Ste(e,n,!0);else if(n==="auto"){var s=yte(e,e.getLabelModel(),Nw(Ka.determine));o=s.labelCategoryInterval,a=se(s.labels,function(l){return l.tickValue})}else o=n,a=wte(e,o,!0);return tO(r,n,{ticks:a,tickCategoryInterval:o})}function rFe(e){var t=e.scale.getTicks(),r=Qv(e);return{labels:se(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var nFe=xte("axisTick"),iFe=xte("axisLabel");function xte(e){return function(r){return am(r)[e]||(am(r)[e]={list:[]})}}function _te(e,t){for(var r=0;rc&&(u=Math.max(1,Math.floor(l/c)));for(var f=s[0],h=e.dataToCoord(f+1)-e.dataToCoord(f),d=Math.abs(h*Math.cos(a)),v=Math.abs(h*Math.sin(a)),g=0,m=0;f<=s[1];f+=u){var x=0,_=0,b=IT(i({value:f}),n.font,"center","top");x=b.width*1.3,_=b.height*1.3,g=Math.max(g,x,7),m=Math.max(m,_,7)}var S=g/d,T=m/v;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var C=Math.max(0,Math.floor(Math.min(S,T)));if(r===Ka.estimate)return t.out.noPxChangeTryDetermine.push(me(sFe,null,e,C,l)),C;var A=bte(e,C,l);return A??C}function sFe(e,t,r){return bte(e,t,r)==null}function bte(e,t,r){var n=K$e(e.model),i=e.getExtent(),a=n.lastAutoInterval,o=n.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-r)<=1&&a>t&&n.axisExtent0===i[0]&&n.axisExtent1===i[1])return a;n.lastTickCount=r,n.lastAutoInterval=t,n.axisExtent0=i[0],n.axisExtent1=i[1]}function lFe(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function wte(e,t,r){var n=Qv(e),i=e.scale,a=i.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],c=i.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var f=hte(e),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&u!==a[0]&&g(a[0]);for(var v=u;v<=a[1];v+=l)g(v);d&&v-l!==a[1]&&g(a[1]);function g(m){var x={value:m};s.push(r?m:{formattedLabel:n(x),rawLabel:i.getLabel(x),tickValue:m,time:void 0,break:void 0})}return s}function Ste(e,t,r){var n=e.scale,i=Qv(e),a=[];return B(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;t(o.value,s)&&a.push(r?l:{formattedLabel:i(o),rawLabel:s,tickValue:l,time:void 0,break:void 0})}),a}var Y6=[0,1],ba=function(){function e(t,r,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=r,this._extent=n||[0,0]}return e.prototype.contain=function(t){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return t>=n&&t<=i},e.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(t){return wN(t||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(t,r){var n=this._extent;n[0]=t,n[1]=r},e.prototype.dataToCoord=function(t,r){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&i.type==="ordinal"&&(n=n.slice(),X6(n,i.count())),gt(t,Y6,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),X6(n,i.count()));var a=gt(t,n,Y6,r);return this.scale.scale(a)},e.prototype.pointToData=function(t,r){},e.prototype.getTicksCoords=function(t){t=t||{};var r=t.tickModel||this.getTickModel(),n=Q$e(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=se(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return uFe(this,a,o,t.clamp),a},e.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),r=t.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=se(n,function(a){return se(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||Nw(Ka.determine),J$e(this,t).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var t=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},e.prototype.calculateCategoryInterval=function(t){return t=t||Nw(Ka.determine),oFe(this,t)},e}();function X6(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function uFe(e,t,r,n){var i=t.length;if(!e.onBand||r||!i)return;var a=e.getExtent(),o,s;if(i===1)t[0].coord=a[0],t[0].onBand=!0,o=t[1]={coord:a[1],tickValue:t[0].tickValue,onBand:!0};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;B(t,function(d){d.coord-=u/2,d.onBand=!0});var c=e.scale.getExtent();s=1+c[1]-t[i-1].tickValue,o={coord:t[i-1].coord+u*s,tickValue:c[1]+1,onBand:!0},t.push(o)}var f=a[0]>a[1];h(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&h(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),h(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&h(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function h(d,v){return d=gr(d),v=gr(v),f?d>v:di&&(i+=qp);var d=Math.atan2(s,o);if(d<0&&(d+=qp),d>=n&&d<=i||d+qp>=n&&d+qp<=i)return l[0]=c,l[1]=f,u-r;var v=r*Math.cos(n)+e,g=r*Math.sin(n)+t,m=r*Math.cos(i)+e,x=r*Math.sin(i)+t,_=(v-o)*(v-o)+(g-s)*(g-s),b=(m-o)*(m-o)+(x-s)*(x-s);return _0){t=t/180*Math.PI,$a.fromArray(e[0]),Ot.fromArray(e[1]),dr.fromArray(e[2]),Ie.sub(Mo,$a,Ot),Ie.sub(bo,dr,Ot);var r=Mo.len(),n=bo.len();if(!(r<.001||n<.001)){Mo.scale(1/r),bo.scale(1/n);var i=Mo.dot(bo),a=Math.cos(t);if(a1&&Ie.copy(Fn,dr),Fn.toArray(e[1])}}}}function xFe(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,$a.fromArray(e[0]),Ot.fromArray(e[1]),dr.fromArray(e[2]),Ie.sub(Mo,Ot,$a),Ie.sub(bo,dr,Ot);var n=Mo.len(),i=bo.len();if(!(n<.001||i<.001)){Mo.scale(1/n),bo.scale(1/i);var a=Mo.dot(t),o=Math.cos(r);if(a=l)Ie.copy(Fn,dr);else{Fn.scaleAndAdd(bo,s/Math.tan(Math.PI/2-c));var f=dr.x!==Ot.x?(Fn.x-Ot.x)/(dr.x-Ot.x):(Fn.y-Ot.y)/(dr.y-Ot.y);if(isNaN(f))return;f<0?Ie.copy(Fn,Ot):f>1&&Ie.copy(Fn,dr)}Fn.toArray(e[1])}}}}function Q2(e,t,r,n){var i=r==="normal",a=i?e:e.ensureState(r);a.ignore=t;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=n.getModel("lineStyle").getLineStyle();i?e.useStyle(s):a.style=s}function _Fe(e,t){var r=t.smooth,n=t.points;if(n)if(e.moveTo(n[0][0],n[0][1]),r>0&&n.length>=3){var i=xs(n[0],n[1]),a=xs(n[1],n[2]);if(!i||!a){e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*r,s=Xg([],n[1],n[0],o/i),l=Xg([],n[1],n[2],o/a),u=Xg([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var c=1;c0){S(k*I,0,a);var E=k+A;E<0&&T(-E*I,1)}else T(-A*I,1)}}function S(A,P,I){A!==0&&(c=!0);for(var k=P;k0)for(var E=0;E0;E--){var F=I[E-1]*z;S(-F,E,a)}}}function C(A){var P=A<0?-1:1;A=Math.abs(A);for(var I=Math.ceil(A/(a-1)),k=0;k0?S(I,0,k+1):S(-I,a-k-1,a),A-=I,A<=0)return}return c}function SFe(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),We(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),lt(n,u,r,l)}else if(n.attr(u),!Hv(n).valueAnimation){var f=be(n.style.opacity,1);n.style.opacity=0,Dt(n,{style:{opacity:f}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};h_(d,u,d_),h_(d,n.states.select,d_)}if(n.states.emphasis){var v=a.oldLayoutEmphasis={};h_(v,u,d_),h_(v,n.states.emphasis,d_)}fQ(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=AFe(i),o=a.oldLayout,g={points:i.shape.points};o?(i.attr({shape:o}),lt(i,{shape:g},r)):(i.setShape(g),i.style.strokePercent=0,Dt(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},e}(),rM=Je();function PFe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=rM(r).labelManager;i||(i=rM(r).labelManager=new MFe),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=rM(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var nM=Math.sin,iM=Math.cos,Lte=Math.PI,ac=Math.PI*2,kFe=180/Lte,Ite=function(){function e(){}return e.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},e.prototype.moveTo=function(t,r){this._add("M",t,r)},e.prototype.lineTo=function(t,r){this._add("L",t,r)},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){this._add("C",t,r,n,i,a,o)},e.prototype.quadraticCurveTo=function(t,r,n,i){this._add("Q",t,r,n,i)},e.prototype.arc=function(t,r,n,i,a,o){this.ellipse(t,r,n,n,0,i,a,o)},e.prototype.ellipse=function(t,r,n,i,a,o,s,l){var u=s-o,c=!l,f=Math.abs(u),h=Dl(f-ac)||(c?u>=ac:-u>=ac),d=u>0?u%ac:u%ac+ac,v=!1;h?v=!0:Dl(f)?v=!1:v=d>=Lte==!!c;var g=t+n*iM(o),m=r+i*nM(o);this._start&&this._add("M",g,m);var x=Math.round(a*kFe);if(h){var _=1/this._p,b=(c?1:-1)*(ac-_);this._add("A",n,i,x,1,+c,t+n*iM(o+b),r+i*nM(o+b)),_>.01&&this._add("A",n,i,x,0,+c,g,m)}else{var S=t+n*iM(s),T=r+i*nM(s);this._add("A",n,i,x,+v,+c,S,T)}},e.prototype.rect=function(t,r,n,i){this._add("M",t,r),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(t,r,n,i,a,o,s,l,u){for(var c=[],f=this._p,h=1;h"}function BFe(e){return""}function jj(e,t){t=t||{};var r=t.newline?` +`:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return RFe(o,s)+(o!=="style"?In(l):l||"")+(a?""+r+se(a,function(u){return n(u)}).join(r)+r:"")+BFe(o)}return n(e)}function zFe(e,t,r){r=r||{};var n=r.newline?` +`:"",i=" {"+n,a=n+"}",o=se(it(e),function(l){return l+i+se(it(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=se(it(t),function(l){return"@keyframes "+l+i+se(it(t[l]),function(u){return u+i+se(it(t[l][u]),function(c){var f=t[l][u][c];return c==="d"&&(f='path("'+f+'")'),c+":"+f+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function oO(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function tG(e,t,r,n){return Gr("svg","root",{width:e,height:t,xmlns:Ote,"xmlns:xlink":Ete,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var $Fe=0;function Nte(){return $Fe++}var rG={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},dc="transform-origin";function FFe(e,t,r){var n=ie({},e.shape);ie(n,t),e.buildPath(r,n);var i=new Ite;return i.reset(tJ(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function VFe(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[dc]=r+"px "+n+"px")}var GFe={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function jte(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function WFe(e,t,r){var n=e.shape.paths,i={},a,o;if(B(n,function(l){var u=oO(r.zrId);u.animation=!0,QT(l,{},u,!0);var c=u.cssAnims,f=u.cssNodes,h=it(c),d=h.length;if(d){o=h[d-1];var v=c[o];for(var g in v){var m=v[g];i[g]=i[g]||{d:""},i[g].d+=m.d||""}for(var x in f){var _=f[x].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){t.d=!1;var s=jte(i,r);return a.replace(o,s)}}function nG(e){return pe(e)?rG[e]?"cubic-bezier("+rG[e]+")":yN(e)?e:"":""}function QT(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof g0){var s=WFe(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Re=jte(A,r);return Re+" "+_[0]+" both"}}for(var m in l){var s=g(l[m]);s&&o.push(s)}if(o.length){var x=r.zrId+"-cls-"+Nte();r.cssNodes["."+x]={animation:o.join(",")},t.class=x}}function HFe(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};iG(n,t,r)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,l=e.currentStates.indexOf("select")>=0&&s||o;l&&(a=uw(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&e.transform?e.transform[0]:1;u=u/c}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),iG(n,t,r)}}function iG(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+Nte(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var Ey=Math.round;function Rte(e){return e&&pe(e.src)}function Bte(e){return e&&Ce(e.toDataURL)}function Rj(e,t,r,n){DFe(function(i,a){var o=i==="fill"||i==="stroke";o&&eJ(a)?$te(t,e,i,n):o&&_N(a)?Fte(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),JFe(r,e,n)}function Bj(e,t){var r=uJ(t);r&&(r.each(function(n,i){n!=null&&(e[(eG+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[eG+"silent"]="true"))}function aG(e){return Dl(e[0]-1)&&Dl(e[1])&&Dl(e[2])&&Dl(e[3]-1)}function UFe(e){return Dl(e[4])&&Dl(e[5])}function zj(e,t,r){if(t&&!(UFe(t)&&aG(t))){var n=1e4;e.transform=aG(t)?"translate("+Ey(t[4]*n)/n+" "+Ey(t[5]*n)/n+")":Mje(t)}}function oG(e,t,r){for(var n=e.points,i=[],a=0;a"u"){var m="Image width/height must been given explictly in svg-ssr renderer.";xn(h,m),xn(d,m)}else if(h==null||d==null){var x=function(k,E){if(k){var D=k.elm,N=h||E.width,z=d||E.height;k.tag==="pattern"&&(u?(z=1,N/=a.width):c&&(N=1,z/=a.height)),k.attrs.width=N,k.attrs.height=z,D&&(D.setAttribute("width",N),D.setAttribute("height",z))}},_=kN(v,null,e,function(k){l||x(C,k),x(f,k)});_&&_.width&&_.height&&(h=h||_.width,d=d||_.height)}f=Gr("image","img",{href:v,width:h,height:d}),o.width=h,o.height=d}else i.svgElement&&(f=Ae(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(f){var b,S;l?b=S=1:u?(S=1,b=o.width/a.width):c?(b=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",b!=null&&!isNaN(b)&&(o.width=b),S!=null&&!isNaN(S)&&(o.height=S);var T=rJ(i);T&&(o.patternTransform=T);var C=Gr("pattern","",o,[f]),A=jj(C),P=n.patternCache,I=P[A];I||(I=n.zrId+"-p"+n.patternIdx++,P[A]=I,o.id=I,C=n.defs[I]=Gr("pattern",I,o,[f])),t[r]=LT(I)}}function QFe(e,t,r){var n=r.clipPathCache,i=r.defs,a=n[e.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[e.id]=a,i[a]=Gr("clipPath",a,o,[zte(e,r)])}t["clip-path"]=LT(a)}function uG(e){return document.createTextNode(e)}function _c(e,t,r){e.insertBefore(t,r)}function cG(e,t){e.removeChild(t)}function fG(e,t){e.appendChild(t)}function Vte(e){return e.parentNode}function Gte(e){return e.nextSibling}function aM(e,t){e.textContent=t}var hG=58,eVe=120,tVe=Gr("","");function sO(e){return e===void 0}function mo(e){return e!==void 0}function rVe(e,t,r){for(var n={},i=t;i<=r;++i){var a=e[i].key;a!==void 0&&(n[a]=i)}return n}function Ag(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function Dy(e){var t,r=e.children,n=e.tag;if(mo(n)){var i=e.elm=Dte(n);if($j(tVe,e),ae(r))for(t=0;ta?(v=r[l+1]==null?null:r[l+1].elm,Wte(e,v,r,i,l)):$w(e,t,n,a))}function Ph(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&($j(e,t),sO(t.text)?mo(n)&&mo(i)?n!==i&&nVe(r,n,i):mo(i)?(mo(e.text)&&aM(r,""),Wte(r,null,i,0,i.length-1)):mo(n)?$w(r,n,0,n.length-1):mo(e.text)&&aM(r,""):e.text!==t.text&&(mo(n)&&$w(r,n,0,n.length-1),aM(r,t.text)))}function iVe(e,t){if(Ag(e,t))Ph(e,t);else{var r=e.elm,n=Vte(r);Dy(t),n!==null&&(_c(n,t.elm,Gte(r)),$w(n,[e],0,0))}return t}var aVe=0,oVe=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=dG(),this.configLayer=dG(),this.storage=r,this._opts=n=ie({},n),this.root=t,this._id="zr"+aVe++,this._oldVNode=tG(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=Dte("svg");$j(null,this._oldVNode),i.appendChild(a),t.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",iVe(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return lG(t,oO(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=oO(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=sVe(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Gr("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=se(it(a.defs),function(h){return a.defs[h]});if(u.length&&o.push(Gr("defs","defs",{},u)),t.animation){var c=zFe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=Gr("style","stl",{},[],c);o.push(f)}}return tG(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},jj(this.renderToVNode({animation:be(t.cssAnimation,!0),emphasis:be(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:be(t.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(t,r,n){for(var i=t.length,a=[],o=0,s,l,u=0,c=0;c=0&&!(h&&l&&h[g]===l[g]);g--);for(var m=v-1;m>g;m--)o--,s=a[o-1];for(var x=g+1;x=s)}}for(var f=this.__startIndex;f15)break}}z.prevElClipPaths&&x.restore()};if(_)if(_.length===0)P=m.__endIndex;else for(var k=d.dpr,E=0;E<_.length;++E){var D=_[E];x.save(),x.beginPath(),x.rect(D.x*k,D.y*k,D.width*k,D.height*k),x.clip(),I(D),x.restore()}else x.save(),I(),x.restore();m.__drawIndex=P,m.__drawIndex0&&t>i[0]){for(l=0;lt);l++);s=n[i[l]]}if(i.splice(l+1,0,t),n[t]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},e.prototype.eachLayer=function(t,r){for(var n=this._zlevelList,i=0;i0?v_:0),this._needsManuallyCompositing),c.__builtin__||CT("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,r(l),a=c),i.__dirty&wi&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(t){t.clear()},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t,B(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var n=this._layerConfig;n[t]?He(n[t],r,!0):n[t]=r;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill=J.color.neutral00,u.style.lineWidth=2),n},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(Tt);function sv(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=nv(e,t,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(t[a])}return n.join(" ")}var w0=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return o.updateData(r,n,i,a),o}return t.prototype._createSymbol=function(r,n,i,a,o,s){this.removeAll();var l=xr(r,-1,-1,2,2,null,s);l.attr({z2:be(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=pVe,this._symbolType=r,this.add(l)},t.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Gs(this.childAt(0))},t.prototype.downplay=function(){Ws(this.childAt(0))},t.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},t.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},t.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=t.getSymbolSize(r,n),u=t.getSymbolZ2(r,n),c=o!==this._symbolType,f=a&&a.disableAnimation;if(c){var h=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,h)}else{var d=this.childAt(0);d.silent=!1;var v={scaleX:l[0]/2,scaleY:l[1]/2};f?d.attr(v):lt(d,v,s,n),ga(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!f){var v={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Dt(d,v,s,n)}}f&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,c,f,h,d,v,g,m,x;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,f=a.selectItemStyle,h=a.focus,d=a.blurScope,g=a.labelStatesModels,m=a.hoverScale,x=a.cursorStyle,v=a.emphasisDisabled),!a||r.hasItemOption){var _=a&&a.itemModel?a.itemModel:r.getItemModel(n),b=_.getModel("emphasis");u=b.getModel("itemStyle").getItemStyle(),f=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),v=b.get("disabled"),g=Nr(_),m=b.getShallow("scale"),x=_.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=Df(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),x&&s.attr("cursor",x);var C=r.getItemVisual(n,"style"),A=C.fill;if(s instanceof Yr){var P=s.style;s.useStyle(ie({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},C))}else s.__isEmptyBrush?s.useStyle(ie({},C)):s.useStyle(C),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var I=r.getItemVisual(n,"liftZ"),k=this._z2;I!=null?k==null&&(this._z2=s.z2,s.z2+=I):k!=null&&(s.z2=k,this._z2=null);var E=o&&o.useNameLabel;Ur(s,g,{labelFetcher:l,labelDataIndex:n,defaultText:D,inheritColor:A,defaultOpacity:C.opacity});function D(F){return E?r.getName(F):sv(r,F)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var N=s.ensureState("emphasis");N.style=u,s.ensureState("select").style=f,s.ensureState("blur").style=c;var z=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;N.scaleX=this._sizeX*z,N.scaleY=this._sizeY*z,this.setSymbolScale(1),Gt(this,h,d,v)},t.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},t.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),o=De(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&cu(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();cu(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return Kv(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Me);function pVe(e,t){this.parent.drift(e,t)}function sM(e,t,r,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&e.getItemVisual(r,"symbol")!=="none"}function gG(e){return e!=null&&!ke(e)&&(e={isIgnore:e}),e||{}}function mG(e){var t=e.hostModel,r=t.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Nr(t),cursorStyle:t.get("cursor")}}var S0=function(){function e(t){this.group=new Me,this._SymbolCtor=t||w0}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=gG(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=mG(t),u={disableAnimation:s},c=r.getSymbolPoint||function(f){return t.getItemLayout(f)};a||n.removeAll(),t.diff(a).add(function(f){var h=c(f);if(sM(t,h,f,r)){var d=new o(t,f,l,u);d.setPosition(h),t.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=a.getItemGraphicEl(h),v=c(f);if(!sM(t,v,f,r)){n.remove(d);return}var g=t.getItemVisual(f,"symbol")||"circle",m=d&&d.getSymbolType&&d.getSymbolType();if(!d||m&&m!==g)n.remove(d),d=new o(t,f,l,u),d.setPosition(v);else{d.updateData(t,f,l,u);var x={x:v[0],y:v[1]};s?d.attr(x):lt(d,x,i)}n.add(d),t.setItemGraphicEl(f,d)}).remove(function(f){var h=a.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},i)}).execute(),this._getSymbolPoint=c,this._data=t},e.prototype.updateLayout=function(){var t=this,r=this._data;r&&r.eachItemGraphicEl(function(n,i){var a=t._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=mG(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=gG(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a0?r=n[0]:n[1]<0&&(r=n[1]),r}function Zte(e,t,r,n){var i=NaN;e.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=r.get(e.baseDim,n),o[1-a]=i,t.dataToPoint(o)}function mVe(e,t){var r=[];return t.diff(e).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,i){r.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function yVe(e,t,r,n,i,a,o,s){for(var l=mVe(e,t),u=[],c=[],f=[],h=[],d=[],v=[],g=[],m=Ute(i,t,o),x=e.getLayout("points")||[],_=t.getLayout("points")||[],b=0;b=i||g<0)break;if(Xc(x,_)){if(l){g+=a;continue}break}if(g===r)e[a>0?"moveTo":"lineTo"](x,_),f=x,h=_;else{var b=x-u,S=_-c;if(b*b+S*S<.5){g+=a;continue}if(o>0){for(var T=g+a,C=t[T*2],A=t[T*2+1];C===x&&A===_&&m=n||Xc(C,A))d=x,v=_;else{k=C-u,E=A-c;var z=x-u,F=C-x,$=_-c,Z=A-_,j=void 0,U=void 0;if(s==="x"){j=Math.abs(z),U=Math.abs(F);var G=k>0?1:-1;d=x-G*j*o,v=_,D=x+G*U*o,N=_}else if(s==="y"){j=Math.abs($),U=Math.abs(Z);var V=E>0?1:-1;d=x,v=_-V*j*o,D=x,N=_+V*U*o}else j=Math.sqrt(z*z+$*$),U=Math.sqrt(F*F+Z*Z),I=U/(U+j),d=x-k*o*(1-I),v=_-E*o*(1-I),D=x+k*o*I,N=_+E*o*I,D=cl(D,fl(C,x)),N=cl(N,fl(A,_)),D=fl(D,cl(C,x)),N=fl(N,cl(A,_)),k=D-x,E=N-_,d=x-k*j/U,v=_-E*j/U,d=cl(d,fl(u,x)),v=cl(v,fl(c,_)),d=fl(d,cl(u,x)),v=fl(v,cl(c,_)),k=x-d,E=_-v,D=x+k*U/j,N=_+E*U/j}e.bezierCurveTo(f,h,d,v,x,_),f=D,h=N}else e.lineTo(x,_)}u=x,c=_,g+=a}return m}var Yte=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),xVe=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polyline",n}return t.prototype.getDefaultStyle=function(){return{stroke:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new Yte},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Xc(i[o*2-2],i[o*2-1]);o--);for(;a=0){var S=u?(v-l)*b+l:(d-s)*b+s;return u?[r,S]:[S,r]}s=d,l=v;break;case o.C:d=a[f++],v=a[f++],g=a[f++],m=a[f++],x=a[f++],_=a[f++];var T=u?sw(s,d,g,x,r,c):sw(l,v,m,_,r,c);if(T>0)for(var C=0;C=0){var S=u?$r(l,v,m,_,A):$r(s,d,g,x,A);return u?[r,S]:[S,r]}}s=x,l=_;break}}},t}(tt),_Ve=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Yte),Xte=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polygon",n}return t.prototype.getDefaultShape=function(){return new _Ve},t.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Xc(i[s*2-2],i[s*2-1]);s--);for(;ot){a?r.push(o(a,l,t)):i&&r.push(o(i,l,0),o(i,l,t));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function SVe(e,t,r){var n=e.getVisual("visualMeta");if(!(!n||!n.length||!e.count())&&t.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=e.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=t.getAxis(i),u=se(a.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),c=u.length,f=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),f.reverse());var h=wVe(u,i==="x"?r.getWidth():r.getHeight()),d=h.length;if(!d&&c)return u[0].coord<0?f[1]?f[1]:u[c-1].color:f[0]?f[0]:u[0].color;var v=10,g=h[0].coord-v,m=h[d-1].coord+v,x=m-g;if(x<.001)return"transparent";B(h,function(b){b.offset=(b.coord-g)/x}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var _=new Lf(0,0,0,0,h,!0);return _[i]=g,_[i+"2"]=m,_}}}function TVe(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&CVe(a,t))){var o=t.mapDimension(a.dim),s={};return B(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function CVe(e,t){var r=e.getExtent(),n=Math.abs(r[1]-r[0])/e.scale.count();isNaN(n)&&(n=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function AVe(e,t){return isNaN(e)||isNaN(t)}function MVe(e){for(var t=e.length/2;t>0&&AVe(e[t*2-2],e[t*2-1]);t--);return t-1}function wG(e,t){return[e[t*2],e[t*2+1]]}function PVe(e,t,r){for(var n=e.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function Jte(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var U=v.getState("emphasis").style;U.lineWidth=+v.style.lineWidth+1}De(v).seriesIndex=r.seriesIndex,Gt(v,$,Z,j);var G=bG(r.get("smooth")),V=r.get("smoothMonotone");if(v.setShape({smooth:G,smoothMonotone:V,connectNulls:A}),g){var Y=s.getCalculationInfo("stackedOnSeries"),K=0;g.useStyle(Pe(u.getAreaStyle(),{fill:D,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Y&&(K=bG(Y.get("smooth"))),g.setShape({smooth:G,stackedOnSmooth:K,smoothMonotone:V,connectNulls:A}),Dr(g,r,"areaStyle"),De(g).seriesIndex=r.seriesIndex,Gt(g,$,Z,j)}var ee=this._changePolyState;s.eachItemGraphicEl(function(le){le&&(le.onHoverStateChange=ee)}),this._polyline.onHoverStateChange=ee,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=k,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,v),g&&this.packEventData(r,g))},t.prototype.packEventData=function(r,n){De(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},t.prototype.highlight=function(r,n,i,a){var o=r.getData(),s=ff(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],f=l[s*2+1];if(isNaN(c)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,f))return;var h=r.get("zlevel")||0,d=r.get("z")||0;u=new w0(o,s),u.x=c,u.y=f,u.setZ(h,d);var v=u.getSymbolPath().getTextContent();v&&(v.zlevel=h,v.z=d,v.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else bt.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=ff(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else bt.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;yw(this._polyline,r),n&&yw(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new xVe({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},t.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new Xte({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},t.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,c=u.get("animationDuration");Ce(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=Ce(f)?f(null):f;r.eachItemGraphicEl(function(d,v){var g=d;if(g){var m=[d.x,d.y],x=void 0,_=void 0,b=void 0;if(i)if(o){var S=i,T=n.pointToCoord(m);a?(x=S.startAngle,_=S.endAngle,b=-T[1]/180*Math.PI):(x=S.r0,_=S.r,b=T[0])}else{var C=i;a?(x=C.x,_=C.x+C.width,b=d.x):(x=C.y+C.height,_=C.y,b=d.y)}var A=_===x?0:(b-x)/(_-x);l&&(A=1-A);var P=Ce(f)?f(v):c*A+h,I=g.getSymbolPath(),k=I.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),k&&k.animateFrom({style:{opacity:0}},{duration:300,delay:P}),I.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(Jte(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new at({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=MVe(l);c>=0&&(Ur(s,Nr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(f,h,d){return d!=null?Hte(o,d):sv(o,f)},enableTextSetter:!0},kVe(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(r,n,i,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var f=i.getLayout("points"),h=i.hostModel,d=h.get("connectNulls"),v=s.get("precision"),g=s.get("distance")||0,m=l.getBaseAxis(),x=m.isHorizontal(),_=m.inverse,b=n.shape,S=_?x?b.x:b.y+b.height:x?b.x+b.width:b.y,T=(x?g:0)*(_?-1:1),C=(x?0:-g)*(_?-1:1),A=x?"x":"y",P=PVe(f,S,A),I=P.range,k=I[1]-I[0],E=void 0;if(k>=1){if(k>1&&!d){var D=wG(f,I[0]);u.attr({x:D[0]+T,y:D[1]+C}),o&&(E=h.getRawValue(I[0]))}else{var D=c.getPointOn(S,A);D&&u.attr({x:D[0]+T,y:D[1]+C});var N=h.getRawValue(I[0]),z=h.getRawValue(I[1]);o&&(E=SJ(i,v,N,z,P.t))}a.lastFrameIndex=I[0]}else{var F=r===1||a.lastFrameIndex>0?I[0]:0,D=wG(f,F);o&&(E=h.getRawValue(F)),u.attr({x:D[0]+T,y:D[1]+C})}if(o){var $=Hv(u);typeof $.setLabelText=="function"&&$.setLabelText(E)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,f=r.hostModel,h=yVe(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=h.current,v=h.stackedOnCurrent,g=h.next,m=h.stackedOnNext;if(o&&(v=hl(h.stackedOnCurrent,h.current,i,o,l),d=hl(h.current,null,i,o,l),m=hl(h.stackedOnNext,h.next,i,o,l),g=hl(h.next,null,i,o,l)),_G(d,g)>3e3||c&&_G(v,m)>3e3){u.stopAnimation(),u.setShape({points:g}),c&&(c.stopAnimation(),c.setShape({points:g,stackedOnPoints:m}));return}u.shape.__points=h.current,u.shape.points=d;var x={shape:{points:g}};h.current!==d&&(x.shape.__points=h.next),u.stopAnimation(),lt(u,x,f),c&&(c.setShape({points:d,stackedOnPoints:v}),c.stopAnimation(),lt(c,{shape:{stackedOnPoints:m}},f),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],b=h.status,S=0;St&&(t=e[r]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,r=0;r10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),f=n.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(f||1),d=Math.round(s/h);if(isFinite(d)&&d>1){a==="lttb"?t.setData(i.lttbDownSample(i.mapDimension(u.dim),1/d)):a==="minmax"&&t.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/d));var v=void 0;pe(a)?v=IVe[a]:Ce(a)&&(v=a),v&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,v,OVe))}}}}}function EVe(e){e.registerChartView(LVe),e.registerSeriesModel(vVe),e.registerLayout(C0("line",!0)),e.registerVisual({seriesType:"line",reset:function(t){var r=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,Qte("line"))}var Ny=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return Jo(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(r,n,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(r),s=a.dataToPoint(o);if(i)B(a.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var v=h.getTicksCoords(),g=h.getTickModel().get("alignWithLabel"),m=o[d],x=n[d]==="x1"||n[d]==="y1";if(x&&!g&&(m+=1),v.length<2)return;if(v.length===2){s[d]=h.toGlobalCoord(h.getExtent()[x?1:0]);return}for(var _=void 0,b=void 0,S=1,T=0;Tm){b=(C+_)/2;break}T===1&&(S=A-v[0].tickValue)}b==null&&(_?_&&(b=v[v.length-1].coord):b=v[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),f=a.getBaseAxis().isHorizontal()?0:1;s[f]+=u+c/2}return s}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},t}(Tt);Tt.registerClass(Ny);var DVe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(){return Jo(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},t.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=Mu(Ny.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:J.color.primary,borderWidth:2}},realtimeSort:!1}),t}(Ny),NVe=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),Fw=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="sausage",n}return t.prototype.getDefaultShape=function(){return new NVe},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,c=n.startAngle,f=n.endAngle,h=n.clockwise,d=Math.PI*2,v=h?f-cMath.PI/2&&cs)return!0;s=f}return!1},t.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},t.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},t.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Ls(a,r,De(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(bt),SG={cartesian2d:function(e,t){var r=t.width<0?-1:1,n=t.height<0?-1:1;r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=uM(t.x,e.x),s=cM(t.x+t.width,i),l=uM(t.y,e.y),u=cM(t.y+t.height,a),c=si?s:o,t.y=f&&l>a?u:l,t.width=c?0:s-o,t.height=f?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),c||f},polar:function(e,t){var r=t.r0<=t.r?1:-1;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}var i=cM(t.r,e.r),a=uM(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}return o}},TG={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Xe({shape:ie({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var c=u.shape,f=i?"height":"width";c[f]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?Fw:_n,c=new u({shape:n,z2:1});c.name="item";var f=ere(i);if(c.calculateTextPosition=jVe(f,{isRoundCap:u===Fw}),a){var h=c.shape,d=i?"r":"endAngle",v={};h[d]=i?n.r0:n.startAngle,v[d]=n[d],(s?lt:Dt)(c,{shape:v},a)}return c}};function $Ve(e,t){var r=e.get("realtimeSort",!0),n=t.getBaseAxis();if(r&&n.type==="category"&&t.type==="cartesian2d")return{baseAxis:n,otherAxis:t.getOtherAxis(n)}}function CG(e,t,r,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?lt:Dt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?lt:Dt)(r,{shape:u},c,i)}function AG(e,t){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(e,t,r){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function GVe(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function ere(e){return function(t){var r=t?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}}(e)}function PG(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var c=e.shape,f=Po(n.getModel("itemStyle"),c,!0);ie(c,f),e.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var h=n.getShallow("cursor");h&&e.attr("cursor",h);var d=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",v=Nr(n);Ur(e,v,{labelFetcher:a,labelDataIndex:r,defaultText:sv(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var g=e.getTextContent();if(s&&g){var m=n.get(["label","position"]);e.textConfig.inside=m==="middle"?!0:null,RVe(e,m==="outside"?d:m,ere(o),n.get(["label","rotate"]))}cQ(g,v,a.getRawValue(r),function(_){return Hte(t,_)});var x=n.getModel(["emphasis"]);Gt(e,x.get("focus"),x.get("blurScope"),x.get("disabled")),Dr(e,n),GVe(i)&&(e.style.fill="none",e.style.stroke="none",B(e.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function WVe(e,t){var r=e.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,a)}var HVe=function(){function e(){}return e}(),kG=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="largeBar",n}return t.prototype.getDefaultShape=function(){return new HVe},t.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c=0?r:null},30,!1);function UVe(e,t,r){for(var n=e.baseDimIdx,i=1-n,a=e.shape.points,o=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,f=a.length/3;c=s[0]&&t<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[c]}return-1}function tre(e,t,r){if(fu(r,"cartesian2d")){var n=t,i=r.getArea();return{x:e?n.x:i.x,y:e?i.y:n.y,width:e?n.width:i.width,height:e?i.height:n.height}}else{var i=r.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}}function ZVe(e,t,r){var n=e.type==="polar"?_n:Xe;return new n({shape:tre(t,r,e),silent:!0,z2:0})}function YVe(e){e.registerChartView(zVe),e.registerSeriesModel(DVe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(ite,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,ate("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,Qte("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,r){var n=t.componentType||"series";r.eachComponent({mainType:n,query:t},function(i){t.sortInfo&&i.axis.setCategorySortInfo(t.sortInfo)})})}var OG=Math.PI*2,y_=Math.PI/180;function XVe(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=PQ(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=o.viewRect,h=-n.get("startAngle")*y_,d=n.get("endAngle"),v=n.get("padAngle")*y_;d=d==="auto"?h-OG:-d*y_;var g=n.get("minAngle")*y_,m=g+v,x=0;i.each(a,function(Z){!isNaN(Z)&&x++});var _=i.getSum(a),b=Math.PI/(_||x)*2,S=n.get("clockwise"),T=n.get("roseType"),C=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var P=S?1:-1,I=[h,d],k=P*v/2;BT(I,!S),h=I[0],d=I[1];var E=rre(n);E.startAngle=h,E.endAngle=d,E.clockwise=S,E.cx=s,E.cy=l,E.r=u,E.r0=c;var D=Math.abs(d-h),N=D,z=0,F=h;if(i.setLayout({viewRect:f,r:u}),i.each(a,function(Z,j){var U;if(isNaN(Z)){i.setItemLayout(j,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?U=_===0&&C?b:Z*b:U=D/x,UU?(V=F+P*U/2,Y=V):(V=F+k,Y=G-k),i.setItemLayout(j,{angle:U,startAngle:V,endAngle:Y,clockwise:S,cx:s,cy:l,r0:c,r:T?gt(Z,A,[c,u]):u}),F=G}),Nr?x:m,T=Math.abs(b.label.y-r);if(T>=S.maxY){var C=b.label.x-t-b.len2*i,A=n+b.len,P=Math.abs(C)e.unconstrainedWidth?null:h:null;n.setStyle("width",d)}ire(a,n)}}}function ire(e,t){DG.rect=e,Pte(DG,t,JVe)}var JVe={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},DG={};function fM(e){return e.position==="center"}function QVe(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*qVe,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function d(C){C.ignore=!0}function v(C){if(!C.ignore)return!0;for(var A in C.states)if(C.states[A].ignore===!1)return!0;return!1}t.each(function(C){var A=t.getItemGraphicEl(C),P=A.shape,I=A.getTextContent(),k=A.getTextGuideLine(),E=t.getItemModel(C),D=E.getModel("label"),N=D.get("position")||E.get(["emphasis","label","position"]),z=D.get("distanceToLabelLine"),F=D.get("alignTo"),$=ve(D.get("edgeDistance"),u),Z=D.get("bleedMargin");Z==null&&(Z=Math.min(u,h)>200?10:2);var j=E.getModel("labelLine"),U=j.get("length");U=ve(U,u);var G=j.get("length2");if(G=ve(G,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Y>0?"left":"right"}var Ge=Math.PI,Ye=0,vt=D.get("rotate");if(ot(vt))Ye=vt*(Ge/180);else if(N==="center")Ye=0;else if(vt==="radial"||vt===!0){var Ft=Y<0?-V+Ge:-V;Ye=Ft}else if(vt==="tangential"&&N!=="outside"&&N!=="outer"){var rr=Math.atan2(Y,K);rr<0&&(rr=Ge*2+rr);var Nn=K>0;Nn&&(rr=Ge+rr),Ye=rr-Ge}if(a=!!Ye,I.x=ee,I.y=le,I.rotation=Ye,I.setStyle({verticalAlign:"middle"}),ge){I.setStyle({align:Re});var qn=I.states.select;qn&&(qn.x+=I.x,qn.y+=I.y)}else{var Xr=new Oe(0,0,0,0);ire(Xr,I),r.push({label:I,labelLine:k,position:N,len:U,len2:G,minTurnAngle:j.get("minTurnAngle"),maxSurfaceAngle:j.get("maxSurfaceAngle"),surfaceNormal:new Ie(Y,K),linePoints:he,textAlign:Re,labelDistance:z,labelAlignTo:F,edgeDistance:$,bleedMargin:Z,rect:Xr,unconstrainedWidth:Xr.width,labelStyleWidth:I.style.width})}A.setTextConfig({inside:ge})}}),!a&&e.get("avoidLabelOverlap")&&KVe(r,n,i,l,u,h,c,f);for(var g=0;g0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f=a.r0}},t.type="pie",t}(bt);function rp(e,t,r){t=ae(t)&&{coordDimensions:t}||ie({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=Jv(n,t).dimensions,a=new En(i,e);return a.initData(n,r),a}var np=function(){function e(t,r){this._getDataWithEncodedVisual=t,this._getRawData=r}return e.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},e.prototype.containName=function(t){var r=this._getRawData();return r.indexOfName(t)>=0},e.prototype.indexOfName=function(t){var r=this._getDataWithEncodedVisual();return r.indexOfName(t)},e.prototype.getItemVisual=function(t,r){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,r)},e}(),r6e=Je(),are=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new np(me(this.getData,this),me(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return rp(this,{coordDimensions:["value"],encodeDefaulter:Fe(sj,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=r6e(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=dJ(o,n.hostModel.get("percentPrecision"))}var s=e.prototype.getDataParams.call(this,r);return s.percent=a[r]||0,s.$vars.push("percent"),s},t.prototype._defaultLabelLine=function(r){cf(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"50%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:"box",left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Tt);X3e({fullType:are.type,getCoord2:function(e){return e.getShallow("center")}});function n6e(e){return{seriesType:e,reset:function(t,r){var n=t.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(ot(o)&&!isNaN(o)&&o<0)})}}}function i6e(e){e.registerChartView(t6e),e.registerSeriesModel(are),xee("pie",e.registerAction),e.registerLayout(Fe(XVe,"pie")),e.registerProcessor(tp("pie")),e.registerProcessor(n6e("pie"))}var a6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r}return t.prototype.getInitialData=function(r,n){return Jo(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?5e3:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?1e4:this.get("progressiveThreshold"))},t.prototype.brushSelector=function(r,n,i){return i.point(n.getItemLayout(r))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:J.color.primary}},universalTransition:{divideShape:"clone"}},t}(Tt),ore=4,o6e=function(){function e(){}return e}(),s6e=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new o6e},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(r,n){var i=n.points,a=n.size,o=this.symbolProxy,s=o.shape,l=r.getContext?r.getContext():r,u=l&&a[0]=0;u--){var c=u*2,f=a[c]-s/2,h=a[c+1]-l/2;if(r>=f&&n>=h&&r<=f+s&&n<=h+l)return u}return-1},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.points,a=n.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,f=-1/0,h=0;h=0&&(u.dataIndex=f+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),u6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.updateData(a,{clipShape:this._getClipShape(r)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.incrementalPrepareUpdate(a),this._finished=!1},t.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=r.end===n.getData().count()},t.prototype.updateTransform=function(r,n,i){var a=r.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=C0("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},t.prototype.eachRendered=function(r){this._symbolDraw&&this._symbolDraw.eachRendered(r)},t.prototype._getClipShape=function(r){if(r.get("clip",!0)){var n=r.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},t.prototype._updateSymbolDraw=function(r,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new l6e:new S0,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},t.prototype.remove=function(r,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(bt),sre={left:0,right:0,top:0,bottom:0},Vw=["25%","25%"],c6e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Of(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Ho(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Ho(this.option.outerBounds,r.outerBounds)},t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:sre,outerBoundsContain:"all",outerBoundsClampWidth:Vw[0],outerBoundsClampHeight:Vw[1],backgroundColor:J.color.transparent,borderWidth:1,borderColor:J.color.neutral30},t}(Ke),uO=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",er).models[0]},t.type="cartesian2dAxis",t}(Ke);cr(uO,ep);var lre={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:J.color.axisLine,width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:J.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:J.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[J.color.backgroundTint,J.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:J.color.neutral00,borderColor:J.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},f6e=He({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},lre),Fj=He({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:J.color.axisMinorSplitLine,width:1}}},lre),h6e=He({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Fj),d6e=Pe({logBase:10},Fj);const ure={category:f6e,value:Fj,time:h6e,log:d6e};var v6e={value:1,category:1,time:1,log:1},cO=null;function p6e(e){cO||(cO=e)}function A0(){return cO}function lv(e,t,r,n){B(v6e,function(i,a){var o=He(He({},ure[a],!0),n,!0),s=function(l){q(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=t+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,f){var h=Cy(this),d=h?Of(c):{},v=f.getTheme();He(c,v.get(a+"Axis")),He(c,this.getDefaultOption()),c.type=NG(c),h&&Ho(c,d,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=Iy.createByAxisModel(this))},u.prototype.getCategories=function(c){var f=this.option;if(f.type==="category")return c?f.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){var f=A0();return f?f.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",NG)}function NG(e){return e.type||(e.data?"category":"value")}var g6e=function(){function e(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return e.prototype.getAxis=function(t){return this._axes[t]},e.prototype.getAxes=function(){return se(this._dimList,function(t){return this._axes[t]},this)},e.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),ht(this.getAxes(),function(r){return r.scale.type===t})},e.prototype.addAxis=function(t){var r=t.dim;this._axes[r]=t,this._dimList.push(r)},e}(),fO=["x","y"];function jG(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var m6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=fO,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!jG(r)||!jG(n))){var i=r.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,f=(s[1]-o[1])/u,h=o[0]-i[0]*c,d=o[1]-a[0]*f,v=this._transform=[c,0,0,f,h,d];this._invTransform=va([],v)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},t.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},t.prototype.containZone=function(r,n){var i=this.dataToPoint(r),a=this.dataToPoint(n),o=this.getArea(),s=new Oe(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},t.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return lr(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},t.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},t.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return lr(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.toLocalCoord(r[1]),n),i},t.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},t.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-r,o=Math.min(i[0],i[1])-r,s=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-o+r;return new Oe(a,o,s,l)},t}(g6e),cre=function(e){q(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},t.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},t.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},t.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},t}(ba),eC="expandAxisBreak",fre="collapseAxisBreak",hre="toggleAxisBreak",Vj="axisbreakchanged",y6e={type:eC,event:Vj,update:"update",refineEvent:Gj},x6e={type:fre,event:Vj,update:"update",refineEvent:Gj},_6e={type:hre,event:Vj,update:"update",refineEvent:Gj};function Gj(e,t,r,n){var i=[];return B(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function b6e(e){e.registerAction(y6e,t),e.registerAction(x6e,t),e.registerAction(_6e,t);function t(r,n){var i=[],a=dd(n,r);function o(s,l){B(a[s],function(u){var c=u.updateAxisBreaks(r);B(c.breaks,function(f){var h;i.push(Pe((h={},h[l]=u.componentIndex,h),f))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var Nl=Math.PI,w6e=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],S6e=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],uv=Je(),dre=Je(),vre=function(){function e(t){this.recordMap={},this.resolveAxisNameOverlap=t}return e.prototype.ensureRecord=function(t){var r=t.axis.dim,n=t.componentIndex,i=this.recordMap,a=i[r]||(i[r]=[]);return a[n]||(a[n]={ready:{}})},e}();function T6e(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=Wj(e.axisName)&&ov(e.nameLocation);B(n,function(v){var g=Uo(v);if(!(!g||g.label.ignore)){o.push(g);var m=a.transGroup;l&&(m.transform?va(Kp,m.transform):c0(Kp),g.transform&&Ga(Kp,Kp,g.transform),Oe.copy(x_,g.localRect),x_.applyTransform(Kp),s?s.union(x_):Oe.copy(s=new Oe(0,0,0,0),x_))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",c=a.transGroup[u];if(o.sort(function(v,g){return Math.abs(v.label[u]-c)-Math.abs(g.label[u]-c)}),l&&s){var f=i.getExtent(),h=Math.min(f[0],f[1]),d=Math.max(f[0],f[1])-h;s.union(new Oe(h,0,d,1))}a.stOccupiedRect=s,a.labelInfoList=o}var Kp=Wr(),x_=new Oe(0,0,0,0),pre=function(e,t,r,n,i,a){if(ov(e.nameLocation)){var o=a.stOccupiedRect;o&&gre(wFe({},o,a.transGroup.transform),n,i)}else mre(a.labelInfoList,a.dirVec,n,i)};function gre(e,t,r){var n=new Ie;JT(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&rO(t,n)}function mre(e,t,r,n){for(var i=Ie.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):Qd(i-Nl)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},e.makeAxisEventDataBase=function(t){var r={componentType:t.mainType,componentIndex:t.componentIndex};return r[t.mainType+"Index"]=t.componentIndex,r},e.isLabelSilent=function(t){var r=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||r&&r.show)},e}(),C6e=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],A6e={axisLine:function(e,t,r,n,i,a,o){var s=n.get(["axisLine","show"]);if(s==="auto"&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),!!s){var l=n.axis.getExtent(),u=a.transform,c=[l[0],0],f=[l[1],0],h=c[0]>f[0];u&&(lr(c,c,u),lr(f,f,u));var d=ie({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),v={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:d};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())A0().buildAxisBreakLine(n,i,a,v);else{var g=new mr(ie({shape:{x1:c[0],y1:c[1],x2:f[0],y2:f[1]}},v));rv(g.shape,g.style.lineWidth),g.anid="line",i.add(g)}var m=n.get(["axisLine","symbol"]);if(m!=null){var x=n.get(["axisLine","symbolSize"]);pe(m)&&(m=[m,m]),(pe(x)||ot(x))&&(x=[x,x]);var _=Df(n.get(["axisLine","symbolOffset"])||0,x),b=x[0],S=x[1];B([{rotate:e.rotation+Math.PI/2,offset:_[0],r:0},{rotate:e.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((c[0]-f[0])*(c[0]-f[0])+(c[1]-f[1])*(c[1]-f[1]))}],function(T,C){if(m[C]!=="none"&&m[C]!=null){var A=xr(m[C],-b/2,-S/2,b,S,d.stroke,!0),P=T.r+T.offset,I=h?f:c;A.attr({rotation:T.rotate,x:I[0]+P*Math.cos(e.rotation),y:I[1]-P*Math.sin(e.rotation),silent:!0,z2:11}),i.add(A)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=BG(t,i,s);l&&RG(e,t,r,n,i,a,o,Ka.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=BG(t,i,s);l&&RG(e,t,r,n,i,a,o,Ka.determine);var u=L6e(e,i,a,n);k6e(e,t.labelLayoutList,u),I6e(e,i,a,n,e.tickDirection)},axisName:function(e,t,r,n,i,a,o,s){var l=r.ensureRecord(n);t.nameEl&&(i.remove(t.nameEl),t.nameEl=l.nameLayout=l.nameLocation=null);var u=e.axisName;if(Wj(u)){var c=e.nameLocation,f=e.nameDirection,h=n.getModel("nameTextStyle"),d=n.get("nameGap")||0,v=n.axis.getExtent(),g=n.axis.inverse?-1:1,m=new Ie(0,0),x=new Ie(0,0);c==="start"?(m.x=v[0]-g*d,x.x=-g):c==="end"?(m.x=v[1]+g*d,x.x=g):(m.x=(v[0]+v[1])/2,m.y=e.labelOffset+f*d,x.y=f);var _=Wr();x.transform(Qs(_,_,e.rotation));var b=n.get("nameRotate");b!=null&&(b=b*Nl/180);var S,T;ov(c)?S=Wn.innerTextLayout(e.rotation,b??e.rotation,f):(S=M6e(e.rotation,c,b||0,v),T=e.raw.axisNameAvailableWidth,T!=null&&(T=Math.abs(T/Math.sin(S.rotation)),!isFinite(T)&&(T=null)));var C=h.getFont(),A=n.get("nameTruncate",!0)||{},P=A.ellipsis,I=rn(e.raw.nameTruncateMaxWidth,A.maxWidth,T),k=s.nameMarginLevel||0,E=new at({x:m.x,y:m.y,rotation:S.rotation,silent:Wn.isLabelSilent(n),style:Mt(h,{text:u,font:C,overflow:"truncate",width:I,ellipsis:P,fill:h.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:h.get("align")||S.textAlign,verticalAlign:h.get("verticalAlign")||S.textVerticalAlign}),z2:1});if(tl({el:E,componentModel:n,itemName:u}),E.__fullText=u,E.anid="name",n.get("triggerEvent")){var D=Wn.makeAxisEventDataBase(n);D.targetType="axisName",D.name=u,De(E).eventData=D}a.add(E),E.updateTransform(),t.nameEl=E;var N=l.nameLayout=Uo({label:E,priority:E.z2,defaultAttr:{ignore:E.ignore},marginDefault:ov(c)?w6e[k]:S6e[k]});if(l.nameLocation=c,i.add(E),E.decomposeTransform(),e.shouldNameMoveOverlap&&N){var z=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,N,x,z)}}}};function RG(e,t,r,n,i,a,o,s){xre(t)||O6e(e,t,i,s,n,o);var l=t.labelLayoutList;E6e(e,n,l,a),j6e(n,e.rotation,l);var u=e.optionHideOverlap;P6e(n,l,u),u&&kte(ht(l,function(c){return c&&!c.label.ignore})),T6e(e,r,n,l)}function M6e(e,t,r,n){var i=SN(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return Qd(i-Nl/2)?(o=l?"bottom":"top",a="center"):Qd(i-Nl*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iNl/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function P6e(e,t,r){if(hte(e.axis))return;function n(s,l,u){var c=Uo(t[l]),f=Uo(t[u]);if(!(!c||!f)){if(s===!1||c.suggestIgnore){Mg(c.label);return}if(f.suggestIgnore){Mg(f.label);return}var h=.1;if(!r){var d=[0,0,0,0];c=nO({marginForce:d},c),f=nO({marginForce:d},f)}JT(c,f,null,{touchThreshold:h})&&Mg(s?f.label:c.label)}}var i=e.get(["axisLabel","showMinLabel"]),a=e.get(["axisLabel","showMaxLabel"]),o=t.length;n(i,0,1),n(a,o-1,o-2)}function k6e(e,t,r){e.showMinorTicks||B(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(v)&&isFinite(u[0]);)d=q2(d),v=u[1]-d*o;else{var m=e.getTicks().length-1;m>o&&(d=q2(d));var x=d*o;g=Math.ceil(u[1]/d)*d,v=gr(g-x),v<0&&u[0]>=0?(v=0,g=gr(x)):g>0&&u[1]<=0&&(g=0,v=-gr(x))}var _=(i[0].value-a[0].value)/s,b=(i[o].value-a[o].value)/s;n.setExtent.call(e,v+d*_,g+d*b),n.setInterval.call(e,d),(_||b)&&n.setNiceExtent.call(e,v+d,g-d)}var $G=[[3,1],[0,2]],$6e=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=fO,this._initCartesian(t,r,n),this.model=t}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(t,r){var n=this._axesMap;this._updateScale(t,this.model);function i(o){var s,l=it(o),u=l.length;if(u){for(var c=[],f=u-1;f>=0;f--){var h=+l[f],d=o[h],v=d.model,g=d.scale;qI(g)&&v.get("alignTicks")&&v.get("interval")==null?c.push(d):(mf(g,v),qI(g)&&(s=d))}c.length&&(s||(s=c.pop(),mf(s.scale,s.model)),B(c,function(m){_re(m.scale,m.model,s.scale)}))}}i(n.x),i(n.y);var a={};B(n.x,function(o){FG(n,"y",o,a)}),B(n.y,function(o){FG(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=jr(t,r),a=this._rect=zt(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(dO(o,a),!n){var u=G6e(a,s,o,l,r),c=void 0;if(l)vO?(vO(this._axesList,a),dO(o,a)):c=WG(a.clone(),"axisLabel",null,a,o,u,i);else{var f=W6e(t,a,i),h=f.outerBoundsRect,d=f.parsedOuterBoundsContain,v=f.outerBoundsClamp;h&&(c=WG(h,d,v,a,o,u,i))}bre(a,o,Ka.determine,null,c,i)}B(this._coordsList,function(g){g.calcAffineTransform()})},e.prototype.getAxis=function(t,r){var n=this._axesMap[t];if(n!=null)return n[r||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(t,r){if(t!=null&&r!=null){var n="x"+t+"y"+r;return this._coordsMap[n]}ke(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return vf(n,s,!0,!0,r),dO(i,n),l;function u(h){B(i[Be[h]],function(d){if(Oy(d.model)){var v=a.ensureRecord(d.model),g=v.labelInfoList;if(g)for(var m=0;m0&&!gn(d)&&d>1e-4&&(h/=d),h}}function G6e(e,t,r,n,i){var a=new vre(H6e);return B(r,function(o){return B(o,function(s){if(Oy(s.model)){var l=!n;s.axisBuilder=B6e(e,t,s.model,i,a,l)}})}),a}function bre(e,t,r,n,i,a){var o=r===Ka.determine;B(t,function(u){return B(u,function(c){Oy(c.model)&&(z6e(c.axisBuilder,e,c.model),c.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[Be[1-u]]=e[Tr[u]]<=a.refContainer[Tr[u]]*.5?0:1-u===1?2:1}B(t,function(u,c){return B(u,function(f){Oy(f.model)&&((n==="all"||o)&&f.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&f.axisBuilder.build({axisLine:!0}))})})}function W6e(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=zt(e.get("outerBounds",!0)||sre,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||We(["all","axisLabel"],a)<0?o="all":o=a;var s=[vw(be(e.get("outerBoundsClampWidth",!0),Vw[0]),t.width),vw(be(e.get("outerBoundsClampHeight",!0),Vw[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var H6e=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";pre(e,t,r,n,i,a),ov(e.nameLocation)||B(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&mre(s.labelInfoList,s.dirVec,n,i)})};function U6e(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return Z6e(r,e,t),r.seriesInvolved&&X6e(r,e),r}function Z6e(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];B(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=jy(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,f=c.getModel("tooltip",n);if(B(s.getAxes(),Fe(g,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var h=f.get("trigger")==="axis",d=f.get(["axisPointer","type"])==="cross",v=s.getTooltipAxes(f.get(["axisPointer","axis"]));(h||d)&&B(v.baseAxes,Fe(g,d?"cross":!0,h)),d&&B(v.otherAxes,Fe(g,"cross",!1))}function g(m,x,_){var b=_.model.getModel("axisPointer",i),S=b.get("show");if(!(!S||S==="auto"&&!m&&!pO(b))){x==null&&(x=b.get("triggerTooltip")),b=m?Y6e(_,f,i,t,m,x):b;var T=b.get("snap"),C=b.get("triggerEmphasis"),A=jy(_.model),P=x||T||_.type==="category",I=e.axesInfo[A]={key:A,axis:_,coordSys:s,axisPointerModel:b,triggerTooltip:x,triggerEmphasis:C,involveSeries:P,snap:T,useHandle:pO(b),seriesModels:[],linkGroup:null};u[A]=I,e.seriesInvolved=e.seriesInvolved||P;var k=q6e(a,_);if(k!=null){var E=o[k]||(o[k]={axesInfo:{}});E.axesInfo[A]=I,E.mapper=a[k].mapper,I.linkGroup=E}}}})}function Y6e(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};B(s,function(h){l[h]=Ae(o.get(h))}),l.snap=e.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var c=o.get(["label","show"]);if(u.show=c??!0,!a){var f=l.lineStyle=o.get("crossStyle");f&&Pe(u,f.textStyle)}}return e.model.getModel("axisPointer",new et(l,r,n))}function X6e(e,t){t.eachSeries(function(r){var n=r.coordinateSystem,i=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!n||!n.model||i==="none"||i===!1||i==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||B(e.coordSysAxesInfo[jy(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function q6e(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function K6e(e){var t=Hj(e);if(t){var r=t.axisPointerModel,n=t.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=pO(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0;return o&&s}var iGe=Je();function ZG(e,t,r,n){if(e instanceof cre){var i=e.scale.type;if(i!=="category"&&i!=="ordinal")return r}var a=e.model,o=a.get("jitter"),s=a.get("jitterOverlap"),l=a.get("jitterMargin")||0,u=e.scale.type==="ordinal"?e.getBandWidth():null;return o>0?s?Mre(r,o,u,n):aGe(e,t,r,n,o,l):r}function Mre(e,t,r,n){if(r===null)return e+(Math.random()-.5)*t;var i=r-n*2,a=Math.min(Math.max(0,t),i);return e+(Math.random()-.5)*a}function aGe(e,t,r,n,i,a){var o=iGe(e);o.items||(o.items=[]);var s=o.items,l=YG(s,t,r,n,i,a,1),u=YG(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||f&&h>f/2-n?Mre(r,i,f,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function YG(e,t,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&v>s||o===-1&&v0&&!v.min?v.min=0:v.min!=null&&v.min<0&&!v.max&&(v.max=0);var g=l;v.color!=null&&(g=Pe({color:v.color},l));var m=He(Ae(v),{boundaryGap:r,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:v.text,showName:u,nameLocation:"end",nameGap:f,nameTextStyle:g,triggerEvent:h},!1);if(pe(c)){var x=m.name;m.name=c.replace("{value}",x??"")}else Ce(c)&&(m.name=c(m.name,m));var _=new et(m,null,this.ecModel);return cr(_,ep.prototype),_.mainType="radar",_.componentIndex=this.componentIndex,_},this);this._indicatorModels=d},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,axisName:{show:!0,color:J.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:He({lineStyle:{color:J.color.neutral20}},Jp.axisLine),axisLabel:__(Jp.axisLabel,!1),axisTick:__(Jp.axisTick,!1),splitLine:__(Jp.splitLine,!0),splitArea:__(Jp.splitArea,!0),indicator:[]},t}(Ke),vGe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group;a.removeAll(),this._buildAxes(r,i),this._buildSplitLineAndArea(r)},t.prototype._buildAxes=function(r,n){var i=r.coordinateSystem,a=i.getIndicatorAxes(),o=se(a,function(s){var l=s.model.get("showName")?s.name:"",u=new Wn(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});B(o,function(s){s.build(),this.group.add(s.group)},this)},t.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),o=r.getModel("splitLine"),s=r.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),f=s.get("show"),h=l.get("color"),d=u.get("color"),v=ae(h)?h:[h],g=ae(d)?d:[d],m=[],x=[];function _(F,$,Z){var j=Z%$.length;return F[j]=F[j]||[],j}if(a==="circle")for(var b=i[0].getTicksCoords(),S=n.cx,T=n.cy,C=0;C3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(i){var f=Math.abs(a),h=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(r){if(!(KG(this._zr,"globalPan")||Qp(r))){var n=r.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(r,n,i,a,o){r._checkPointer(a,o.originX,o.originY)&&(Vs(a.event),a.__ecRoamConsumed=!0,JG(r,n,i,a,o))},t}(xa);function Qp(e){return e.__ecRoamConsumed}var wGe=Je();function tC(e){var t=wGe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function eg(e,t,r,n){for(var i=tC(e),a=i.roam,o=a[t]=a[t]||[],s=0;s=4&&(c={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(c&&s!=null&&l!=null&&(f=Ere(c,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var d=i;i=new Me,i.add(d),d.scaleX=d.scaleY=f.scale,d.x=f.x,d.y=f.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Xe({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:f,named:a}},e.prototype._parseNode=function(t,r,n,i,a,o){var s=t.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=r;else{if(!a){var c=vM[s];if(c&&xe(vM,s)){l=c.call(this,t,r);var f=t.getAttribute("name");if(f){var h={name:f,namedFrom:null,svgNodeTagLower:s,el:l};n.push(h),s==="g"&&(u=h)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var d=rW[s];if(d&&xe(rW,s)){var v=d.call(this,t),g=t.getAttribute("id");g&&(this._defs[g]=v)}}if(l&&l.isGroup)for(var m=t.firstChild;m;)m.nodeType===1?this._parseNode(m,l,n,u,a,o):m.nodeType===3&&o&&this._parseText(m,l),m=m.nextSibling},e.prototype._parseText=function(t,r){var n=new ev({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Wi(r,n),di(t,n,this._defsUsePending,!1,!1),AGe(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,r.add(n),n},e.internalField=function(){vM={g:function(t,r){var n=new Me;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Xe;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,r){var n=new Ko;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,r){var n=new mr;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,r){var n=new v0;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,r){var n=t.getAttribute("points"),i;n&&(i=aW(n));var a=new bn({shape:{points:i||[]},silent:!0});return Wi(r,a),di(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=aW(n));var a=new an({shape:{points:i||[]},silent:!0});return Wi(r,a),di(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new Yr;return Wi(r,n),di(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,r){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new Me;return Wi(r,s),di(t,s,this._defsUsePending,!1,!0),s},tspan:function(t,r){var n=t.getAttribute("x"),i=t.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",s=new Me;return Wi(r,s),di(t,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(t,r){var n=t.getAttribute("d")||"",i=XJ(n);return Wi(r,i),di(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),rW={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),r=parseInt(e.getAttribute("y1")||"0",10),n=parseInt(e.getAttribute("x2")||"10",10),i=parseInt(e.getAttribute("y2")||"0",10),a=new Lf(t,r,n,i);return nW(e,a),iW(e,a),a},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),r=parseInt(e.getAttribute("cy")||"0",10),n=parseInt(e.getAttribute("r")||"0",10),i=new BN(t,r,n);return nW(e,i),iW(e,i),i}};function nW(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function iW(e,t){for(var r=e.firstChild;r;){if(r.nodeType===1&&r.nodeName.toLocaleLowerCase()==="stop"){var n=r.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};Ore(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=On(o),u=l&&l[3];u&&(l[3]*=Ps(s),o=la(l,"rgba"))}t.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function Wi(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Pe(t.__inheritedStyle,e.__inheritedStyle))}function aW(e){for(var t=nC(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=nC(o);switch(i=i||Wr(),s){case"translate":Xa(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":kT(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Qs(i,i,-parseFloat(l[0])*pM,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*pM);Ga(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*pM);Ga(i,[1,c,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}t.setLocalTransform(i)}}var sW=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Ore(e,t,r){var n=e.getAttribute("style");if(n){sW.lastIndex=0;for(var i;(i=sW.exec(n))!=null;){var a=i[1],o=xe(Ww,a)?Ww[a]:null;o&&(t[o]=i[2]);var s=xe(Hw,a)?Hw[a]:null;s&&(r[s]=i[2])}}}function OGe(e,t,r){for(var n=0;n0,_={api:n,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:x,isGeo:o,transformInfoRaw:h};l.resourceType==="geoJSON"?this._buildGeoJSON(_):l.resourceType==="geoSVG"&&this._buildSVG(_),this._updateController(t,m,r,n),this._updateMapSelectHandler(t,u,n,i)},e.prototype._buildGeoJSON=function(t){var r=this._regionsGroupByName=_e(),n=_e(),i=this._regionsGroup,a=t.transformInfoRaw,o=t.mapOrGeoModel,s=t.data,l=t.geo.projection,u=l&&l.stream;function c(d,v){return v&&(d=v(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function f(d){for(var v=[],g=!u&&l&&l.project,m=0;m=0)&&(h=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Ur(t,Nr(n),{labelFetcher:h,labelDataIndex:f,defaultText:r},d);var v=t.getTextContent();if(v&&(Dre(v).ignore=v.ignore,t.textConfig&&o)){var g=t.getBoundingRect().clone();t.textConfig.layoutRect=g,t.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function hW(e,t,r,n,i,a){e.data?e.data.setItemGraphicEl(a,t):De(t).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:r,region:n&&n.option||{}}}function dW(e,t,r,n,i){e.data||tl({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function vW(e,t,r,n,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Gt(t,o,a.get("blurScope"),a.get("disabled")),e.isGeo&&F5e(t,i,r),o}function pW(e,t,r){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=t({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!r&&s.polygonStart(),B(e,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=J.color.neutral00,i.style.lineWidth=2),i},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:J.color.tertiary},itemStyle:{borderWidth:.5,borderColor:J.color.border,areaColor:J.color.background},emphasis:{label:{show:!0,color:J.color.primary},itemStyle:{areaColor:J.color.highlight}},select:{label:{show:!0,color:J.color.primary},itemStyle:{color:J.color.highlight}},nameProperty:"name"},t}(Tt);function JGe(e,t){var r={};return B(e,function(n){n.each(n.mapDimension("value"),function(i,a){var o="ec-"+n.getName(a);r[o]=r[o]||[],isNaN(i)||r[o].push(i)})}),e[0].map(e[0].mapDimension("value"),function(n,i){for(var a="ec-"+e[0].getName(i),o=0,s=1/0,l=-1/0,u=r[a].length,c=0;c1?(b.width=_,b.height=_/g):(b.height=_,b.width=_*g),b.y=x[1]-b.height/2,b.x=x[0]-b.width/2;else{var S=e.getBoxLayoutParams();S.aspect=g,b=zt(S,v),b=kQ(e,b,g)}this.setViewRect(b.x,b.y,b.width,b.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function rWe(e,t){B(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var nWe=function(){function e(){this.dimensions=jre}return e.prototype.create=function(t,r){var n=[];function i(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}t.eachComponent("geo",function(o,s){var l=o.get("map"),u=new yO(l+s,l,ie({nameMap:o.get("nameMap"),api:r,ecModel:t},i(o)));u.zoomLimit=o.get("scaleLimit"),n.push(u),o.coordinateSystem=u,u.model=o,u.resize=xW,u.resize(o,r)}),t.eachSeries(function(o){x0({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",er).models[0];return s&&s.coordinateSystem},allowNotFound:!0})});var a={};return t.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),B(a,function(o,s){var l=se(o,function(c){return c.get("nameMap")}),u=new yO(s,s,ie({nameMap:AT(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=rn.apply(null,se(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=xW,u.resize(o[0],r),B(o,function(c){c.coordinateSystem=u,rWe(u,c)})}),n},e.prototype.getFilledRegions=function(t,r,n,i){for(var a=(t||[]).slice(),o=_e(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(s)}}function uWe(e,t){var r=e.isExpand?e.children:[],n=e.parentNode.children,i=e.hierNode.i?n[e.hierNode.i-1]:null;if(r.length){fWe(e);var a=(r[0].hierNode.prelim+r[r.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=hWe(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function cWe(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function _W(e){return arguments.length?e:pWe}function Pg(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function fWe(e){for(var t=e.children,r=t.length,n=0,i=0;--r>=0;){var a=t[r];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function hWe(e,t,r,n){if(t){for(var i=e,a=e,o=a.parentNode.children[0],s=t,l=i.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,f=s.hierNode.modifier;s=gM(s),a=mM(a),s&&a;){i=gM(i),o=mM(o),i.hierNode.ancestor=e;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+n(s,a);h>0&&(vWe(dWe(s,e,r),e,h),u+=h,l+=h),f+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!gM(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!mM(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function gM(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function mM(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function dWe(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function vWe(e,t,r){var n=r/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=r,t.hierNode.modifier+=r,t.hierNode.prelim+=r,e.hierNode.change+=n}function pWe(e,t){return e.parentNode===t.parentNode?1:2}var gWe=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),mWe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultStyle=function(){return{stroke:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new gWe},t.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){r.moveTo(o[0],o[1]),r.lineTo(s[0],s[1]);return}var u=n.orient,c=u==="TB"||u==="BT"?0:1,f=1-c,h=ve(n.forkPosition,1),d=[];d[c]=o[c],d[f]=o[f]+(l[f]-o[f])*h,r.moveTo(o[0],o[1]),r.lineTo(d[0],d[1]),r.moveTo(s[0],s[1]),d[c]=s[c],r.lineTo(d[0],d[1]),d[c]=l[c],r.lineTo(d[0],d[1]),r.lineTo(l[0],l[1]);for(var v=1;v_.x,T||(S=S-Math.PI));var A=T?"left":"right",P=s.getModel("label"),I=P.get("rotate"),k=I*(Math.PI/180),E=m.getTextContent();E&&(m.setTextConfig({position:P.get("position")||A,rotation:I==null?-S:k,origin:"center"}),E.setStyle("verticalAlign","middle"))}var D=s.get(["emphasis","focus"]),N=D==="relative"?qd(o.getAncestorsIndices(),o.getDescendantIndices()):D==="ancestor"?o.getAncestorsIndices():D==="descendant"?o.getDescendantIndices():null;N&&(De(r).focus=N),xWe(i,o,c,r,v,d,g,n),r.__edge&&(r.onHoverStateChange=function(z){if(z!=="blur"){var F=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);F&&F.hoverState===d0||yw(r.__edge,z)}})}function xWe(e,t,r,n,i,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),f=e.getOrient(),h=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),v=l.getModel("lineStyle").getLineStyle(),g=n.__edge;if(u==="curve")t.parentNode&&t.parentNode!==r&&(g||(g=n.__edge=new Vv({shape:xO(c,f,h,i,i)})),lt(g,{shape:xO(c,f,h,a,o)},e));else if(u==="polyline"&&c==="orthogonal"&&t!==r&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var m=t.children,x=[],_=0;_r&&(r=i.height)}this.height=r+1},e.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var r=0,n=this.children,i=n.length;r=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,r)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostTree,n=r.data.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(t,r){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,r)},e.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,r=0;r=0){var n=r.getData().tree.root,i=e.targetNode;if(pe(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=e.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function Vre(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function Qj(e,t){var r=Vre(e);return We(r,t)>=0}function iC(e,t){for(var r=[];e;){var n=e.dataIndex;r.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return r.reverse(),r}var PWe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.hasSymbolVisual=!0,r.ignoreStyleOnData=!0,r}return t.prototype.getInitialData=function(r){var n={name:r.name,children:r.data},i=r.leaves||{},a=new et(i,this,this.ecModel),o=Jj.createTree(n,this,s);function s(f){f.wrapMethod("getItemModel",function(h,d){var v=o.getNodeByDataIndex(d);return v&&v.children.length&&v.isExpand||(h.parentModel=a),h})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var u=r.expandAndCollapse,c=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var h=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=h&&h.collapsed!=null?!h.collapsed:f.depth<=c}),o.data},t.prototype.getOrient=function(){var r=this.get("orient");return r==="horizontal"?r="LR":r==="vertical"&&(r="TB"),r},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.formatTooltip=function(r,n,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(r),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return Cr("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=iC(i,this),n.collapsed=!i.isExpand,n},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystemUsage:"box",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,roamTrigger:"global",nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:J.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(Tt);function kWe(e,t,r){for(var n=[e],i=[],a;a=n.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)r.push(i[a])}}function LWe(e,t){e.eachSeriesByType("tree",function(r){IWe(r,t)})}function IWe(e,t){var r=jr(e,t).refContainer,n=zt(e.getBoxLayoutParams(),r);e.layoutInfo=n;var i=e.get("layout"),a=0,o=0,s=null;i==="radial"?(a=2*Math.PI,o=Math.min(n.height,n.width)/2,s=_W(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=_W());var l=e.getData().tree.root,u=l.children[0];if(u){lWe(l),kWe(u,uWe,s),l.hierNode.modifier=-u.hierNode.prelim,ng(u,cWe);var c=u,f=u,h=u;ng(u,function(S){var T=S.getLayout().x;Tf.getLayout().x&&(f=S),S.depth>h.depth&&(h=S)});var d=c===f?1:s(c,f)/2,v=d-c.getLayout().x,g=0,m=0,x=0,_=0;if(i==="radial")g=a/(f.getLayout().x+d+v),m=o/(h.depth-1||1),ng(u,function(S){x=(S.getLayout().x+v)*g,_=(S.depth-1)*m;var T=Pg(x,_);S.setLayout({x:T.x,y:T.y,rawX:x,rawY:_},!0)});else{var b=e.getOrient();b==="RL"||b==="LR"?(m=o/(f.getLayout().x+d+v),g=a/(h.depth-1||1),ng(u,function(S){_=(S.getLayout().x+v)*m,x=b==="LR"?(S.depth-1)*g:a-(S.depth-1)*g,S.setLayout({x,y:_},!0)})):(b==="TB"||b==="BT")&&(g=a/(f.getLayout().x+d+v),m=o/(h.depth-1||1),ng(u,function(S){x=(S.getLayout().x+v)*g,_=b==="TB"?(S.depth-1)*m:o-(S.depth-1)*m,S.setLayout({x,y:_},!0)}))}}}function OWe(e){e.eachSeriesByType("tree",function(t){var r=t.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=r.ensureUniqueItemVisual(i.dataIndex,"style");ie(s,o)})})}function EWe(e){e.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,r){r.eachComponent({mainType:"series",subType:"tree",query:t},function(n){var i=t.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),e.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",subType:"tree",query:t},function(i){var a=i.coordinateSystem,o=rC(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function DWe(e){e.registerChartView(yWe),e.registerSeriesModel(PWe),e.registerLayout(LWe),e.registerVisual(OWe),EWe(e)}var CW=["treemapZoomToNode","treemapRender","treemapMove"];function NWe(e){for(var t=0;t1;)a=a.parentNode;var o=jI(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var jWe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.preventUsingHoverLayer=!0,r}return t.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};Wre(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new et({itemStyle:o},this,n);a=r.levels=RWe(a,n);var l=se(a||[],function(f){return new et(f,s,n)},this),u=Jj.createTree(i,this,c);function c(f){f.wrapMethod("getItemModel",function(h,d){var v=u.getNodeByDataIndex(d),g=v?l[v.depth]:null;return h.parentModel=g||s,h})}return u.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(r,n,i){var a=this.getData(),o=this.getRawValue(r),s=a.getName(r);return Cr("nameValue",{name:s,value:o})},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=iC(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},ie(this.layoutInfo,r)},t.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=_e(),this._idIndexMapCount=0);var i=n.get(r);return i==null&&n.set(r,i=this._idIndexMapCount++),i},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},t.prototype.enableAriaDecal=function(){Gre(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,coordinateSystemUsage:"box",left:J.size.l,top:J.size.xxxl,right:J.size.l,bottom:J.size.xxxl,sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:"global",nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",bottom:J.size.m,emptyItemWidth:25,itemStyle:{color:J.color.backgroundShade,textStyle:{color:J.color.secondary}},emphasis:{itemStyle:{color:J.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:J.color.neutral00,overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:J.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(Tt);function Wre(e){var t=0;B(e.children,function(n){Wre(n);var i=n.value;ae(i)&&(i=i[0]),t+=i});var r=e.value;ae(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ae(e.value)?e.value[0]=r:e.value=r}function RWe(e,t){var r=Pt(t.get("color")),n=Pt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;B(e,function(s){var l=new et(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=e[0]||(e[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),e}}var BWe=8,AW=8,yM=5,zWe=function(){function e(t){this.group=new Me,t.add(this.group)}return e.prototype.render=function(t,r,n,i){var a=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),f=jr(t,r).refContainer,h={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},d={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},v=zt(h,f);this._prepare(n,d,u),this._renderContent(t,d,v,s,l,u,c,i),HT(o,h,f)}},e.prototype._prepare=function(t,r,n){for(var i=t;i;i=i.parentNode){var a=Ir(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+BWe*2,r.emptyItemWidth);r.totalWidth+=s+AW,r.renderList.push({node:i,text:a,width:s})}},e.prototype._renderContent=function(t,r,n,i,a,o,s,l){for(var u=0,c=r.emptyItemWidth,f=t.get(["breadcrumb","height"]),h=r.totalWidth,d=r.renderList,v=a.getModel("itemStyle").getItemStyle(),g=d.length-1;g>=0;g--){var m=d[g],x=m.node,_=m.width,b=m.text;h>n.width&&(h-=_-c,_=c,b=null);var S=new bn({shape:{points:$We(u,0,_,f,g===d.length-1,g===0)},style:Pe(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new at({style:Mt(o,{text:b})}),textConfig:{position:"inside"},z2:$v*1e4,onclick:Fe(l,x)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Mt(s,{text:b}),S.ensureState("emphasis").style=v,Gt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),FWe(S,t,x),u+=_+AW}},e.prototype.remove=function(){this.group.removeAll()},e}();function $We(e,t,r,n,i,a){var o=[[i?e:e-yM,t],[e+r,t],[e+r,t+n],[i?e:e-yM,t+n]];return!a&&o.splice(2,0,[e+r+yM,t+n/2]),!i&&o.push([e,t+n/2]),o}function FWe(e,t,r){De(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&iC(r,t)}}var VWe=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(t,r,n,i,a){return this._elExistsMap[t.id]?!1:(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:r,duration:n,delay:i,easing:a}),!0)},e.prototype.finished=function(t){return this._finishedCallback=t,this},e.prototype.start=function(){for(var t=this,r=this._storage.length,n=function(){r--,r<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,a=this._storage.length;iPW||Math.abs(r.dy)>PW)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+r.dx,y:i.y+r.dy,width:i.width,height:i.height}})}},t.prototype._onZoom=function(r){var n=r.originX,i=r.originY,a=r.scale;if(this._state!=="animating"){var o=this.seriesModel.getData().tree.root;if(!o)return;var s=o.getLayout();if(!s)return;var l=new Oe(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var f=c.zoom=c.zoom||1;if(f*=a,u){var h=u.min||0,d=u.max||1/0;f=Math.max(Math.min(d,f),h)}var v=f/c.zoom;c.zoom=f;var g=this.seriesModel.layoutInfo;n-=g.x,i-=g.y;var m=Wr();Xa(m,m,[-n,-i]),kT(m,m,[v,v]),Xa(m,m,[n,i]),l.applyTransform(m),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:l.x,y:l.y,width:l.width,height:l.height}})}},t.prototype._initEvents=function(r){var n=this;r.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&ww(u,c)}}}}},this)},t.prototype._renderBreadcrumb=function(r,n,i){var a=this;i||(i=r.get("leafDepth",!0)!=null?{node:r.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:r.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new zWe(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(Qj(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=ig(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(r){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},t.prototype._rootToNode=function(r){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},t.prototype.findTarget=function(r,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(r,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},t.type="treemap",t}(bt);function ig(){return{nodeGroup:[],background:[],content:[]}}function YWe(e,t,r,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),f=e.getData(),h=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,v=c.height,g=c.borderWidth,m=c.invisible,x=o.getRawIndex(),_=s&&s.getRawIndex(),b=o.viewChildren,S=c.upperHeight,T=b&&b.length,C=h.getModel("itemStyle"),A=h.getModel(["emphasis","itemStyle"]),P=h.getModel(["blur","itemStyle"]),I=h.getModel(["select","itemStyle"]),k=C.get("borderRadius")||0,E=le("nodeGroup",_O);if(!E)return;if(l.add(E),E.x=c.x||0,E.y=c.y||0,E.markRedraw(),Uw(E).nodeWidth=d,Uw(E).nodeHeight=v,c.isAboveViewRoot)return E;var D=le("background",MW,u,HWe);D&&G(E,D,T&&c.upperLabelHeight);var N=h.getModel("emphasis"),z=N.get("focus"),F=N.get("blurScope"),$=N.get("disabled"),Z=z==="ancestor"?o.getAncestorsIndices():z==="descendant"?o.getDescendantIndices():z;if(T)wy(E)&&Dc(E,!1),D&&(Dc(D,!$),f.setItemGraphicEl(o.dataIndex,D),CI(D,Z,F));else{var j=le("content",MW,u,UWe);j&&V(E,j),D.disableMorphing=!0,D&&wy(D)&&Dc(D,!1),Dc(E,!$),f.setItemGraphicEl(o.dataIndex,E);var U=h.getShallow("cursor");U&&j.attr("cursor",U),CI(E,Z,F)}return E;function G(ge,ne,fe){var ue=De(ne);if(ue.dataIndex=o.dataIndex,ue.seriesIndex=e.seriesIndex,ne.setShape({x:0,y:0,width:d,height:v,r:k}),m)Y(ne);else{ne.invisible=!1;var te=o.getVisual("style"),Ve=te.stroke,Se=IW(C);Se.fill=Ve;var Ge=pc(A);Ge.fill=A.get("borderColor");var Ye=pc(P);Ye.fill=P.get("borderColor");var vt=pc(I);if(vt.fill=I.get("borderColor"),fe){var Ft=d-2*g;K(ne,Ve,te.opacity,{x:g,y:0,width:Ft,height:S})}else ne.removeTextContent();ne.setStyle(Se),ne.ensureState("emphasis").style=Ge,ne.ensureState("blur").style=Ye,ne.ensureState("select").style=vt,df(ne)}ge.add(ne)}function V(ge,ne){var fe=De(ne);fe.dataIndex=o.dataIndex,fe.seriesIndex=e.seriesIndex;var ue=Math.max(d-2*g,0),te=Math.max(v-2*g,0);if(ne.culling=!0,ne.setShape({x:g,y:g,width:ue,height:te,r:k}),m)Y(ne);else{ne.invisible=!1;var Ve=o.getVisual("style"),Se=Ve.fill,Ge=IW(C);Ge.fill=Se,Ge.decal=Ve.decal;var Ye=pc(A),vt=pc(P),Ft=pc(I);K(ne,Se,Ve.opacity,null),ne.setStyle(Ge),ne.ensureState("emphasis").style=Ye,ne.ensureState("blur").style=vt,ne.ensureState("select").style=Ft,df(ne)}ge.add(ne)}function Y(ge){!ge.invisible&&a.push(ge)}function K(ge,ne,fe,ue){var te=h.getModel(ue?LW:kW),Ve=Ir(h.get("name"),null),Se=te.getShallow("show");Ur(ge,Nr(h,ue?LW:kW),{defaultText:Se?Ve:null,inheritColor:ne,defaultOpacity:fe,labelFetcher:e,labelDataIndex:o.dataIndex});var Ge=ge.getTextContent();if(Ge){var Ye=Ge.style,vt=l0(Ye.padding||0);ue&&(ge.setTextConfig({layoutRect:ue}),Ge.disableLabelLayout=!0),Ge.beforeUpdate=function(){var rr=Math.max((ue?ue.width:ge.shape.width)-vt[1]-vt[3],0),Nn=Math.max((ue?ue.height:ge.shape.height)-vt[0]-vt[2],0);(Ye.width!==rr||Ye.height!==Nn)&&Ge.setStyle({width:rr,height:Nn})},Ye.truncateMinChar=2,Ye.lineOverflow="truncate",ee(Ye,ue,c);var Ft=Ge.getState("emphasis");ee(Ft?Ft.style:null,ue,c)}}function ee(ge,ne,fe){var ue=ge?ge.text:null;if(!ne&&fe.isLeafRoot&&ue!=null){var te=e.get("drillDownIcon",!0);ge.text=te?te+" "+ue:ue}}function le(ge,ne,fe,ue){var te=_!=null&&r[ge][_],Ve=i[ge];return te?(r[ge][_]=null,he(Ve,te)):m||(te=new ne,te instanceof pa&&(te.z2=XWe(fe,ue)),Re(Ve,te)),t[ge][x]=te}function he(ge,ne){var fe=ge[x]={};ne instanceof _O?(fe.oldX=ne.x,fe.oldY=ne.y):fe.oldShape=ie({},ne.shape)}function Re(ge,ne){var fe=ge[x]={},ue=o.parentNode,te=ne instanceof Me;if(ue&&(!n||n.direction==="drillDown")){var Ve=0,Se=0,Ge=i.background[ue.getRawIndex()];!n&&Ge&&Ge.oldShape&&(Ve=Ge.oldShape.width,Se=Ge.oldShape.height),te?(fe.oldX=0,fe.oldY=Se):fe.oldShape={x:Ve,y:Se,width:0,height:0}}fe.fadein=!te}}function XWe(e,t){return e*WWe+t}var By=B,qWe=ke,Zw=-1,Hr=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=Ae(t);this.type=n,this.mappingMethod=r,this._normalizeData=QWe[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(xM(i),KWe(i)):r==="category"?i.categories?JWe(i):xM(i,!0):(xn(r!=="linear"||i.dataExtent),xM(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return me(this._normalizeData,this)},e.listVisualTypes=function(){return it(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(t,r,n){ke(t)?B(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=ae(t)?[]:ke(t)?{}:(i=!0,null);return e.eachVisual(t,function(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},e.retrieveVisuals=function(t){var r={},n;return t&&By(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(ae(t))t=t.slice();else if(qWe(t)){var r=[];By(t,function(n,i){r.push(i)}),t=r}else return[];return t.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),t},e.dependsOn=function(t,r){return r==="color"?!!(t&&t.indexOf(r)===0):t===r},e.findPieceIndex=function(t,r,n){for(var i,a=1/0,o=0,s=r.length;o=0;a--)n[a]==null&&(delete r[t[a]],t.pop())}function xM(e,t){var r=e.visual,n=[];ke(r)?By(r,function(a){n.push(a)}):r!=null&&n.push(r);var i={color:1,symbol:1};!t&&n.length===1&&!i.hasOwnProperty(e.type)&&(n[1]=n[0]),Hre(e,n)}function w_(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:bO([0,1])}}function OW(e){var t=this.option.visual;return t[Math.round(gt(e,[0,1],[0,t.length-1],!0))]||{}}function ag(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function kg(e){var t=this.option.visual;return t[this.option.loop&&e!==Zw?e%t.length:e]}function gc(){return this.option.visual[0]}function bO(e){return{linear:function(t){return gt(t,e,this.option.visual,!0)},category:kg,piecewise:function(t,r){var n=wO.call(this,r);return n==null&&(n=gt(t,e,this.option.visual,!0)),n},fixed:gc}}function wO(e){var t=this.option,r=t.pieceList;if(t.hasSpecialVisual){var n=Hr.findPieceIndex(e,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function Hre(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=se(t,function(r){var n=On(r);return n||[0,0,0,1]})),t}var QWe={linear:function(e){return gt(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,r=Hr.findPieceIndex(e,t,!0);if(r!=null)return gt(r,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return t??Zw},fixed:sr};function S_(e,t,r){return e?t<=r:t=r.length||g===r[g.depth]){var x=a8e(i,l,g,m,v,n);Zre(g,x,r,n)}})}}}function r8e(e,t,r){var n=ie({},t),i=r.designatedVisualItemStyle;return B(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function EW(e){var t=_M(e,"color");if(t){var r=_M(e,"colorAlpha"),n=_M(e,"colorSaturation");return n&&(t=ks(t,null,null,n)),r&&(t=my(t,r)),t}}function n8e(e,t){return t!=null?ks(t,null,null,e):null}function _M(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function i8e(e,t,r,n,i,a){if(!(!a||!a.length)){var o=bM(t,"color")||i.color!=null&&i.color!=="none"&&(bM(t,"colorAlpha")||bM(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=r.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var c=t.get("colorMappingBy"),f={type:o.name,dataExtent:u,visual:o.range};f.type==="color"&&(c==="index"||c==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var h=new Hr(f);return Ure(h).drColorMappingBy=c,h}}}function bM(e,t){var r=e.get(t);return ae(r)&&r.length?{name:t,range:r}:null}function a8e(e,t,r,n,i,a){var o=ie({},t);if(i){var s=i.type,l=s==="color"&&Ure(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(e.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}var zy=Math.max,Yw=Math.min,DW=rn,eR=B,Yre=["itemStyle","borderWidth"],o8e=["itemStyle","gapWidth"],s8e=["upperLabel","show"],l8e=["upperLabel","height"];const u8e={seriesType:"treemap",reset:function(e,t,r,n){var i=e.option,a=jr(e,r).refContainer,o=zt(e.getBoxLayoutParams(),a),s=i.size||[],l=ve(DW(o.width,s[0]),a.width),u=ve(DW(o.height,s[1]),a.height),c=n&&n.type,f=["treemapZoomToNode","treemapRootToNode"],h=Ry(n,f,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,v=e.getViewRoot(),g=Vre(v);if(c!=="treemapMove"){var m=c==="treemapZoomToNode"?p8e(e,h,v,l,u):d?[d.width,d.height]:[l,u],x=i.sort;x&&x!=="asc"&&x!=="desc"&&(x="desc");var _={squareRatio:i.squareRatio,sort:x,leafDepth:i.leafDepth};v.hostTree.clearLayouts();var b={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};v.setLayout(b),Xre(v,_,!1,0),b=v.getLayout(),eR(g,function(T,C){var A=(g[C+1]||v).getValue();T.setLayout(ie({dataExtent:[A,A],borderWidth:0,upperHeight:0},b))})}var S=e.getData().tree.root;S.setLayout(g8e(o,d,h),!0),e.setLayoutInfo(o),qre(S,new Oe(-o.x,-o.y,r.getWidth(),r.getHeight()),g,v,0)}};function Xre(e,t,r,n){var i,a;if(!e.isRemoved()){var o=e.getLayout();i=o.width,a=o.height;var s=e.getModel(),l=s.get(Yre),u=s.get(o8e)/2,c=Kre(s),f=Math.max(l,c),h=l-u,d=f-u;e.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),i=zy(i-2*h,0),a=zy(a-h-d,0);var v=i*a,g=c8e(e,s,v,t,r,n);if(g.length){var m={x:h,y:d,width:i,height:a},x=Yw(i,a),_=1/0,b=[];b.area=0;for(var S=0,T=g.length;S=0;l--){var u=i[n==="asc"?o-l-1:l].getValue();u/r*ts[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function v8e(e,t,r){for(var n=0,i=1/0,a=0,o=void 0,s=e.length;an&&(n=o));var l=e.area*e.area,u=t*t*r;return l?zy(u*n/l,l/(u*i)):1/0}function NW(e,t,r,n,i){var a=t===r.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=r[s[a]],c=t?e.area/t:0;(i||c>r[l[o]])&&(c=r[l[o]]);for(var f=0,h=e.length;fvI&&(u=vI),a=s}un&&(n=t);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(T[0]=-T[0],T[1]=-T[1]);var A=S[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var P=-Math.atan2(S[1],S[0]);f[0].8?"left":h[0]<-.8?"right":"center",g=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":a.x=-h[0]*x+c[0],a.y=-h[1]*_+c[1],v=h[0]>.8?"right":h[0]<-.8?"left":"center",g=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=x*A+c[0],a.y=c[1]+I,v=S[0]<0?"right":"left",a.originX=-x*A,a.originY=-I;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=C[0],a.y=C[1]+I,v="center",a.originY=-I;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-x*A+f[0],a.y=f[1]+I,v=S[0]>=0?"right":"left",a.originX=x*A,a.originY=-I;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||v})}},t}(Me),aR=function(){function e(t){this.group=new Me,this._LineCtor=t||iR}return e.prototype.updateData=function(t){var r=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=t,a||i.removeAll();var o=FW(t);t.diff(a).add(function(s){r._doAdd(t,s,o)}).update(function(s,l){r._doUpdate(a,t,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},e.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(r,n){r.updateLayout(t,n)},this)},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=FW(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!E8e(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function FW(e){var t=e.hostModel,r=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:r.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:r.get("disabled"),blurScope:r.get("blurScope"),focus:r.get("focus"),labelStatesModels:Nr(t)}}function VW(e){return isNaN(e[0])||isNaN(e[1])}function AM(e){return e&&!VW(e[0])&&!VW(e[1])}var MM=[],PM=[],kM=[],gh=tn,LM=Yl,GW=Math.abs;function WW(e,t,r){for(var n=e[0],i=e[1],a=e[2],o=1/0,s,l=r*r,u=.1,c=.1;c<=.9;c+=.1){MM[0]=gh(n[0],i[0],a[0],c),MM[1]=gh(n[1],i[1],a[1],c);var f=GW(LM(MM,t)-l);f=0?s=s+u:s=s-u:v>=0?s=s-u:s=s+u}return s}function IM(e,t){var r=[],n=py,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");u.__original||(u.__original=[Do(u[0]),Do(u[1])],u[2]&&u.__original.push(Do(u[2])));var h=u.__original;if(u[2]!=null){if(Mn(i[0],h[0]),Mn(i[1],h[2]),Mn(i[2],h[1]),c&&c!=="none"){var d=Ig(s.node1),v=WW(i,h[0],d*t);n(i[0][0],i[1][0],i[2][0],v,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],v,r),i[0][1]=r[3],i[1][1]=r[4]}if(f&&f!=="none"){var d=Ig(s.node2),v=WW(i,h[1],d*t);n(i[0][0],i[1][0],i[2][0],v,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],v,r),i[1][1]=r[1],i[2][1]=r[2]}Mn(u[0],i[0]),Mn(u[1],i[2]),Mn(u[2],i[1])}else{if(Mn(a[0],h[0]),Mn(a[1],h[1]),Il(o,a[1],a[0]),kf(o,o),c&&c!=="none"){var d=Ig(s.node1);rw(a[0],a[0],o,d*t)}if(f&&f!=="none"){var d=Ig(s.node2);rw(a[1],a[1],o,-d*t)}Mn(u[0],a[0]),Mn(u[1],a[1])}})}var ine=Je();function D8e(e){if(e)return ine(e).bridge}function HW(e,t){e&&(ine(e).bridge=t)}function UW(e){return e.type==="view"}var N8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){var i=new S0,a=new aR,o=this.group,s=new Me;this._controller=new jf(n.getZr()),this._controllerHost={target:s},s.add(i.group),s.add(a.group),o.add(s),this._symbolDraw=i,this._lineDraw=a,this._mainGroup=s,this._firstRender=!0},t.prototype.render=function(r,n,i){var a=this,o=r.coordinateSystem,s=!1;this._model=r,this._api=i,this._active=!0;var l=this._getThumbnailInfo();l&&l.bridge.reset(i);var u=this._symbolDraw,c=this._lineDraw;if(UW(o)){var f={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(f):lt(this._mainGroup,f,r)}IM(r.getGraph(),Lg(r));var h=r.getData();u.updateData(h);var d=r.getEdgeData();c.updateData(d),this._updateNodeAndLinkScale(),this._updateController(null,r,i),clearTimeout(this._layoutTimeout);var v=r.forceLayout,g=r.get(["force","layoutAnimation"]);v&&(s=!0,this._startForceLayoutIteration(v,i,g));var m=r.get("layout");h.graph.eachNode(function(S){var T=S.dataIndex,C=S.getGraphicEl(),A=S.getModel();if(C){C.off("drag").off("dragend");var P=A.get("draggable");P&&C.on("drag",function(k){switch(m){case"force":v.warmUp(),!a._layouting&&a._startForceLayoutIteration(v,i,g),v.setFixed(T),h.setItemLayout(T,[C.x,C.y]);break;case"circular":h.setItemLayout(T,[C.x,C.y]),S.setLayout({fixed:!0},!0),nR(r,"symbolSize",S,[k.offsetX,k.offsetY]),a.updateLayout(r);break;case"none":default:h.setItemLayout(T,[C.x,C.y]),rR(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){v&&v.setUnfixed(T)}),C.setDraggable(P,!!A.get("cursor"));var I=A.get(["emphasis","focus"]);I==="adjacency"&&(De(C).focus=S.getAdjacentDataIndices())}}),h.graph.eachEdge(function(S){var T=S.getGraphicEl(),C=S.getModel().get(["emphasis","focus"]);T&&C==="adjacency"&&(De(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var x=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),_=h.getLayout("cx"),b=h.getLayout("cy");h.graph.eachNode(function(S){tne(S,x,_,b)}),this._firstRender=!1,s||this._renderThumbnail(r,i,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(r,n,i){var a=this,o=!1;(function s(){r.step(function(l){a.updateLayout(a._model),(l||!o)&&(o=!0,a._renderThumbnail(a._model,n,a._symbolDraw,a._lineDraw)),(a._layouting=!l)&&(i?a._layoutTimeout=setTimeout(s,16):s())})})()},t.prototype._updateController=function(r,n,i){var a=this._controller,o=this._controllerHost,s=n.coordinateSystem;if(!UW(s)){a.disable();return}a.enable(n.get("roam"),{api:i,zInfo:{component:n},triggerInfo:{roamTrigger:n.get("roamTrigger"),isInSelf:function(l,u,c){return s.containPoint([u,c])},isInClip:function(l,u,c){return!r||r.contain(u,c)}}}),o.zoomLimit=n.get("scaleLimit"),o.zoom=s.getZoom(),a.off("pan").off("zoom").on("pan",function(l){i.dispatchAction({seriesId:n.id,type:"graphRoam",dx:l.dx,dy:l.dy})}).on("zoom",function(l){i.dispatchAction({seriesId:n.id,type:"graphRoam",zoom:l.scale,originX:l.originX,originY:l.originY})})},t.prototype.updateViewOnPan=function(r,n,i){this._active&&(Zj(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(Yj(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),IM(r.getGraph(),Lg(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=Lg(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(IM(r.getGraph(),Lg(r)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var r=this._model,n=r.coordinateSystem;if(n.type==="view"){var i=D8e(r);if(i)return{bridge:i,coordSys:n}}},t.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(r.coordSys.transform,this._api)},t.prototype._renderThumbnail=function(r,n,i,a){var o=this._getThumbnailInfo();if(o){var s=new Me,l=i.group.children(),u=a.group.children(),c=new Me,f=new Me;s.add(f),s.add(c);for(var h=0;h=0&&t.call(r,n[a],a)},e.prototype.eachEdge=function(t,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&t.call(r,n[a],a)},e.prototype.breadthFirstTraverse=function(t,r,n,i){if(r instanceof mc||(r=this._nodesMap[mh(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&!t.hasKey(v)&&(t.set(v,!0),o.push(d.node1))}for(l=0;l=0&&!t.hasKey(b)&&(t.set(b,!0),s.push(_.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),ane=function(){function e(t,r,n){this.dataIndex=-1,this.node1=t,this.node2=r,this.dataIndex=n??-1}return e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostGraph,n=r.edgeData.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var t=_e(),r=_e();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!t.hasKey(f)&&(t.set(f,!0),n.push(c.node1))}for(a=0;a=0&&!t.hasKey(g)&&(t.set(g,!0),i.push(v.node2))}return{edge:t.keys(),node:r.keys()}},e}();function one(e,t){return{getValue:function(r){var n=this[e][t];return n.getStore().get(n.getDimensionIndex(r||"value"),this.dataIndex)},setVisual:function(r,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,r,n)},getVisual:function(r){return this[e][t].getItemVisual(this.dataIndex,r)},setLayout:function(r,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,r,n)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}cr(mc,one("hostGraph","data"));cr(ane,one("hostGraph","edgeData"));function oR(e,t,r,n,i){for(var a=new j8e(n),o=0;o "+h)),u++)}var d=r.get("coordinateSystem"),v;if(d==="cartesian2d"||d==="polar"||d==="matrix")v=Jo(e,r);else{var g=Yv.get(d),m=g?g.dimensions||[]:[];We(m,"value")<0&&m.concat(["value"]);var x=Jv(e,{coordDimensions:m,encodeDefine:r.getEncode()}).dimensions;v=new En(x,r),v.initData(e)}var _=new En(["value"],r);return _.initData(l,s),i&&i(v,_),$re({mainData:v,struct:a,structAttr:"graph",datas:{node:v,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var R8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new np(i,i),this.fillDataTextStyle(r.edges||r.links),this._updateCategoriesData()},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(r){e.prototype.mergeDefaultAndTheme.apply(this,arguments),cf(r,"edgeLabel",["show"])},t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],o=this;if(a&&i){S8e(this);var s=oR(a,i,this,!0,l);return B(s.edges,function(u){T8e(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(v){var g=o._categoriesModels,m=v.getShallow("category"),x=g[m];return x&&(x.parentModel=v.parentModel,v.parentModel=x),v});var f=et.prototype.getModel;function h(v,g){var m=f.call(this,v,g);return m.resolveParentPath=d,m}c.wrapMethod("getItemModel",function(v){return v.resolveParentPath=d,v.getModel=h,v});function d(v){if(v&&(v[0]==="label"||v[1]==="label")){var g=v.slice();return v[0]==="label"?g[0]="edgeLabel":v[1]==="label"&&(g[1]="edgeLabel"),g}return v}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(r,n,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(r,i),s=a.graph.getEdgeByIndex(r),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Cr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=uee({series:this,dataIndex:r,multipleSeries:n});return f},t.prototype._updateCategoriesData=function(){var r=se(this.option.categories||[],function(i){return i.value!=null?i:ie({value:0},i)}),n=new En(["value"],this);n.initData(r),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:J.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:J.color.primary}}},t}(Tt);function B8e(e){e.registerChartView(N8e),e.registerSeriesModel(R8e),e.registerProcessor(y8e),e.registerVisual(x8e),e.registerVisual(_8e),e.registerLayout(C8e),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,M8e),e.registerLayout(k8e),e.registerCoordinateSystem("graphView",{dimensions:Rf.dimensions,create:I8e}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},sr),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},sr),e.registerAction({type:"graphRoam",event:"graphRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",query:t},function(i){var a=n.getViewOfSeriesModel(i);a&&(t.dx!=null&&t.dy!=null&&a.updateViewOnPan(i,n,t),t.zoom!=null&&t.originX!=null&&t.originY!=null&&a.updateViewOnZoom(i,n,t));var o=i.coordinateSystem,s=rC(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var ZW=function(e){q(t,e);function t(r,n,i){var a=e.call(this)||this;De(a).dataType="node",a.z2=2;var o=new at;return a.setTextContent(o),a.updateData(r,n,i,!0),a}return t.prototype.updateData=function(r,n,i,a){var o=this,s=r.graph.getNodeByIndex(n),l=r.hostModel,u=s.getModel(),c=u.getModel("emphasis"),f=r.getItemLayout(n),h=ie(Po(u.getModel("itemStyle"),f,!0),f),d=this;if(isNaN(h.startAngle)){d.setShape(h);return}a?d.setShape(h):lt(d,{shape:h},l,n);var v=ie(Po(u.getModel("itemStyle"),f,!0),f);o.setShape(v),o.useStyle(r.getItemVisual(n,"style")),Dr(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,d),Dr(d,u,"itemStyle");var g=c.get("focus");Gt(this,g==="adjacency"?s.getAdjacentDataIndices():g,c.get("blurScope"),c.get("disabled"))},t.prototype._updateLabel=function(r,n,i){var a=this.getTextContent(),o=i.getLayout(),s=(o.startAngle+o.endAngle)/2,l=Math.cos(s),u=Math.sin(s),c=n.getModel("label");a.ignore=!c.get("show");var f=Nr(n),h=i.getVisual("style");Ur(a,f,{labelFetcher:{getFormattedLabel:function(_,b,S,T,C,A){return r.getFormattedLabel(_,b,"node",T,li(C,f.normal&&f.normal.get("formatter"),n.get("name")),A)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:h.fill,defaultOpacity:h.opacity,defaultOutsidePosition:"startArc"});var d=c.get("position")||"outside",v=c.get("distance")||0,g;d==="outside"?g=o.r+v:g=(o.r+o.r0)/2,this.textConfig={inside:d!=="outside"};var m=d!=="outside"?c.get("align")||"center":l>0?"left":"right",x=d!=="outside"?c.get("verticalAlign")||"middle":u>0?"top":"bottom";a.attr({x:l*g+o.cx,y:u*g+o.cy,rotation:0,style:{align:m,verticalAlign:x}})},t}(_n),z8e=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return De(o).dataType="edge",o.updateData(r,n,i,a,!0),o}return t.prototype.buildPath=function(r,n){r.moveTo(n.s1[0],n.s1[1]);var i=.7,a=n.clockwise;r.arc(n.cx,n.cy,n.r,n.sStartAngle,n.sEndAngle,!a),r.bezierCurveTo((n.cx-n.s2[0])*i+n.s2[0],(n.cy-n.s2[1])*i+n.s2[1],(n.cx-n.t1[0])*i+n.t1[0],(n.cy-n.t1[1])*i+n.t1[1],n.t1[0],n.t1[1]),r.arc(n.cx,n.cy,n.r,n.tStartAngle,n.tEndAngle,!a),r.bezierCurveTo((n.cx-n.t2[0])*i+n.t2[0],(n.cy-n.t2[1])*i+n.t2[1],(n.cx-n.s1[0])*i+n.s1[0],(n.cy-n.s1[1])*i+n.s1[1],n.s1[0],n.s1[1]),r.closePath()},t.prototype.updateData=function(r,n,i,a,o){var s=r.hostModel,l=n.graph.getEdgeByIndex(i),u=l.getLayout(),c=l.node1.getModel(),f=n.getItemModel(l.dataIndex),h=f.getModel("lineStyle"),d=f.getModel("emphasis"),v=d.get("focus"),g=ie(Po(c.getModel("itemStyle"),u,!0),u),m=this;if(isNaN(g.sStartAngle)||isNaN(g.tStartAngle)){m.setShape(g);return}o?(m.setShape(g),YW(m,l,r,h)):(ga(m),YW(m,l,r,h),lt(m,{shape:g},s,i)),Gt(this,v==="adjacency"?l.getAdjacentDataIndices():v,d.get("blurScope"),d.get("disabled")),Dr(m,f,"lineStyle"),n.setItemGraphicEl(l.dataIndex,m)},t}(tt);function YW(e,t,r,n){var i=t.node1,a=t.node2,o=e.style;e.setStyle(n.getLineStyle());var s=n.get("color");switch(s){case"source":o.fill=r.getItemVisual(i.dataIndex,"style").fill,o.decal=i.getVisual("style").decal;break;case"target":o.fill=r.getItemVisual(a.dataIndex,"style").fill,o.decal=a.getVisual("style").decal;break;case"gradient":var l=r.getItemVisual(i.dataIndex,"style").fill,u=r.getItemVisual(a.dataIndex,"style").fill;if(pe(l)&&pe(u)){var c=e.shape,f=(c.s1[0]+c.s2[0])/2,h=(c.s1[1]+c.s2[1])/2,d=(c.t1[0]+c.t2[0])/2,v=(c.t1[1]+c.t2[1])/2;o.fill=new Lf(f,h,d,v,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var $8e=Math.PI/180,F8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){},t.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group,l=-r.get("startAngle")*$8e;if(a.diff(o).add(function(c){var f=a.getItemLayout(c);if(f){var h=new ZW(a,c,l);De(h).dataIndex=c,s.add(h)}}).update(function(c,f){var h=o.getItemGraphicEl(f),d=a.getItemLayout(c);if(!d){h&&Ls(h,r,f);return}h?h.updateData(a,c,l):h=new ZW(a,c,l),s.add(h)}).remove(function(c){var f=o.getItemGraphicEl(c);f&&Ls(f,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=ve(u[0],i.getWidth()),this.group.originY=ve(u[1],i.getHeight()),Dt(this.group,{scaleX:1,scaleY:1},r)}this._data=a,this.renderEdges(r,l)},t.prototype.renderEdges=function(r,n){var i=r.getData(),a=r.getEdgeData(),o=this._edgeData,s=this.group;a.diff(o).add(function(l){var u=new z8e(i,a,l,n);De(u).dataIndex=l,s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(i,a,l,n),s.add(c)}).remove(function(l){var u=o.getItemGraphicEl(l);u&&Ls(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(bt),V8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links),this.legendVisualProvider=new np(me(this.getData,this),me(this.getRawData,this))},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links)},t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[];if(a&&i){var o=oR(a,i,this,!0,s);return o.data}function s(l,u){var c=et.prototype.getModel;function f(d,v){var g=c.call(this,d,v);return g.resolveParentPath=h,g}u.wrapMethod("getItemModel",function(d){return d.resolveParentPath=h,d.getModel=f,d});function h(d){if(d&&(d[0]==="label"||d[1]==="label")){var v=d.slice();return d[0]==="label"?v[0]="edgeLabel":d[1]==="label"&&(v[1]="edgeLabel"),v}return d}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(r,n,i){var a=this.getDataParams(r,i);if(i==="edge"){var o=this.getData(),s=o.graph.getEdgeByIndex(r),l=o.getName(s.node1.dataIndex),u=o.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Cr("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return Cr("nameValue",{name:a.name,value:a.value,noValue:a.value==null})},t.prototype.getDataParams=function(r,n){var i=e.prototype.getDataParams.call(this,r,n);if(n==="node"){var a=this.getData(),o=this.getGraph().getNodeByIndex(r);if(i.name==null&&(i.name=a.getName(r)),i.value==null){var s=o.getLayout().value;i.value=s}}return i},t.type="series.chord",t.defaultOption={z:2,coordinateSystem:"none",legendHoverLink:!0,colorBy:"data",left:0,top:0,right:0,bottom:0,width:null,height:null,center:["50%","50%"],radius:["70%","80%"],clockwise:!0,startAngle:90,endAngle:"auto",minAngle:0,padAngle:3,itemStyle:{borderRadius:[0,0,5,5]},lineStyle:{width:0,color:"source",opacity:.2},label:{show:!0,position:"outside",distance:5},emphasis:{focus:"adjacency",lineStyle:{opacity:.5}}},t}(Tt),OM=Math.PI/180;function G8e(e,t){e.eachSeriesByType("chord",function(r){W8e(r,t)})}function W8e(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=PQ(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=Math.max((e.get("padAngle")||0)*OM,0),h=Math.max((e.get("minAngle")||0)*OM,0),d=-e.get("startAngle")*OM,v=d+Math.PI*2,g=e.get("clockwise"),m=g?1:-1,x=[d,v];BT(x,!g);var _=x[0],b=x[1],S=b-_,T=r.getSum("value")===0&&i.getSum("value")===0,C=[],A=0;n.eachEdge(function(j){var U=T?1:j.getValue("value");T&&(U>0||h)&&(A+=2);var G=j.node1.dataIndex,V=j.node2.dataIndex;C[G]=(C[G]||0)+U,C[V]=(C[V]||0)+U});var P=0;if(n.eachNode(function(j){var U=j.getValue("value");isNaN(U)||(C[j.dataIndex]=Math.max(U,C[j.dataIndex]||0)),!T&&(C[j.dataIndex]>0||h)&&A++,P+=C[j.dataIndex]||0}),!(A===0||P===0)){f*A>=Math.abs(S)&&(f=Math.max(0,(Math.abs(S)-h*A)/A)),(f+h)*A>=Math.abs(S)&&(h=(Math.abs(S)-f*A)/A);var I=(S-f*A*m)/P,k=0,E=0,D=0;n.eachNode(function(j){var U=C[j.dataIndex]||0,G=I*(P?U:1)*m;Math.abs(G)E){var z=k/E;n.eachNode(function(j){var U=j.getLayout().angle;Math.abs(U)>=h?j.setLayout({angle:U*z,ratio:z},!0):j.setLayout({angle:h,ratio:h===0?1:U/h},!0)})}else n.eachNode(function(j){if(!N){var U=j.getLayout().angle,G=Math.min(U/D,1),V=G*k;U-Vh&&h>0){var G=N?1:Math.min(U/D,1),V=U-h,Y=Math.min(V,Math.min(F,k*G));F-=Y,j.setLayout({angle:U-Y,ratio:(U-Y)/U},!0)}else h>0&&j.setLayout({angle:h,ratio:U===0?1:h/U},!0)}});var $=_,Z=[];n.eachNode(function(j){var U=Math.max(j.getLayout().angle,h);j.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:$,endAngle:$+U*m,clockwise:g},!0),Z[j.dataIndex]=$,$+=(U+f)*m}),n.eachEdge(function(j){var U=T?1:j.getValue("value"),G=I*(P?U:1)*m,V=j.node1.dataIndex,Y=Z[V]||0,K=Math.abs((j.node1.getLayout().ratio||1)*G),ee=Y+K*m,le=[s+c*Math.cos(Y),l+c*Math.sin(Y)],he=[s+c*Math.cos(ee),l+c*Math.sin(ee)],Re=j.node2.dataIndex,ge=Z[Re]||0,ne=Math.abs((j.node2.getLayout().ratio||1)*G),fe=ge+ne*m,ue=[s+c*Math.cos(ge),l+c*Math.sin(ge)],te=[s+c*Math.cos(fe),l+c*Math.sin(fe)];j.setLayout({s1:le,s2:he,sStartAngle:Y,sEndAngle:ee,t1:ue,t2:te,tStartAngle:ge,tEndAngle:fe,cx:s,cy:l,r:c,value:U,clockwise:g}),Z[V]=ee,Z[Re]=fe})}}}function H8e(e){e.registerChartView(F8e),e.registerSeriesModel(V8e),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,G8e),e.registerProcessor(tp("chord"))}var U8e=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),Z8e=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="pointer",n}return t.prototype.getDefaultShape=function(){return new U8e},t.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),c=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,c),r.lineTo(n.x+i(l)*s,n.y+a(l)*s),r.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),r.lineTo(n.x-i(l)*s,n.y-a(l)*s),r.lineTo(u,c)},t}(tt);function Y8e(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=ve(r[0],t.getWidth()),s=ve(r[1],t.getHeight()),l=ve(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function C_(e,t){var r=e==null?"":e+"";return t&&(pe(t)?r=t.replace("{value}",r):Ce(t)&&(r=t(e))),r}var X8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){this.group.removeAll();var a=r.get(["axisLine","lineStyle","color"]),o=Y8e(r,i);this._renderMain(r,n,i,a,o),this._data=r.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(r,n,i,a,o){var s=this.group,l=r.get("clockwise"),u=-r.get("startAngle")/180*Math.PI,c=-r.get("endAngle")/180*Math.PI,f=r.getModel("axisLine"),h=f.get("roundCap"),d=h?Fw:_n,v=f.get("show"),g=f.getModel("lineStyle"),m=g.get("width"),x=[u,c];BT(x,!l),u=x[0],c=x[1];for(var _=c-u,b=u,S=[],T=0;v&&T=I&&(k===0?0:a[k-1][0])Math.PI/2&&(ee+=Math.PI)):K==="tangential"?ee=-P-Math.PI/2:ot(K)&&(ee=K*Math.PI/180),ee===0?f.add(new at({style:Mt(b,{text:U,x:V,y:Y,verticalAlign:F<-.8?"top":F>.8?"bottom":"middle",align:z<-.4?"left":z>.4?"right":"center"},{inheritColor:G}),silent:!0})):f.add(new at({style:Mt(b,{text:U,x:V,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:G}),silent:!0,originX:V,originY:Y,rotation:ee}))}if(_.get("show")&&$!==S){var Z=_.get("distance");Z=Z?Z+c:c;for(var le=0;le<=T;le++){z=Math.cos(P),F=Math.sin(P);var he=new mr({shape:{x1:z*(v-Z)+h,y1:F*(v-Z)+d,x2:z*(v-A-Z)+h,y2:F*(v-A-Z)+d},silent:!0,style:D});D.stroke==="auto"&&he.setStyle({stroke:a(($+le/T)/S)}),f.add(he),P+=k}P-=k}else P+=I}},t.prototype._renderPointer=function(r,n,i,a,o,s,l,u,c){var f=this.group,h=this._data,d=this._progressEls,v=[],g=r.get(["pointer","show"]),m=r.getModel("progress"),x=m.get("show"),_=r.getData(),b=_.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),C=[S,T],A=[s,l];function P(k,E){var D=_.getItemModel(k),N=D.getModel("pointer"),z=ve(N.get("width"),o.r),F=ve(N.get("length"),o.r),$=r.get(["pointer","icon"]),Z=N.get("offsetCenter"),j=ve(Z[0],o.r),U=ve(Z[1],o.r),G=N.get("keepAspect"),V;return $?V=xr($,j-z/2,U-F,z,F,null,G):V=new Z8e({shape:{angle:-Math.PI/2,width:z,r:F,x:j,y:U}}),V.rotation=-(E+Math.PI/2),V.x=o.cx,V.y=o.cy,V}function I(k,E){var D=m.get("roundCap"),N=D?Fw:_n,z=m.get("overlap"),F=z?m.get("width"):c/_.count(),$=z?o.r-F:o.r-(k+1)*F,Z=z?o.r:o.r-k*F,j=new N({shape:{startAngle:s,endAngle:E,cx:o.cx,cy:o.cy,clockwise:u,r0:$,r:Z}});return z&&(j.z2=gt(_.get(b,k),[S,T],[100,0],!0)),j}(x||g)&&(_.diff(h).add(function(k){var E=_.get(b,k);if(g){var D=P(k,s);Dt(D,{rotation:-((isNaN(+E)?A[0]:gt(E,C,A,!0))+Math.PI/2)},r),f.add(D),_.setItemGraphicEl(k,D)}if(x){var N=I(k,s),z=m.get("clip");Dt(N,{shape:{endAngle:gt(E,C,A,z)}},r),f.add(N),bI(r.seriesIndex,_.dataType,k,N),v[k]=N}}).update(function(k,E){var D=_.get(b,k);if(g){var N=h.getItemGraphicEl(E),z=N?N.rotation:s,F=P(k,z);F.rotation=z,lt(F,{rotation:-((isNaN(+D)?A[0]:gt(D,C,A,!0))+Math.PI/2)},r),f.add(F),_.setItemGraphicEl(k,F)}if(x){var $=d[E],Z=$?$.shape.endAngle:s,j=I(k,Z),U=m.get("clip");lt(j,{shape:{endAngle:gt(D,C,A,U)}},r),f.add(j),bI(r.seriesIndex,_.dataType,k,j),v[k]=j}}).execute(),_.each(function(k){var E=_.getItemModel(k),D=E.getModel("emphasis"),N=D.get("focus"),z=D.get("blurScope"),F=D.get("disabled");if(g){var $=_.getItemGraphicEl(k),Z=_.getItemVisual(k,"style"),j=Z.fill;if($ instanceof Yr){var U=$.style;$.useStyle(ie({image:U.image,x:U.x,y:U.y,width:U.width,height:U.height},Z))}else $.useStyle(Z),$.type!=="pointer"&&$.setColor(j);$.setStyle(E.getModel(["pointer","itemStyle"]).getItemStyle()),$.style.fill==="auto"&&$.setStyle("fill",a(gt(_.get(b,k),C,[0,1],!0))),$.z2EmphasisLift=0,Dr($,E),Gt($,N,z,F)}if(x){var G=v[k];G.useStyle(_.getItemVisual(k,"style")),G.setStyle(E.getModel(["progress","itemStyle"]).getItemStyle()),G.z2EmphasisLift=0,Dr(G,E),Gt(G,N,z,F)}}),this._progressEls=v)},t.prototype._renderAnchor=function(r,n){var i=r.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),c=xr(s,n.cx-o/2+ve(l[0],n.r),n.cy-o/2+ve(l[1],n.r),o,o,null,u);c.z2=i.get("showAbove")?1:0,c.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(c)}},t.prototype._renderTitleAndDetail=function(r,n,i,a,o){var s=this,l=r.getData(),u=l.mapDimension("value"),c=+r.get("min"),f=+r.get("max"),h=new Me,d=[],v=[],g=r.isAnimationEnabled(),m=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(x){d[x]=new at({silent:!0}),v[x]=new at({silent:!0})}).update(function(x,_){d[x]=s._titleEls[_],v[x]=s._detailEls[_]}).execute(),l.each(function(x){var _=l.getItemModel(x),b=l.get(u,x),S=new Me,T=a(gt(b,[c,f],[0,1],!0)),C=_.getModel("title");if(C.get("show")){var A=C.get("offsetCenter"),P=o.cx+ve(A[0],o.r),I=o.cy+ve(A[1],o.r),k=d[x];k.attr({z2:m?0:2,style:Mt(C,{x:P,y:I,text:l.getName(x),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(k)}var E=_.getModel("detail");if(E.get("show")){var D=E.get("offsetCenter"),N=o.cx+ve(D[0],o.r),z=o.cy+ve(D[1],o.r),F=ve(E.get("width"),o.r),$=ve(E.get("height"),o.r),Z=r.get(["progress","show"])?l.getItemVisual(x,"style").fill:T,k=v[x],j=E.get("formatter");k.attr({z2:m?0:2,style:Mt(E,{x:N,y:z,text:C_(b,j),width:isNaN(F)?null:F,height:isNaN($)?null:$,align:"center",verticalAlign:"middle"},{inheritColor:Z})}),cQ(k,{normal:E},b,function(G){return C_(G,j)}),g&&fQ(k,x,l,r,{getFormattedLabel:function(G,V,Y,K,ee,le){return C_(le?le.interpolatedValue:b,j)}}),S.add(k)}h.add(S)}),this.group.add(h),this._titleEls=d,this._detailEls=v},t.type="gauge",t}(bt),q8e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.visualStyleAccessPath="itemStyle",r}return t.prototype.getInitialData=function(r,n){return rp(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,J.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:J.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:J.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:J.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:J.color.neutral00,borderWidth:0,borderColor:J.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:J.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:J.color.transparent,borderWidth:0,borderColor:J.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:J.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Tt);function K8e(e){e.registerChartView(X8e),e.registerSeriesModel(q8e)}var J8e=["itemStyle","opacity"],Q8e=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new an,s=new at;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(r,n,!0),i}return t.prototype.updateData=function(r,n,i){var a=this,o=r.hostModel,s=r.getItemModel(n),l=r.getItemLayout(n),u=s.getModel("emphasis"),c=s.get(J8e);c=c??1,i||ga(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Dt(a,{style:{opacity:c}},o,n)):lt(a,{style:{opacity:c},shape:{points:l.points}},o,n),Dr(a,s),this._updateLabel(r,n),Gt(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=r.hostModel,l=r.getItemModel(n),u=r.getItemLayout(n),c=u.label,f=r.getItemVisual(n,"style"),h=f.fill;Ur(o,Nr(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:f.opacity,defaultText:r.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}});var d=l.getModel("label"),v=d.get("color"),g=v==="inherit"?h:null;i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:g,outsideFill:g});var m=c.linePoints;a.setShape({points:m}),i.textGuideLineConfig={anchor:m?new Ie(m[0][0],m[0][1]):null},lt(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),Ej(i,Dj(l),{stroke:h})},t}(bn),eHe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.ignoreLabelLineUpdate=!0,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new Q8e(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);Ls(u,r,l)}).execute(),this._data=a},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(bt),tHe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new np(me(this.getData,this),me(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return rp(this,{coordDimensions:["value"],encodeDefaulter:Fe(sj,this)})},t.prototype._defaultLabelLine=function(r){cf(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},t.prototype.getDataParams=function(r){var n=this.getData(),i=e.prototype.getDataParams.call(this,r),a=n.mapDimension("value"),o=n.getSum(a);return i.percent=o?+(n.get(a,r)/o*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series.funnel",t.defaultOption={coordinateSystemUsage:"box",z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:65,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:J.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:J.color.primary}}},t}(Tt);function rHe(e,t){for(var r=e.mapDimension("value"),n=e.mapArray(r,function(l){return l}),i=[],a=t==="ascending",o=0,s=e.count();oyHe)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!(this._mouseDownPoint||!DM(this,"mousemove"))){var t=this._model,r=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=r.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:r.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function DM(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var bHe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(r){var n=this.option;r&&He(n,r,!0),this._initDimensions()},t.prototype.contains=function(r,n){var i=r.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},t.prototype.setAxisExpand=function(r){B(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){r.hasOwnProperty(n)&&(this.option[n]=r[n])},this)},t.prototype._initDimensions=function(){var r=this.dimensions=[],n=this.parallelAxisIndex=[],i=ht(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);B(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}(Ke),wHe=function(e){q(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return t.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},t}(ba);function hu(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=yh(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=yh(s,[0,o]),i=a=yh(s,[i,a]),n=0}t[0]=yh(t[0],r),t[1]=yh(t[1],r);var l=NM(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=yh(t[n],c);var f;return f=NM(t,n),i!=null&&(f.sign!==l.sign||f.spana&&(t[1-n]=t[n]+f.sign*a),t}function NM(e,t){var r=e[t]-e[1-t];return{span:Math.abs(r),sign:r>0?-1:r<0?1:t?-1:1}}function yh(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var jM=B,lne=Math.min,une=Math.max,KW=Math.floor,SHe=Math.ceil,JW=gr,THe=Math.PI,CHe=function(){function e(t,r,n){this.type="parallel",this._axesMap=_e(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,r,n)}return e.prototype._init=function(t,r,n){var i=t.dimensions,a=t.parallelAxisIndex;jM(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new wHe(o,b0(u),[0,0],u.get("type"),l)),f=c.type==="category";c.onBand=f&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},e.prototype.update=function(t,r){this._updateAxesFromSeries(this._model,t)},e.prototype.containPoint=function(t){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,o=t[1-a],s=t[a];return o>=n&&o<=n+r.axisLength&&s>=i&&s<=i+r.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(t,r){r.eachSeries(function(n){if(t.contains(n,r)){var i=n.getData();jM(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),mf(o.scale,o.model)},this)}},this)},e.prototype.resize=function(t,r){var n=jr(t,r).refContainer;this._rect=zt(t.getBoxLayoutParams(),n),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var t=this._model,r=this._rect,n=["x","y"],i=["width","height"],a=t.get("layout"),o=a==="horizontal"?0:1,s=r[i[o]],l=[0,s],u=this.dimensions.length,c=A_(t.get("axisExpandWidth"),l),f=A_(t.get("axisExpandCount")||0,[0,u]),h=t.get("axisExpandable")&&u>3&&u>f&&f>1&&c>0&&s>0,d=t.get("axisExpandWindow"),v;if(d)v=A_(d[1]-d[0],l),d[1]=d[0]+v;else{v=A_(c*(f-1),l);var g=t.get("axisExpandCenter")||KW(u/2);d=[c*g-v/2],d[1]=d[0]+v}var m=(s-v)/(u-f);m<3&&(m=0);var x=[KW(JW(d[0]/c,1))+1,SHe(JW(d[1]/c,1))-1],_=m/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:r[n[o]],layoutLength:s,axisBase:r[n[1-o]],axisLength:r[i[1-o]],axisExpandable:h,axisExpandWidth:c,axisCollapseWidth:m,axisExpandWindow:d,axisCount:u,winInnerIndices:x,axisExpandWindow0Pos:_}},e.prototype._layoutAxes=function(){var t=this._rect,r=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;r.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),jM(n,function(o,s){var l=(i.axisExpandable?MHe:AHe)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:THe/2,vertical:0},f=[u[a].x+t.x,u[a].y+t.y],h=c[a],d=Wr();Qs(d,d,h),Xa(d,d,f),this._axesLayout[o]={position:f,rotation:h,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},e.prototype.getAxis=function(t){return this._axesMap.get(t)},e.prototype.dataToPoint=function(t,r){return this.axisCoordToPoint(this._axesMap.get(r).dataToCoord(t),r)},e.prototype.eachActiveState=function(t,r,n,i){n==null&&(n=0),i==null&&(i=t.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];B(o,function(m){s.push(t.mapDimension(m)),l.push(a.get(m).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-f[0])?(u="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=r.axisExpandWidth/c,l?hu(l,i,o,"all"):u="none";else{var d=i[1]-i[0],v=o[1]*s/d;i=[une(0,v-d/2)],i[1]=lne(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function A_(e,t){return lne(une(e,t[0]),t[1])}function AHe(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function MHe(e,t){var r=t.layoutLength,n=t.axisExpandWidth,i=t.axisCount,a=t.axisCollapseWidth,o=t.winInnerIndices,s,l=a,u=!1,c;return e=0;i--)Ai(n[i])},t.prototype.getActiveState=function(r){var n=this.activeIntervals;if(!n.length)return"normal";if(r==null||isNaN(+r))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=r&&r<=i[1])return"active"}else for(var a=0,o=n.length;aOHe}function pne(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function gne(e,t,r,n){var i=new Me;return i.add(new Xe({name:"main",style:fR(r),silent:!0,draggable:!0,cursor:"move",drift:Fe(t8,e,t,i,["n","s","w","e"]),ondragend:Fe(xf,t,{isEnd:!0})})),B(n,function(a){i.add(new Xe({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Fe(t8,e,t,i,a),ondragend:Fe(xf,t,{isEnd:!0})}))}),i}function mne(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=cv(i,EHe),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,c=r[0][1],f=r[1][1],h=c-a+i/2,d=f-a+i/2,v=c-o,g=f-s,m=v+i,x=g+i;ls(e,t,"main",o,s,v,g),n.transformable&&(ls(e,t,"w",l,u,a,x),ls(e,t,"e",h,u,a,x),ls(e,t,"n",l,u,m,a),ls(e,t,"s",l,d,m,a),ls(e,t,"nw",l,u,a,a),ls(e,t,"ne",h,u,a,a),ls(e,t,"sw",l,d,a,a),ls(e,t,"se",h,d,a,a))}function PO(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(fR(r)),i.attr({silent:!n,cursor:n?"move":"default"}),B([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?kO(e,a[0]):zHe(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?NHe[s]+"-resize":null})})}function ls(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(FHe(hR(e,t,[[n,i],[n+a,i+o]])))}function fR(e){return Pe({strokeNoScale:!0},e.brushStyle)}function yne(e,t,r,n){var i=[Fy(e,r),Fy(t,n)],a=[cv(e,r),cv(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function BHe(e){return Jl(e.group)}function kO(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=VT(r[t],BHe(e));return n[i]}function zHe(e,t){var r=[kO(e,t[0]),kO(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function t8(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=xne(t,i,a);B(n,function(u){var c=DHe[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(yne(s[0][0],s[1][0],s[0][1],s[1][1])),lR(t,r),xf(t,{isEnd:!1})}function $He(e,t,r,n){var i=t.__brushOption.range,a=xne(e,r,n);B(i,function(o){o[0]+=a[0],o[1]+=a[1]}),lR(e,t),xf(e,{isEnd:!1})}function xne(e,t,r){var n=e.group,i=n.transformCoordToLocal(t,r),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function hR(e,t,r){var n=vne(e,t);return n&&n!==yf?n.clipPath(r,e._transform):Ae(r)}function FHe(e){var t=Fy(e[0][0],e[1][0]),r=Fy(e[0][1],e[1][1]),n=cv(e[0][0],e[1][0]),i=cv(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function VHe(e,t,r){if(!(!e._brushType||WHe(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=cR(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var oC={lineX:i8(0),lineY:i8(1),rect:{createCover:function(e,t){function r(n){return n}return gne({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=pne(e);return yne(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){mne(e,t,r,n)},updateCommon:PO,contain:IO},polygon:{createCover:function(e,t){var r=new Me;return r.add(new an({name:"main",style:fR(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new bn({name:"main",draggable:!0,drift:Fe($He,e,t),ondragend:Fe(xf,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:hR(e,t,r)})},updateCommon:PO,contain:IO}};function i8(e){return{createCover:function(t,r){return gne({toRectRange:function(n){var i=[n,[0,100]];return e&&i.reverse(),i},fromRectRange:function(n){return n[e]}},t,r,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var r=pne(t),n=Fy(r[0][e],r[1][e]),i=cv(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=vne(t,r);if(o!==yf&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[n,a];e&&l.reverse(),mne(t,r,l,i)},updateCommon:PO,contain:IO}}function bne(e){return e=dR(e),function(t){return VN(t,e)}}function wne(e,t){return e=dR(e),function(r){var n=t??r,i=n?e.width:e.height,a=n?e.x:e.y;return[a,a+(i||0)]}}function Sne(e,t,r){var n=dR(e);return function(i,a){return n.contain(a[0],a[1])&&!Pre(i,t,r)}}function dR(e){return Oe.create(e)}var HHe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){e.prototype.init.apply(this,arguments),(this._brushController=new sR(n.getZr())).on("brush",me(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!UHe(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Me,this.group.add(this._axisGroup),!!r.get("show")){var s=YHe(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,f=r.axis.dim,h=l.getAxisLayout(f),d=ie({strokeContainThreshold:c},h),v=new Wn(r,i,d);v.build(),this._axisGroup.add(v.group),this._refreshBrushController(d,u,r,s,c,i),m0(o,this._axisGroup,r)}}},t.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),f=Oe.create({x:l[0],y:-o/2,width:u,height:o});f.x-=c,f.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:bne(f),isTargetByCursor:Sne(f,s,a),getLinearBrushOtherExtent:wne(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(ZHe(i))},t.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=se(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(kt);function UHe(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function ZHe(e){var t=e.axis;return se(e.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(r[0],!0),t.dataToCoord(r[1],!0)]}})}function YHe(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var XHe={type:"axisAreaSelect",event:"axisAreaSelected"};function qHe(e){e.registerAction(XHe,function(t,r){r.eachComponent({mainType:"parallelAxis",query:t},function(n){n.axis.model.setActiveIntervals(t.intervals)})}),e.registerAction("parallelAxisExpand",function(t,r){r.eachComponent({mainType:"parallel",query:t},function(n){n.setAxisExpand(t)})})}var KHe={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Tne(e){e.registerComponentView(xHe),e.registerComponentModel(bHe),e.registerCoordinateSystem("parallel",kHe),e.registerPreprocessor(pHe),e.registerComponentModel(AO),e.registerComponentView(HHe),lv(e,"parallel",AO,KHe),qHe(e)}function JHe(e){Ze(Tne),e.registerChartView(sHe),e.registerSeriesModel(cHe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,vHe)}var QHe=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return e}(),eUe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new QHe},t.prototype.buildPath=function(r,n){var i=n.extent;r.moveTo(n.x1,n.y1),r.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(r.lineTo(n.x2+i,n.y2),r.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(r.lineTo(n.x2,n.y2+i),r.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),r.closePath()},t.prototype.highlight=function(){Gs(this)},t.prototype.downplay=function(){Ws(this)},t}(tt),tUe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._mainGroup=new Me,r._focusAdjacencyDisabled=!1,r}return t.prototype.init=function(r,n){this._controller=new jf(n.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(r,n,i){var a=this,o=r.getGraph(),s=this._mainGroup,l=r.layoutInfo,u=l.width,c=l.height,f=r.getData(),h=r.getData("edge"),d=r.get("orient");this._model=r,s.removeAll(),s.x=l.x,s.y=l.y,this._updateViewCoordSys(r,i),kre(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(v){var g=new eUe,m=De(g);m.dataIndex=v.dataIndex,m.seriesIndex=r.seriesIndex,m.dataType="edge";var x=v.getModel(),_=x.getModel("lineStyle"),b=_.get("curveness"),S=v.node1.getLayout(),T=v.node1.getModel(),C=T.get("localX"),A=T.get("localY"),P=v.node2.getLayout(),I=v.node2.getModel(),k=I.get("localX"),E=I.get("localY"),D=v.getLayout(),N,z,F,$,Z,j,U,G;g.shape.extent=Math.max(1,D.dy),g.shape.orient=d,d==="vertical"?(N=(C!=null?C*u:S.x)+D.sy,z=(A!=null?A*c:S.y)+S.dy,F=(k!=null?k*u:P.x)+D.ty,$=E!=null?E*c:P.y,Z=N,j=z*(1-b)+$*b,U=F,G=z*b+$*(1-b)):(N=(C!=null?C*u:S.x)+S.dx,z=(A!=null?A*c:S.y)+D.sy,F=k!=null?k*u:P.x,$=(E!=null?E*c:P.y)+D.ty,Z=N*(1-b)+F*b,j=z,U=N*b+F*(1-b),G=$),g.setShape({x1:N,y1:z,x2:F,y2:$,cpx1:Z,cpy1:j,cpx2:U,cpy2:G}),g.useStyle(_.getItemStyle()),a8(g.style,d,v);var V=""+x.get("value"),Y=Nr(x,"edgeLabel");Ur(g,Y,{labelFetcher:{getFormattedLabel:function(le,he,Re,ge,ne,fe){return r.getFormattedLabel(le,he,"edge",ge,li(ne,Y.normal&&Y.normal.get("formatter"),V),fe)}},labelDataIndex:v.dataIndex,defaultText:V}),g.setTextConfig({position:"inside"});var K=x.getModel("emphasis");Dr(g,x,"lineStyle",function(le){var he=le.getItemStyle();return a8(he,d,v),he}),s.add(g),h.setItemGraphicEl(v.dataIndex,g);var ee=K.get("focus");Gt(g,ee==="adjacency"?v.getAdjacentDataIndices():ee==="trajectory"?v.getTrajectoryDataIndices():ee,K.get("blurScope"),K.get("disabled"))}),o.eachNode(function(v){var g=v.getLayout(),m=v.getModel(),x=m.get("localX"),_=m.get("localY"),b=m.getModel("emphasis"),S=m.get(["itemStyle","borderRadius"])||0,T=new Xe({shape:{x:x!=null?x*u:g.x,y:_!=null?_*c:g.y,width:g.dx,height:g.dy,r:S},style:m.getModel("itemStyle").getItemStyle(),z2:10});Ur(T,Nr(m),{labelFetcher:{getFormattedLabel:function(A,P){return r.getFormattedLabel(A,P,"node")}},labelDataIndex:v.dataIndex,defaultText:v.id}),T.disableLabelAnimation=!0,T.setStyle("fill",v.getVisual("color")),T.setStyle("decal",v.getVisual("style").decal),Dr(T,m),s.add(T),f.setItemGraphicEl(v.dataIndex,T),De(T).dataType="node";var C=b.get("focus");Gt(T,C==="adjacency"?v.getAdjacentDataIndices():C==="trajectory"?v.getTrajectoryDataIndices():C,b.get("blurScope"),b.get("disabled"))}),f.eachItemGraphicEl(function(v,g){var m=f.getItemModel(g);m.get("draggable")&&(v.drift=function(x,_){a._focusAdjacencyDisabled=!0,this.shape.x+=x,this.shape.y+=_,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:f.getRawIndex(g),localX:this.shape.x/u,localY:this.shape.y/c})},v.ondragend=function(){a._focusAdjacencyDisabled=!1},v.draggable=!0,v.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(rUe(s.getBoundingRect(),r,function(){s.removeClipPath()})),this._data=r.getData()},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._updateViewCoordSys=function(r,n){var i=r.layoutInfo,a=i.width,o=i.height,s=r.coordinateSystem=new Rf(null,{api:n,ecModel:r.ecModel});s.zoomLimit=r.get("scaleLimit"),s.setBoundingRect(0,0,a,o),s.setCenter(r.get("center")),s.setZoom(r.get("zoom")),this._controllerHost.target.attr({x:s.x,y:s.y,scaleX:s.scaleX,scaleY:s.scaleY})},t.type="sankey",t}(bt);function a8(e,t,r){switch(e.fill){case"source":e.fill=r.node1.getVisual("color"),e.decal=r.node1.getVisual("style").decal;break;case"target":e.fill=r.node2.getVisual("color"),e.decal=r.node2.getVisual("style").decal;break;case"gradient":var n=r.node1.getVisual("color"),i=r.node2.getVisual("color");pe(n)&&pe(i)&&(e.fill=new Lf(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function rUe(e,t,r){var n=new Xe({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Dt(n,{shape:{width:e.width+20}},t,r),n}var nUe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],o=r.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new et(o[l],this,n));var u=oR(a,i,this,!0,c);return u.data;function c(f,h){f.wrapMethod("getItemModel",function(d,v){var g=d.parentModel,m=g.getData().getItemLayout(v);if(m){var x=m.depth,_=g.levelModels[x];_&&(d.parentModel=_)}return d}),h.wrapMethod("getItemModel",function(d,v){var g=d.parentModel,m=g.getGraph().getEdgeByIndex(v),x=m.node1.getLayout();if(x){var _=x.depth,b=g.levelModels[_];b&&(d.parentModel=b)}return d})}},t.prototype.setNodePosition=function(r,n){var i=this.option.data||this.option.nodes,a=i[r];a.localX=n[0],a.localY=n[1]},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(r,n,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var o=this.getDataParams(r,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return Cr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(r),f=c.getLayout().value,h=this.getDataParams(r,i).data.name;return Cr("nameValue",{name:h!=null?h+"":null,value:f,noValue:a(f)})}},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(r,n){var i=e.prototype.getDataParams.call(this,r,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(r),o=a.getLayout().value;i.value=o}return i},t.type="series.sankey",t.layoutMode="box",t.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:J.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:J.color.primary}},animationEasing:"linear",animationDuration:1e3},t}(Tt);function iUe(e,t){e.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=jr(r,t).refContainer,o=zt(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,f=u.edges;oUe(c);var h=ht(c,function(m){return m.getLayout().value===0}),d=h.length!==0?0:r.get("layoutIterations"),v=r.get("orient"),g=r.get("nodeAlign");aUe(c,f,n,i,s,l,d,v,g)})}function aUe(e,t,r,n,i,a,o,s,l){sUe(e,t,r,i,a,s,l),fUe(e,t,a,i,n,o,s),_Ue(e,s)}function oUe(e){B(e,function(t){var r=tu(t.outEdges,Xw),n=tu(t.inEdges,Xw),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function sUe(e,t,r,n,i,a,o){for(var s=[],l=[],u=[],c=[],f=0,h=0;h=0;x&&m.depth>d&&(d=m.depth),g.setLayout({depth:x?m.depth:f},!0),a==="vertical"?g.setLayout({dy:r},!0):g.setLayout({dx:r},!0);for(var _=0;_f-1?d:f-1;o&&o!=="left"&&lUe(e,o,a,A);var P=a==="vertical"?(i-r)/A:(n-r)/A;cUe(e,P,a)}function Cne(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function lUe(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,vUe(s,l,o),RM(s,i,r,n,o),xUe(s,l,o),RM(s,i,r,n,o)}function hUe(e,t){var r=[],n=t==="vertical"?"y":"x",i=gI(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),B(i.keys,function(a){r.push(i.buckets.get(a))}),r}function dUe(e,t,r,n,i,a){var o=1/0;B(e,function(s){var l=s.length,u=0;B(s,function(f){u+=f.getLayout().value});var c=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;c0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[h]+t;var v=i==="vertical"?n:r;if(u=c-t-v,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=f-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[h]+t-c,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function vUe(e,t,r){B(e.slice().reverse(),function(n){B(n,function(i){if(i.outEdges.length){var a=tu(i.outEdges,pUe,r)/tu(i.outEdges,Xw);if(isNaN(a)){var o=i.outEdges.length;a=o?tu(i.outEdges,gUe,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-du(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-du(i,r))*t;i.setLayout({y:l},!0)}}})})}function pUe(e,t){return du(e.node2,t)*e.getValue()}function gUe(e,t){return du(e.node2,t)}function mUe(e,t){return du(e.node1,t)*e.getValue()}function yUe(e,t){return du(e.node1,t)}function du(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function Xw(e){return e.getValue()}function tu(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),B(n,function(s){var l=new Hr({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:t.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&B(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function wUe(e){e.registerChartView(tUe),e.registerSeriesModel(nUe),e.registerLayout(iUe),e.registerVisual(bUe),e.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,r){r.eachComponent({mainType:"series",subType:"sankey",query:t},function(n){n.setNodePosition(t.dataIndex,[t.localX,t.localY])})}),e.registerAction({type:"sankeyRoam",event:"sankeyRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",subType:"sankey",query:t},function(i){var a=i.coordinateSystem,o=rC(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var Ane=function(){function e(){}return e.prototype._hasEncodeRule=function(t){var r=this.getEncode();return r&&r.get(t)!=null},e.prototype.getInitialData=function(t,r){var n,i=r.getComponent("xAxis",this.get("xAxisIndex")),a=r.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(t.layout="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"?(t.layout="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")):t.layout=t.layout||"horizontal";var u=["x","y"],c=t.layout==="horizontal"?0:1,f=this._baseAxisDim=u[c],h=u[1-c],d=[i,a],v=d[c].get("type"),g=d[1-c].get("type"),m=t.data;if(m&&l){var x=[];B(m,function(S,T){var C;ae(S)?(C=S.slice(),S.unshift(T)):ae(S.value)?(C=ie({},S),C.value=C.value.slice(),S.value.unshift(T)):C=S,x.push(C)}),t.data=x}var _=this.defaultValueDimensions,b=[{name:f,type:Ow(v),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:Ow(g),dimsDef:_.slice()}];return rp(this,{coordDimensions:b,dimensionsCount:_.length+1,encodeDefaulter:Fe(jQ,b,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),Mne=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],r.visualDrawType="stroke",r}return t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:J.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:J.color.shadow}},animationDuration:800},t}(Tt);cr(Mne,Ane,!0);var SUe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=r.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),f=o8(c,a,u,l,!0);a.setItemGraphicEl(u,f),o.add(f)}}).update(function(u,c){var f=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(f);return}var h=a.getItemLayout(u);f?(ga(f),Pne(h,f,a,u)):f=o8(h,a,u,l),o.add(f),a.setItemGraphicEl(u,f)}).remove(function(u){var c=s.getItemGraphicEl(u);c&&o.remove(c)}).execute(),this._data=a},t.prototype.remove=function(r){var n=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&n.remove(a)})},t.type="boxplot",t}(bt),TUe=function(){function e(){}return e}(),CUe=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="boxplotBoxPath",n}return t.prototype.getDefaultShape=function(){return new TUe},t.prototype.buildPath=function(r,n){var i=n.points,a=0;for(r.moveTo(i[a][0],i[a][1]),a++;a<4;a++)r.lineTo(i[a][0],i[a][1]);for(r.closePath();ag){var S=[x,b];n.push(S)}}}return{boxData:r,outliers:n}}var OUe={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==on){var n="";mt(n)}var i=IUe(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function EUe(e){e.registerSeriesModel(Mne),e.registerChartView(SUe),e.registerLayout(MUe),e.registerTransform(OUe)}var DUe=["itemStyle","borderColor"],NUe=["itemStyle","borderColor0"],jUe=["itemStyle","borderColorDoji"],RUe=["itemStyle","color"],BUe=["itemStyle","color0"];function vR(e,t){return t.get(e>0?RUe:BUe)}function pR(e,t){return t.get(e===0?jUe:e>0?DUe:NUe)}var zUe={seriesType:"candlestick",plan:Xv(),performRawSeries:!0,reset:function(e,t){if(!t.isSeriesFiltered(e)){var r=e.pipelineContext.large;return!r&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=vR(s,o),l.stroke=pR(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");ie(u,l)}}}}}},$Ue=["color","borderColor"],FUe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(r),this._isLargeDraw?this._renderLarge(r):this._renderNormal(r)},t.prototype.incrementalPrepareRender=function(r,n,i){this._clear(),this._updateDrawMode(r)},t.prototype.incrementalRender=function(r,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(r,n):this._incrementalRenderNormal(r,n)},t.prototype.eachRendered=function(r){Au(this._progressiveEls||this.group,r)},t.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},t.prototype._renderNormal=function(r){var n=r.getData(),i=this._data,a=this.group,o=n.getLayout("isSimpleBox"),s=r.get("clip",!0),l=r.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),n.diff(i).add(function(c){if(n.hasValue(c)){var f=n.getItemLayout(c);if(s&&s8(u,f))return;var h=BM(f,c,!0);Dt(h,{shape:{points:f.ends}},r,c),zM(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}}).update(function(c,f){var h=i.getItemGraphicEl(f);if(!n.hasValue(c)){a.remove(h);return}var d=n.getItemLayout(c);if(s&&s8(u,d)){a.remove(h);return}h?(lt(h,{shape:{points:d.ends}},r,c),ga(h)):h=BM(d),zM(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}).remove(function(c){var f=i.getItemGraphicEl(c);f&&a.remove(f)}).execute(),this._data=n},t.prototype._renderLarge=function(r){this._clear(),l8(r,this.group);var n=r.get("clip",!0)?T0(r.coordinateSystem,!1,r):null;n?this.group.setClipPath(n):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o;(o=r.next())!=null;){var s=i.getItemLayout(o),l=BM(s);zM(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){l8(n,this.group,this._progressiveEls,!0)},t.prototype.remove=function(r){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(bt),VUe=function(){function e(){}return e}(),GUe=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="normalCandlestickBox",n}return t.prototype.getDefaultShape=function(){return new VUe},t.prototype.buildPath=function(r,n){var i=n.points;this.__simpleBox?(r.moveTo(i[4][0],i[4][1]),r.lineTo(i[6][0],i[6][1])):(r.moveTo(i[0][0],i[0][1]),r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]),r.lineTo(i[3][0],i[3][1]),r.closePath(),r.moveTo(i[4][0],i[4][1]),r.lineTo(i[5][0],i[5][1]),r.moveTo(i[6][0],i[6][1]),r.lineTo(i[7][0],i[7][1]))},t}(tt);function BM(e,t,r){var n=e.ends;return new GUe({shape:{points:r?WUe(n,e):n},z2:100})}function s8(e,t){for(var r=!0,n=0;nT?E[a]:k[a],ends:z,brushRect:U(C,A,b)})}function Z(V,Y){var K=[];return K[i]=Y,K[a]=V,isNaN(Y)||isNaN(V)?[NaN,NaN]:t.dataToPoint(K)}function j(V,Y,K){var ee=Y.slice(),le=Y.slice();ee[i]=fb(ee[i]+n/2,1,!1),le[i]=fb(le[i]-n/2,1,!0),K?V.push(ee,le):V.push(le,ee)}function U(V,Y,K){var ee=Z(V,K),le=Z(Y,K);return ee[i]-=n/2,le[i]-=n/2,{x:ee[0],y:ee[1],width:n,height:le[1]-ee[1]}}function G(V){return V[i]=fb(V[i],1),V}}function v(g,m){for(var x=Ao(g.count*4),_=0,b,S=[],T=[],C,A=m.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(C=g.next())!=null;){var I=A.get(s,C),k=A.get(u,C),E=A.get(c,C),D=A.get(f,C),N=A.get(h,C);if(isNaN(I)||isNaN(D)||isNaN(N)){x[_++]=NaN,_+=3;continue}x[_++]=u8(A,C,k,E,c,P),S[i]=I,S[a]=D,b=t.dataToPoint(S,null,T),x[_++]=b?b[0]:NaN,x[_++]=b?b[1]:NaN,S[a]=N,b=t.dataToPoint(S,null,T),x[_++]=b?b[1]:NaN}m.setLayout("largePoints",x)}}};function u8(e,t,r,n,i,a){var o;return r>n?o=-1:r0?e.get(i,t-1)<=n?1:-1:1,o}function YUe(e,t){var r=e.getBaseAxis(),n,i=r.type==="category"?r.getBandWidth():(n=r.getExtent(),Math.abs(n[1]-n[0])/t.count()),a=ve(be(e.get("barMaxWidth"),i),i),o=ve(be(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?ve(s,i):Math.max(Math.min(i/2,a),o)}function XUe(e){e.registerChartView(FUe),e.registerSeriesModel(kne),e.registerPreprocessor(UUe),e.registerVisual(zUe),e.registerLayout(ZUe)}function c8(e,t){var r=t.rippleEffectColor||t.color;e.eachChild(function(n){n.attr({z:t.z,zlevel:t.zlevel,style:{stroke:t.brushType==="stroke"?r:null,fill:t.brushType==="fill"?r:null}})})}var qUe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new w0(r,n),o=new Me;return i.add(a),i.add(o),i.updateData(r,n),i}return t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(r){for(var n=r.symbolType,i=r.color,a=r.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var h=void 0;Ce(f)?h=f(i):h=f,a.__t>0&&(h=-s*a.__t),this._animateSymbol(a,s,h,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},t.prototype._animateSymbol=function(r,n,i,a,o){if(n>0){r.__t=0;var s=this,l=r.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(r)});a||l.done(function(){s.remove(r)}),l.start()}},t.prototype._getLineLength=function(r){return xs(r.__p1,r.__cp1)+xs(r.__cp1,r.__p2)},t.prototype._updateAnimationPoints=function(r,n){r.__p1=n[0],r.__p2=n[1],r.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},t.prototype.updateData=function(r,n,i){this.childAt(0).updateData(r,n,i),this._updateEffectSymbol(r,n)},t.prototype._updateSymbolPosition=function(r){var n=r.__p1,i=r.__p2,a=r.__cp1,o=r.__t<1?r.__t:2-r.__t,s=[r.x,r.y],l=s.slice(),u=tn,c=eI;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var f=r.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),h=r.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(h,f)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(r.__lastT!==void 0&&r.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-2)}var c=(n-a[l])/(a[l+1]-a[l]),f=i[l],h=i[l+1];r.x=f[0]*(1-c)+c*h[0],r.y=f[1]*(1-c)+c*h[1];var d=r.__t<1?h[0]-f[0]:f[0]-h[0],v=r.__t<1?h[1]-f[1]:f[1]-h[1];r.rotation=-Math.atan2(v,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},t}(Lne),t7e=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),r7e=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new t7e},t.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){r.moveTo(i[o++],i[o++]);for(var l=1;l0){var d=(u+f)/2-(c-h)*a,v=(c+h)/2-(f-u)*a;r.quadraticCurveTo(d,v,f,h)}else r.lineTo(f,h)}this.incremental&&(this._off=o,this.notClear=!0)},t.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var f=a[u++],h=a[u++],d=1;d0){var m=(f+v)/2-(h-g)*o,x=(h+g)/2-(v-f)*o;if(IJ(f,h,m,x,v,g,s,r,n))return l}else if(bl(f,h,v,g,s,r,n))return l;l++}return-1},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+t.__startIndex)})},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),One={seriesType:"lines",plan:Xv(),reset:function(e){var t=e.coordinateSystem;if(t){var r=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var u=0,c=i.start;c0&&(c||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var f=r.get("clip",!0)&&T0(r.coordinateSystem,!1,r);f?this.group.setClipPath(f):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},t.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateLineDraw(a,r);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},t.prototype.incrementalRender=function(r,n,i){this._lineDraw.incrementalUpdate(r,n.getData()),this._finished=r.end===n.getData().count()},t.prototype.eachRendered=function(r){this._lineDraw&&this._lineDraw.eachRendered(r)},t.prototype.updateTransform=function(r,n,i){var a=r.getData(),o=r.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=One.reset(r,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},t.prototype._updateLineDraw=function(r,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new n7e:new aR(o?a?e7e:Ine:a?Lne:iR),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},t.prototype._showEffect=function(r){return!!r.get(["effect","show"])},t.prototype._clearLayer=function(r){var n=r.getZr(),i=n.painter.getType()==="svg";!i&&this._lastZlevel!=null&&n.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(r,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},t.prototype.dispose=function(r,n){this.remove(r,n)},t.type="lines",t}(bt),a7e=typeof Uint32Array>"u"?Array:Uint32Array,o7e=typeof Float64Array>"u"?Array:Float64Array;function f8(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=se(t,function(r){var n=[r[0].coord,r[1].coord],i={coords:n};return r[0].name&&(i.fromName=r[0].name),r[1].name&&(i.toName=r[1].name),AT([i,r[0],r[1]])}))}var s7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.visualStyleAccessPath="lineStyle",r.visualDrawType="stroke",r}return t.prototype.init=function(r){r.data=r.data||[],f8(r);var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(r){if(f8(r),r.data){var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(r){var n=this._processFlatCoordsArray(r.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=qd(this._flatCoords,n.flatCoords),this._flatCoordsOffset=qd(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),r.data=new Float32Array(n.count)),this.getRawData().appendData(r.data)},t.prototype._getCoordsFromItemModel=function(r){var n=this.getData().getItemModel(r),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},t.prototype.getLineCoordsCount=function(r){return this._flatCoordsOffset?this._flatCoordsOffset[r*2+1]:this._getCoordsFromItemModel(r).length},t.prototype.getLineCoords=function(r,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[r*2],a=this._flatCoordsOffset[r*2+1],o=0;o ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?1e4:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?2e4:this.get("progressiveThreshold"))},t.prototype.getZLevelKey=function(){var r=this.getModel("effect"),n=r.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:r.get("show")&&n>0?n+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(Tt);function M_(e){return e instanceof Array||(e=[e,e]),e}var l7e={seriesType:"lines",reset:function(e){var t=M_(e.get("symbol")),r=M_(e.get("symbolSize")),n=e.getData();n.setVisual("fromSymbol",t&&t[0]),n.setVisual("toSymbol",t&&t[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,o){var s=a.getItemModel(o),l=M_(s.getShallow("symbol",!0)),u=M_(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function u7e(e){e.registerChartView(i7e),e.registerSeriesModel(s7e),e.registerLayout(One),e.registerVisual(l7e)}var c7e=256,f7e=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=ui.createCanvas();this.canvas=t}return e.prototype.update=function(t,r,n,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,f=this.canvas,h=f.getContext("2d"),d=t.length;f.width=r,f.height=n;for(var v=0;v0){var D=o(b)?l:u;b>0&&(b=b*k+P),T[C++]=D[E],T[C++]=D[E+1],T[C++]=D[E+2],T[C++]=D[E+3]*b*256}else C+=4}return h.putImageData(S,0,0),f},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=ui.createCanvas()),r=this.pointSize+this.blurSize,n=r*2;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor=J.color.neutral99,i.beginPath(),i.arc(-r,r,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),t},e.prototype._getGradient=function(t,r){for(var n=this._gradientPixels,i=n[r]||(n[r]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)t[r](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},e}();function h7e(e,t,r){var n=e[1]-e[0];t=se(t,function(o){return{interval:[(o.interval[0]-e[0])/n,(o.interval[1]-e[0])/n]}});var i=t.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=t[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=t[0]&&n<=t[1]}}function h8(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var v7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a;n.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===r&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=r.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"||o.type==="matrix"?this._renderOnGridLike(r,i,0,r.getData().count()):h8(o)&&this._renderOnGeo(o,r,a,i)},t.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},t.prototype.incrementalRender=function(r,n,i,a){var o=n.coordinateSystem;o&&(h8(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){Au(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=fu(s,"cartesian2d"),u=fu(s,"matrix"),c,f,h,d;if(l){var v=s.getAxis("x"),g=s.getAxis("y");c=v.getBandWidth()+.5,f=g.getBandWidth()+.5,h=v.scale.getExtent(),d=g.scale.getExtent()}for(var m=this.group,x=r.getData(),_=r.getModel(["emphasis","itemStyle"]).getItemStyle(),b=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),C=Nr(r),A=r.getModel("emphasis"),P=A.get("focus"),I=A.get("blurScope"),k=A.get("disabled"),E=l||u?[x.mapDimension("x"),x.mapDimension("y"),x.mapDimension("value")]:[x.mapDimension("time"),x.mapDimension("value")],D=i;Dh[1]||$d[1])continue;var Z=s.dataToPoint([F,$]);N=new Xe({shape:{x:Z[0]-c/2,y:Z[1]-f/2,width:c,height:f},style:z})}else if(u){var j=s.dataToLayout([x.get(E[0],D),x.get(E[1],D)]).rect;if(gn(j.x))continue;N=new Xe({z2:1,shape:j,style:z})}else{if(isNaN(x.get(E[1],D)))continue;var U=s.dataToLayout([x.get(E[0],D)]),j=U.contentRect||U.rect;if(gn(j.x)||gn(j.y))continue;N=new Xe({z2:1,shape:j,style:z})}if(x.hasItemOption){var G=x.getItemModel(D),V=G.getModel("emphasis");_=V.getModel("itemStyle").getItemStyle(),b=G.getModel(["blur","itemStyle"]).getItemStyle(),S=G.getModel(["select","itemStyle"]).getItemStyle(),T=G.get(["itemStyle","borderRadius"]),P=V.get("focus"),I=V.get("blurScope"),k=V.get("disabled"),C=Nr(G)}N.shape.r=T;var Y=r.getRawValue(D),K="-";Y&&Y[2]!=null&&(K=Y[2]+""),Ur(N,C,{labelFetcher:r,labelDataIndex:D,defaultOpacity:z.opacity,defaultText:K}),N.ensureState("emphasis").style=_,N.ensureState("blur").style=b,N.ensureState("select").style=S,Gt(N,P,I,k),N.incremental=o,o&&(N.states.emphasis.hoverLayer=!0),m.add(N),x.setItemGraphicEl(D,N),this._progressiveEls&&this._progressiveEls.push(N)}},t.prototype._renderOnGeo=function(r,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new f7e;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var c=r.getViewRect().clone(),f=r.getRoamTransform();c.applyTransform(f);var h=Math.max(c.x,0),d=Math.max(c.y,0),v=Math.min(c.width+c.x,a.getWidth()),g=Math.min(c.height+c.y,a.getHeight()),m=v-h,x=g-d,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],b=l.mapArray(_,function(A,P,I){var k=r.dataToPoint([A,P]);return k[0]-=h,k[1]-=d,k.push(I),k}),S=i.getExtent(),T=i.type==="visualMap.continuous"?d7e(S,i.option.range):h7e(S,i.getPieceList(),i.option.selected);u.update(b,m,x,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var C=new Yr({style:{width:m,height:x,x:h,y:d,image:u.canvas},silent:!0});this.group.add(C)},t.type="heatmap",t}(bt),p7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return Jo(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=Yv.get(this.get("coordinateSystem"));if(r&&r.dimensions)return r.dimensions[0]==="lng"&&r.dimensions[1]==="lat"},t.type="series.heatmap",t.dependencies=["grid","geo","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:J.color.primary}}},t}(Tt);function g7e(e){e.registerChartView(v7e),e.registerSeriesModel(p7e)}var m7e=["itemStyle","borderWidth"],d8=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],VM=new Ko,y7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group,o=r.getData(),s=this._data,l=r.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),f=l.master.getRect(),h={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:c,valueDim:d8[+c],categoryDim:d8[1-+c]};o.diff(s).add(function(v){if(o.hasValue(v)){var g=p8(o,v),m=v8(o,v,g,h),x=g8(o,h,m);o.setItemGraphicEl(v,x),a.add(x),y8(x,h,m)}}).update(function(v,g){var m=s.getItemGraphicEl(g);if(!o.hasValue(v)){a.remove(m);return}var x=p8(o,v),_=v8(o,v,x,h),b=Bne(o,_);m&&b!==m.__pictorialShapeStr&&(a.remove(m),o.setItemGraphicEl(v,null),m=null),m?C7e(m,h,_):m=g8(o,h,_,!0),o.setItemGraphicEl(v,m),m.__pictorialSymbolMeta=_,a.add(m),y8(m,h,_)}).remove(function(v){var g=s.getItemGraphicEl(v);g&&m8(s,v,g.__pictorialSymbolMeta.animationModel,g)}).execute();var d=r.get("clip",!0)?T0(r.coordinateSystem,!1,r):null;return d?a.setClipPath(d):a.removeClipPath(),this._data=o,this.group},t.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(o){m8(a,De(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(bt);function v8(e,t,r,n){var i=e.getItemLayout(t),a=r.get("symbolRepeat"),o=r.get("symbolClip"),s=r.get("symbolPosition")||"start",l=r.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=r.get("symbolPatternSize")||2,f=r.isAnimationEnabled(),h={dataIndex:t,layout:i,itemModel:r,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:r.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:f?r:null,hoverScale:f&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};x7e(r,a,i,n,h),_7e(e,t,i,a,o,h.boundingLength,h.pxSign,c,n,h),b7e(r,h.symbolScale,u,n,h);var d=h.symbolSize,v=Df(r.get("symbolOffset"),d);return w7e(r,d,i,a,o,v,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,n,h),h}function x7e(e,t,r,n,i){var a=n.valueDim,o=e.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(r[a.wh]<=0),c;if(ae(o)){var f=[GM(s,o[0])-l,GM(s,o[1])-l];f[1]=0?1:-1:c>0?1:-1}function GM(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function _7e(e,t,r,n,i,a,o,s,l,u){var c=l.valueDim,f=l.categoryDim,h=Math.abs(r[f.wh]),d=e.getItemVisual(t,"symbolSize"),v;ae(d)?v=d.slice():d==null?v=["100%","100%"]:v=[d,d],v[f.index]=ve(v[f.index],h),v[c.index]=ve(v[c.index],n?h:Math.abs(a)),u.symbolSize=v;var g=u.symbolScale=[v[0]/s,v[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*o}function b7e(e,t,r,n,i){var a=e.get(m7e)||0;a&&(VM.attr({scaleX:t[0],scaleY:t[1],rotation:r}),VM.updateTransform(),a/=VM.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function w7e(e,t,r,n,i,a,o,s,l,u,c,f){var h=c.categoryDim,d=c.valueDim,v=f.pxSign,g=Math.max(t[d.index]+s,0),m=g;if(n){var x=Math.abs(l),_=rn(e.get("symbolMargin"),"15%")+"",b=!1;_.lastIndexOf("!")===_.length-1&&(b=!0,_=_.slice(0,_.length-1));var S=ve(_,t[d.index]),T=Math.max(g+S*2,0),C=b?0:S*2,A=CN(n),P=A?n:x8((x+C)/T),I=x-P*g;S=I/2/(b?P:Math.max(P-1,1)),T=g+S*2,C=b?0:S*2,!A&&n!=="fixed"&&(P=u?x8((Math.abs(u)+C)/T):0),m=P*T-C,f.repeatTimes=P,f.symbolMargin=S}var k=v*(m/2),E=f.pathPosition=[];E[h.index]=r[h.wh]/2,E[d.index]=o==="start"?k:o==="end"?l-k:l/2,a&&(E[0]+=a[0],E[1]+=a[1]);var D=f.bundlePosition=[];D[h.index]=r[h.xy],D[d.index]=r[d.xy];var N=f.barRectShape=ie({},r);N[d.wh]=v*Math.max(Math.abs(r[d.wh]),Math.abs(E[d.index]+k)),N[h.wh]=r[h.wh];var z=f.clipShape={};z[h.xy]=-r[h.xy],z[h.wh]=c.ecSize[h.wh],z[d.xy]=0,z[d.wh]=r[d.wh]}function Ene(e){var t=e.symbolPatternSize,r=xr(e.symbolType,-t/2,-t/2,t,t);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function Dne(e,t,r,n){var i=e.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=t.valueDim,u=r.repeatTimes||0,c=0,f=a[t.valueDim.index]+o+r.symbolMargin*2;for(gR(e,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c0:x<0)&&(_=u-1-g),m[l.index]=f*(_-u/2+.5)+s[l.index],{x:m[0],y:m[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function Nne(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?gd(a,null,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation},r,n):(a=e.__pictorialMainPath=Ene(r),i.add(a),gd(a,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:0,scaleY:0,rotation:r.rotation},{scaleX:r.symbolScale[0],scaleY:r.symbolScale[1]},r,n))}function jne(e,t,r){var n=ie({},t.barRectShape),i=e.__pictorialBarRect;i?gd(i,null,{shape:n},t,r):(i=e.__pictorialBarRect=new Xe({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function Rne(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=ie({},r.clipShape),o=t.valueDim,s=r.animationModel,l=r.dataIndex;if(i)lt(i,{shape:a},s,l);else{a[o.wh]=0,i=new Xe({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],If[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function p8(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=S7e,r.isAnimationEnabled=T7e,r}function S7e(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function T7e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function g8(e,t,r,n){var i=new Me,a=new Me;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?Dne(i,t,r):Nne(i,t,r),jne(i,r,n),Rne(i,t,r,n),i.__pictorialShapeStr=Bne(e,r),i.__pictorialSymbolMeta=r,i}function C7e(e,t,r){var n=r.animationModel,i=r.dataIndex,a=e.__pictorialBundle;lt(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?Dne(e,t,r,!0):Nne(e,t,r,!0),jne(e,r,!0),Rne(e,t,r,!0)}function m8(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];gR(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),B(a,function(o){cu(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function Bne(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function gR(e,t,r){B(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function gd(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&If[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function y8(e,t,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=a.get("focus"),f=a.get("blurScope"),h=a.get("scale");gR(e,function(g){if(g instanceof Yr){var m=g.style;g.useStyle(ie({image:m.image,x:m.x,y:m.y,width:m.width,height:m.height},r.style))}else g.useStyle(r.style);var x=g.ensureState("emphasis");x.style=o,h&&(x.scaleX=g.scaleX*1.1,x.scaleY=g.scaleY*1.1),g.ensureState("blur").style=s,g.ensureState("select").style=l,u&&(g.cursor=u),g.z2=r.z2});var d=t.valueDim.posDesc[+(r.boundingLength>0)],v=e.__pictorialBarRect;v.ignoreClip=!0,Ur(v,Nr(i),{labelFetcher:t.seriesModel,labelDataIndex:n,defaultText:sv(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Gt(e,c,f,a.get("disabled"))}function x8(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var A7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r.defaultSymbol="roundRect",r}return t.prototype.getInitialData=function(r){return r.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=Mu(Ny.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:J.color.primary}}}),t}(Ny);function M7e(e){e.registerChartView(y7e),e.registerSeriesModel(A7e),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(ite,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,ate("pictorialBar"))}var P7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._layers=[],r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this,s=this.group,l=r.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,f=u.boundaryGap;s.x=0,s.y=c.y+f[0];function h(m){return m.name}var d=new Hs(this._layersSeries||[],l,h,h),v=[];d.add(me(g,this,"add")).update(me(g,this,"update")).remove(me(g,this,"remove")).execute();function g(m,x,_){var b=o._layers;if(m==="remove"){s.remove(b[x]);return}for(var S=[],T=[],C,A=l[x].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=f)}return{y0:i,max:a}}function E7e(e){e.registerChartView(P7e),e.registerSeriesModel(L7e),e.registerLayout(I7e),e.registerProcessor(tp("themeRiver"))}var D7e=2,N7e=4,b8=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=D7e,o.textConfig={inside:!0},De(o).seriesIndex=n.seriesIndex;var s=new at({z2:N7e,silent:r.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,r,n,i,a),o}return t.prototype.updateData=function(r,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;De(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),c=n.getLayout(),f=ie({},c);f.label=null;var h=n.getVisual("style");h.lineJoin="bevel";var d=n.getVisual("decal");d&&(h.decal=iv(d,o));var v=Po(l.getModel("itemStyle"),f,!0);ie(f,v),B(Zn,function(_){var b=s.ensureState(_),S=l.getModel([_,"itemStyle"]);b.style=S.getItemStyle();var T=Po(S,f);T&&(b.shape=T)}),r?(s.setShape(f),s.shape.r=c.r0,Dt(s,{shape:{r:c.r}},i,n.dataIndex)):(lt(s,{shape:f},i),ga(s)),s.useStyle(h),this._updateLabel(i);var g=l.getShallow("cursor");g&&s.attr("cursor",g),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var m=u.get("focus"),x=m==="relative"?qd(n.getAncestorsIndices(),n.getDescendantIndices()):m==="ancestor"?n.getAncestorsIndices():m==="descendant"?n.getDescendantIndices():m;Gt(this,x,u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),f=this,h=f.getTextContent(),d=this.node.dataIndex,v=a.get("minAngle")/180*Math.PI,g=a.get("show")&&!(v!=null&&Math.abs(s)z&&!Qd($-z)&&$0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,r,n,i):(o.virtualPiece=new b8(_,r,n,i),c.add(o.virtualPiece)),b.piece.off("click"),o.virtualPiece.on("click",function(S){o._rootToNode(b.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},t.prototype._initEvents=function(){var r=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=r.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")r._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";ww(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:OO,from:this.uid,seriesId:this.seriesModel.id,targetNode:r})},t.prototype.containPoint=function(r,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=r[0]-a.cx,s=r[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},t.type="sunburst",t}(bt),z7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.ignoreStyleOnData=!0,r}return t.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};zne(i);var a=this._levelModels=se(r.levels||[],function(l){return new et(l,this,n)},this),o=Jj.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var f=o.getNodeByDataIndex(c),h=a[f.depth];return h&&(u.parentModel=h),u})}return o.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treePathInfo=iC(i,this),n},t.prototype.getLevelModel=function(r){return this._levelModels&&this._levelModels[r.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},t.prototype.enableAriaDecal=function(){Gre(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t}(Tt);function zne(e){var t=0;B(e.children,function(n){zne(n);var i=n.value;ae(i)&&(i=i[0]),t+=i});var r=e.value;ae(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ae(e.value)?e.value[0]=r:e.value=r}var S8=Math.PI/180;function $7e(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");ae(a)||(a=[0,a]),ae(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=ve(i[0],o),c=ve(i[1],s),f=ve(a[0],l/2),h=ve(a[1],l/2),d=-n.get("startAngle")*S8,v=n.get("minAngle")*S8,g=n.getData().tree.root,m=n.getViewRoot(),x=m.depth,_=n.get("sort");_!=null&&$ne(m,_);var b=0;B(m.children,function($){!isNaN($.getValue())&&b++});var S=m.getValue(),T=Math.PI/(S||b)*2,C=m.depth>0,A=m.height-(C?-1:1),P=(h-f)/(A||1),I=n.get("clockwise"),k=n.get("stillShowZeroSum"),E=I?1:-1,D=function($,Z){if($){var j=Z;if($!==g){var U=$.getValue(),G=S===0&&k?T:U*T;G1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&pe(s)&&(s=lw(s,(n.depth-1)/(a-1)*.5)),s}e.eachSeriesByType("sunburst",function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");ie(u,l)})})}function G7e(e){e.registerChartView(B7e),e.registerSeriesModel(z7e),e.registerLayout(Fe($7e,"sunburst")),e.registerProcessor(Fe(tp,"sunburst")),e.registerVisual(V7e),R7e(e)}var T8={color:"fill",borderColor:"stroke"},W7e={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Is=Je(),H7e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(r,n){return Jo(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=Is(i).info),a},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(Tt);function U7e(e,t){return t=t||[0,0],se(["x","y"],function(r,n){var i=this.getAxis(r),a=t[n],o=e[n]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function Z7e(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r){return e.dataToPoint(r)},size:me(U7e,e)}}}function Y7e(e,t){return t=t||[0,0],se([0,1],function(r){var n=t[r],i=e[r]/2,a=[],o=[];return a[r]=n-i,o[r]=n+i,a[1-r]=o[1-r]=t[1-r],Math.abs(this.dataToPoint(a)[r]-this.dataToPoint(o)[r])},this)}function X7e(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(r){return e.dataToPoint(r)},size:me(Y7e,e)}}}function q7e(e,t){var r=this.getAxis(),n=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return r.type==="category"?r.getBandWidth():Math.abs(r.dataToCoord(n-i)-r.dataToCoord(n+i))}function K7e(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r){return e.dataToPoint(r)},size:me(q7e,e)}}}function J7e(e,t){return t=t||[0,0],se(["Radius","Angle"],function(r,n){var i="get"+r+"Axis",a=this[i](),o=t[n],s=e[n]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return r==="Angle"&&(l=l*Math.PI/180),l},this)}function Q7e(e){var t=e.getRadiusAxis(),r=e.getAngleAxis(),n=t.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=t.dataToRadius(i[0]),o=r.dataToAngle(i[1]),s=e.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:me(J7e,e)}}}function e9e(e){var t=e.getRect(),r=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:r.start,end:r.end,weeks:r.weeks,dayCount:r.allDay}},api:{coord:function(n,i){return e.dataToPoint(n,i)},layout:function(n,i){return e.dataToLayout(n,i)}}}}function t9e(e){var t=e.getRect();return{coordSys:{type:"matrix",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r,n){return e.dataToPoint(r,n)},layout:function(r,n){return e.dataToLayout(r,n)}}}}function Fne(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||xe(e,"text")))}function Vne(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},xe(n,"text")&&(o.text=n.text),xe(n,"rich")&&(o.rich=n.rich),xe(n,"textFill")&&(o.fill=n.textFill),xe(n,"textStroke")&&(o.stroke=n.textStroke),xe(n,"fontFamily")&&(o.fontFamily=n.fontFamily),xe(n,"fontSize")&&(o.fontSize=n.fontSize),xe(n,"fontStyle")&&(o.fontStyle=n.fontStyle),xe(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=xe(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),xe(n,"textPosition")&&(i.position=n.textPosition),xe(n,"textOffset")&&(i.offset=n.textOffset),xe(n,"textRotation")&&(i.rotation=n.textRotation),xe(n,"textDistance")&&(i.distance=n.textDistance)}return C8(o,e),B(o.rich,function(l){C8(l,l)}),{textConfig:i,textContent:a}}function C8(e,t){t&&(t.font=t.textFont||t.font,xe(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),xe(t,"textAlign")&&(e.align=t.textAlign),xe(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),xe(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),xe(t,"textWidth")&&(e.width=t.textWidth),xe(t,"textHeight")&&(e.height=t.textHeight),xe(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),xe(t,"textPadding")&&(e.padding=t.textPadding),xe(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),xe(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),xe(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),xe(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),xe(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),xe(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),xe(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function A8(e,t,r){var n=e;n.textPosition=n.textPosition||r.position||"inside",r.offset!=null&&(n.textOffset=r.offset),r.rotation!=null&&(n.textRotation=r.rotation),r.distance!=null&&(n.textDistance=r.distance);var i=n.textPosition.indexOf("inside")>=0,a=e.fill||J.color.neutral99;M8(n,t);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||J.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=e.fill||r.outsideFill||J.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,B(t.rich,function(s){M8(s,s)}),n}function M8(e,t){t&&(xe(t,"fill")&&(e.textFill=t.fill),xe(t,"stroke")&&(e.textStroke=t.fill),xe(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),xe(t,"font")&&(e.font=t.font),xe(t,"fontStyle")&&(e.fontStyle=t.fontStyle),xe(t,"fontWeight")&&(e.fontWeight=t.fontWeight),xe(t,"fontSize")&&(e.fontSize=t.fontSize),xe(t,"fontFamily")&&(e.fontFamily=t.fontFamily),xe(t,"align")&&(e.textAlign=t.align),xe(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),xe(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),xe(t,"width")&&(e.textWidth=t.width),xe(t,"height")&&(e.textHeight=t.height),xe(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),xe(t,"padding")&&(e.textPadding=t.padding),xe(t,"borderColor")&&(e.textBorderColor=t.borderColor),xe(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),xe(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),xe(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),xe(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),xe(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),xe(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),xe(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),xe(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),xe(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),xe(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var Gne={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},P8=it(Gne);da(Vo,function(e,t){return e[t]=1,e},{});Vo.join(", ");var qw=["","style","shape","extra"],fv=Je();function mR(e,t,r,n,i){var a=e+"Animation",o=Gv(e,n,i)||{},s=fv(t).userDuring;return o.duration>0&&(o.during=s?me(o9e,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),ie(o,r[a]),o}function xb(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=fv(e),u=t.style;l.userDuring=t.during;var c={},f={};if(l9e(e,t,f),e.type==="compound")for(var h=e.shape.paths,d=t.shape.paths,v=0;v0&&e.animateFrom(m,x)}else n9e(e,t,i||0,r,c);Wne(e,t),u?e.dirty():e.markRedraw()}function Wne(e,t){for(var r=fv(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function i9e(e,t){xe(t,"silent")&&(e.silent=t.silent),xe(t,"ignore")&&(e.ignore=t.ignore),e instanceof pa&&xe(t,"invisible")&&(e.invisible=t.invisible),e instanceof tt&&xe(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var vo={},a9e={setTransform:function(e,t){return vo.el[e]=t,this},getTransform:function(e){return vo.el[e]},setShape:function(e,t){var r=vo.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=vo.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=vo.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=vo.el.style;if(t)return t[e]},setExtra:function(e,t){var r=vo.el.extra||(vo.el.extra={});return r[e]=t,this},getExtra:function(e){var t=vo.el.extra;if(t)return t[e]}};function o9e(){var e=this,t=e.el;if(t){var r=fv(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}vo.el=t,n(a9e)}}function k8(e,t,r,n){var i=r[e];if(i){var a=t[e],o;if(a){var s=r.transition,l=i.transition;if(l)if(!o&&(o=n[e]={}),qc(l))ie(o,a);else for(var u=Pt(l),c=0;c=0){!o&&(o=n[e]={});for(var d=it(a),c=0;c=0)){var h=e.getAnimationStyleProps(),d=h?h.style:null;if(d){!a&&(a=n.style={});for(var v=it(r),u=0;u=0?t.getStore().get(j,$):void 0}var U=t.get(Z.name,$),G=Z&&Z.ordinalMeta;return G?G.categories[U]:U}function A(F,$){$==null&&($=c);var Z=t.getItemVisual($,"style"),j=Z&&Z.fill,U=Z&&Z.opacity,G=b($,jl).getItemStyle();j!=null&&(G.fill=j),U!=null&&(G.opacity=U);var V={inheritColor:pe(j)?j:J.color.neutral99},Y=S($,jl),K=Mt(Y,null,V,!1,!0);K.text=Y.getShallow("show")?be(e.getFormattedLabel($,jl),sv(t,$)):null;var ee=xw(Y,V,!1);return k(F,G),G=A8(G,K,ee),F&&I(G,F),G.legacy=!0,G}function P(F,$){$==null&&($=c);var Z=b($,Os).getItemStyle(),j=S($,Os),U=Mt(j,null,null,!0,!0);U.text=j.getShallow("show")?li(e.getFormattedLabel($,Os),e.getFormattedLabel($,jl),sv(t,$)):null;var G=xw(j,null,!0);return k(F,Z),Z=A8(Z,U,G),F&&I(Z,F),Z.legacy=!0,Z}function I(F,$){for(var Z in $)xe($,Z)&&(F[Z]=$[Z])}function k(F,$){F&&(F.textFill&&($.textFill=F.textFill),F.textPosition&&($.textPosition=F.textPosition))}function E(F,$){if($==null&&($=c),xe(T8,F)){var Z=t.getItemVisual($,"style");return Z?Z[T8[F]]:null}if(xe(W7e,F))return t.getItemVisual($,F)}function D(F){if(o.type==="cartesian2d"){var $=o.getBaseAxis();return v$e(Pe({axis:$},F))}}function N(){return r.getCurrentSeriesIndices()}function z(F){return HN(F,r)}}function x9e(e){var t={};return B(e.dimensions,function(r){var n=e.getDimensionInfo(r);if(!n.isExtraCoord){var i=n.coordDim,a=t[i]=t[i]||[];a[n.coordDimIndex]=e.getDimensionIndex(r)}}),t}function YM(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=wR(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Gt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function wR(e,t,r,n,i,a){var o=-1,s=t;t&&Yne(t,n,i)&&(o=We(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=_R(n),s&&p9e(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),Hi.normal.cfg=Hi.normal.conOpt=Hi.emphasis.cfg=Hi.emphasis.conOpt=Hi.blur.cfg=Hi.blur.conOpt=Hi.select.cfg=Hi.select.conOpt=null,Hi.isLegacy=!1,b9e(u,r,n,i,l,Hi),_9e(u,r,n,i,l),bR(e,u,r,n,Hi,i,l),xe(n,"info")&&(Is(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function Yne(e,t,r){var n=Is(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&A9e(a)&&Xne(a)!==n.customPathData||i==="image"&&xe(o,"image")&&o.image!==n.customImagePath}function _9e(e,t,r,n,i){var a=r.clipPath;if(a===!1)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&Yne(o,a,n)&&(o=null),o||(o=_R(a),e.setClipPath(o)),bR(null,o,t,a,null,n,i)}}function b9e(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){I8(r,null,a),I8(r,Os,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=e.getTextContent();if(o===!1)c&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=_R(o),e.setTextContent(c)),bR(null,c,t,o,null,n,i);for(var f=o&&o.style,h=0;h=c;d--){var v=t.childAt(d);S9e(t,v,i)}}}function S9e(e,t,r){t&&sC(t,Is(e).option,r)}function T9e(e){new Hs(e.oldChildren,e.newChildren,O8,O8,e).add(E8).update(E8).remove(C9e).execute()}function O8(e,t){var r=e&&e.name;return r??d9e+t}function E8(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;wR(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function C9e(e){var t=this.context,r=t.oldChildren[e];r&&sC(r,Is(r).option,t.seriesModel)}function Xne(e){return e&&(e.pathData||e.d)}function A9e(e){return e&&(xe(e,"pathData")||xe(e,"d"))}function M9e(e){e.registerChartView(g9e),e.registerSeriesModel(H7e)}var bc=Je(),D8=Ae,XM=me,TR=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(t,r,n,i){var a=r.get("value"),o=r.get("status");if(this._axisModel=t,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,t,r,n);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=c;var f=this._moveAnimation=this.determineAnimation(t,r);if(!s)s=this._group=new Me,this.createPointerEl(s,u,t,r),this.createLabelEl(s,u,t,r),n.getZr().add(s);else{var h=Fe(N8,r,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,r)}R8(s,r,!0),this._renderHandle(a)}},e.prototype.remove=function(t){this.clear(t)},e.prototype.dispose=function(t){this.clear(t)},e.prototype.determineAnimation=function(t,r){var n=r.get("animation"),i=t.axis,a=i.type==="category",o=r.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=Hj(t).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},e.prototype.makeElOption=function(t,r,n,i,a){},e.prototype.createPointerEl=function(t,r,n,i){var a=r.pointer;if(a){var o=bc(t).pointerEl=new If[a.type](D8(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=bc(t).labelEl=new at(D8(r.label));t.add(a),j8(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=bc(t).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},e.prototype.updateLabelEl=function(t,r,n,i){var a=bc(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),j8(a,i))},e.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=Wv(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Vs(u.event)},onmousedown:XM(this._onHandleDragMove,this,0,0),drift:XM(this._onHandleDragMove,this),ondragend:XM(this._onHandleDragEnd,this)}),n.add(i)),R8(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");ae(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,qv(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){N8(this._axisPointerModel,!r&&this._moveAnimation,this._handle,qM(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(t,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(qM(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(qM(i)),bc(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var r=t.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),My(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(t,r,n){return n=n||0,{x:t[n],y:t[1-n],width:r[n],height:r[1-n]}},e}();function N8(e,t,r,n){qne(bc(r).lastProp,n)||(bc(r).lastProp=n,t?lt(r,n,e):(r.stopAnimation(),r.attr(n)))}function qne(e,t){if(ke(e)&&ke(t)){var r=!0;return B(t,function(n,i){r=r&&qne(e[i],n)}),!!r}else return e===t}function j8(e,t){e[t.get(["label","show"])?"show":"hide"]()}function qM(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function R8(e,t,r){var n=t.get("z"),i=t.get("zlevel");e&&e.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function CR(e){var t=e.get("type"),r=e.getModel(t+"Style"),n;return t==="line"?(n=r.getLineStyle(),n.fill=null):t==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function Kne(e,t,r,n,i){var a=r.get("value"),o=Jne(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=Zv(s.get("padding")||0),u=s.getFont(),c=IT(o,u),f=i.position,h=c.width+l[1]+l[3],d=c.height+l[0]+l[2],v=i.align;v==="right"&&(f[0]-=h),v==="center"&&(f[0]-=h/2);var g=i.verticalAlign;g==="bottom"&&(f[1]-=d),g==="middle"&&(f[1]-=d/2),P9e(f,h,d,n);var m=s.get("backgroundColor");(!m||m==="auto")&&(m=t.get(["axisLine","lineStyle","color"])),e.label={x:f[0],y:f[1],style:Mt(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:m}),z2:10}}function P9e(e,t,r,n){var i=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+r,a)-r,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function Jne(e,t,r,n,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:Ew(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};B(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),pe(o)?a=o.replace("{value}",a):Ce(o)&&(a=o(s))}return a}function AR(e,t,r){var n=Wr();return Qs(n,n,r.rotation),Xa(n,n,r.position),Ha([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function Qne(e,t,r,n,i,a){var o=Wn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Kne(t,n,i,a,{position:AR(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function MR(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function eie(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function B8(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var k9e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),c=z8(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var h=CR(a),d=L9e[u](s,f,c);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=Gw(l.getRect(),i);Qne(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=Gw(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=AR(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=z8(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,f=[r.x,r.y];f[c]+=n[c],f[c]=Math.min(l[1],f[c]),f[c]=Math.max(l[0],f[c]);var h=(u[1]+u[0])/2,d=[h,h];d[c]=f[c];var v=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:d,tooltipOption:v[c]}},t}(TR);function z8(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var L9e={line:function(e,t,r){var n=MR([t,r[0]],[t,r[1]],$8(e));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(e,t,r){var n=Math.max(1,e.getBandWidth()),i=r[1]-r[0];return{type:"Rect",shape:eie([t-n/2,r[0]],[n,i],$8(e))}}};function $8(e){return e.dim==="x"?0:1}var I9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:J.color.border,width:1,type:"dashed"},shadowStyle:{color:J.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:J.color.neutral00,padding:[5,7,5,7],backgroundColor:J.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:J.color.accent40,throttle:40}},t}(Ke),Ss=Je(),O9e=B;function tie(e,t,r){if(!nt.node){var n=t.getZr();Ss(n).records||(Ss(n).records={}),E9e(n,t);var i=Ss(n).records[e]||(Ss(n).records[e]={});i.handler=r}}function E9e(e,t){if(Ss(e).initialized)return;Ss(e).initialized=!0,r("click",Fe(F8,"click")),r("mousemove",Fe(F8,"mousemove")),r("globalout",N9e);function r(n,i){e.on(n,function(a){var o=j9e(t);O9e(Ss(e).records,function(s){s&&i(s,a,o.dispatchAction)}),D9e(o.pendings,t)})}}function D9e(e,t){var r=e.showTip.length,n=e.hideTip.length,i;r?i=e.showTip[r-1]:n&&(i=e.hideTip[n-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function N9e(e,t,r){e.handler("leave",null,r)}function F8(e,t,r,n){t.handler(e,r,n)}function j9e(e){var t={showTip:[],hideTip:[]},r=function(n){var i=t[n.type];i?i.push(n):(n.dispatchAction=r,e.dispatchAction(n))};return{dispatchAction:r,pendings:t}}function NO(e,t){if(!nt.node){var r=t.getZr(),n=(Ss(r).records||{})[e];n&&(Ss(r).records[e]=null)}}var R9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";tie("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(r,n){NO("axisPointer",n)},t.prototype.dispose=function(r,n){NO("axisPointer",n)},t.type="axisPointer",t}(kt);function rie(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=ff(a,e);if(o==null||o<0||ae(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),f=c.dim,h=u.dim,d=f==="x"||f==="radius"?1:0,v=a.mapDimension(h),g=[];g[d]=a.get(v,o),g[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(g)||[]}else r=l.dataToPoint(a.getValues(se(l.dimensions,function(x){return a.mapDimension(x)}),o))||[];else if(s){var m=s.getBoundingRect().clone();m.applyTransform(s.transform),r=[m.x+m.width/2,m.y+m.height/2]}return{point:r,el:s}}var V8=Je();function B9e(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||me(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){_b(i)&&(i=rie({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=_b(i),u=a.axesInfo,c=s.axesInfo,f=n==="leave"||_b(i),h={},d={},v={list:[],map:{}},g={showPointer:Fe($9e,d),showTooltip:Fe(F9e,v)};B(s.coordSysMap,function(x,_){var b=l||x.containPoint(i);B(s.coordSysAxesInfo[_],function(S,T){var C=S.axis,A=H9e(u,S);if(!f&&b&&(!u||A)){var P=A&&A.value;P==null&&!l&&(P=C.pointToData(i)),P!=null&&G8(S,P,g,!1,h)}})});var m={};return B(c,function(x,_){var b=x.linkGroup;b&&!d[_]&&B(b.axesInfo,function(S,T){var C=d[T];if(S!==x&&C){var A=C.value;b.mapper&&(A=x.axis.scale.parse(b.mapper(A,W8(S),W8(x)))),m[x.key]=A}})}),B(m,function(x,_){G8(c[_],x,g,!0,h)}),V9e(d,c,h),G9e(v,i,e,o),W9e(c,o,r),h}}function G8(e,t,r,n,i){var a=e.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!e.involveSeries){r.showPointer(e,t);return}var o=z9e(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&ie(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function z9e(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return B(t.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,e,r);h=d.dataIndices,f=d.nestestValue}else{if(h=l.indicesOfNearest(n,c[0],e,r.type==="category"?.5:null),!h.length)return;f=l.getData().get(c[0],h[0])}if(!(f==null||!isFinite(f))){var v=e-f,g=Math.abs(v);g<=o&&((g=0&&s<0)&&(o=g,s=v,i=f,a.length=0),B(h,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:i}}function $9e(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function F9e(e,t,r,n){var i=r.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!i.length)){var l=t.coordSys.model,u=jy(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function V9e(e,t,r){var n=r.axesInfo=[];B(t,function(i,a){var o=i.axisPointerModel.option,s=e[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function G9e(e,t,r,n){if(_b(t)||!e.list.length){n({type:"hideTip"});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function W9e(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=V8(n)[i]||{},o=V8(n)[i]={};B(e,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&B(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];B(a,function(u,c){!o[c]&&l.push(u)}),B(o,function(u,c){!a[c]&&s.push(u)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function H9e(e,t){for(var r=0;r<(e||[]).length;r++){var n=e[r];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}function W8(e){var t=e.axis.model,r={},n=r.axisDim=e.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=t.componentIndex,r.axisName=r[n+"AxisName"]=t.name,r.axisId=r[n+"AxisId"]=t.id,r}function _b(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function M0(e){Nf.registerAxisPointerClass("CartesianAxisPointer",k9e),e.registerComponentModel(I9e),e.registerComponentView(R9e),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!ae(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=U6e(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},B9e)}function U9e(e){Ze(Are),Ze(M0)}var Z9e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),c=u.getExtent(),f=s.dataToCoord(n),h=a.get("type");if(h&&h!=="none"){var d=CR(a),v=X9e[h](s,l,f,c);v.style=d,r.graphicKey=v.type,r.pointer=v}var g=a.get(["label","margin"]),m=Y9e(n,i,a,l,g);Kne(r,i,a,o,m)},t}(TR);function Y9e(e,t,r,n,i){var a=t.axis,o=a.dataToCoord(e),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,c,f;if(a.dim==="radius"){var h=Wr();Qs(h,h,s),Xa(h,h,[n.cx,n.cy]),u=Ha([o,-i],h);var d=t.getModel("axisLabel").get("rotate")||0,v=Wn.innerTextLayout(s,d*Math.PI/180,-1);c=v.textAlign,f=v.textVerticalAlign}else{var g=l[1];u=n.coordToPoint([g+i,o]);var m=n.cx,x=n.cy;c=Math.abs(u[0]-m)/g<.3?"center":u[0]>m?"left":"right",f=Math.abs(u[1]-x)/g<.3?"middle":u[1]>x?"top":"bottom"}return{position:u,align:c,verticalAlign:f}}var X9e={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:MR(t.coordToPoint([n[0],r]),t.coordToPoint([n[1],r]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r}}},shadow:function(e,t,r,n){var i=Math.max(1,e.getBandWidth()),a=Math.PI/180;return e.dim==="angle"?{type:"Sector",shape:B8(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:B8(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},q9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.findAxisModel=function(r){var n,i=this.ecModel;return i.eachComponent(r,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}(Ke),PR=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",er).models[0]},t.type="polarAxis",t}(Ke);cr(PR,ep);var K9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="angleAxis",t}(PR),J9e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="radiusAxis",t}(PR),kR=function(e){q(t,e);function t(r,n){return e.call(this,"radius",r,n)||this}return t.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},t}(ba);kR.prototype.dataToRadius=ba.prototype.dataToCoord;kR.prototype.radiusToData=ba.prototype.coordToData;var Q9e=Je(),LR=function(e){q(t,e);function t(r,n){return e.call(this,"angle",r,n||[0,360])||this}return t.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},t.prototype.calculateCategoryInterval=function(){var r=this,n=r.getLabelModel(),i=r.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=r.dataToCoord(s+1)-r.dataToCoord(s),u=Math.abs(l),c=IT(s==null?"":s+"",n.getFont(),"center","top"),f=Math.max(c.height,7),h=f/u;isNaN(h)&&(h=1/0);var d=Math.max(0,Math.floor(h)),v=Q9e(r.model),g=v.lastAutoInterval,m=v.lastTickCount;return g!=null&&m!=null&&Math.abs(g-d)<=1&&Math.abs(m-o)<=1&&g>d?d=g:(v.lastTickCount=o,v.lastAutoInterval=d),d},t}(ba);LR.prototype.dataToAngle=ba.prototype.dataToCoord;LR.prototype.angleToData=ba.prototype.coordToData;var nie=["radius","angle"],eZe=function(){function e(t){this.dimensions=nie,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new kR,this._angleAxis=new LR,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(t){var r=this.pointToCoord(t);return this._radiusAxis.contain(r[0])&&this._angleAxis.contain(r[1])},e.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},e.prototype.getAxis=function(t){var r="_"+t+"Axis";return this[r]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(t){var r=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&r.push(n),i.scale.type===t&&r.push(i),r},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(t){var r=this._angleAxis;return t===r?this._radiusAxis:r},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(t){var r=t!=null&&t!=="auto"?this.getAxis(t):this.getBaseAxis();return{baseAxes:[r],otherAxes:[this.getOtherAxis(r)]}},e.prototype.dataToPoint=function(t,r,n){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],r),this._angleAxis.dataToAngle(t[1],r)],n)},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.pointToCoord(t);return n[0]=this._radiusAxis.radiusToData(i[0],r),n[1]=this._angleAxis.angleToData(i[1],r),n},e.prototype.pointToCoord=function(t){var r=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var u=Math.atan2(-n,r)/Math.PI*180,c=us;)u+=c*360;return[l,u]},e.prototype.coordToPoint=function(t,r){r=r||[];var n=t[0],i=t[1]/180*Math.PI;return r[0]=Math.cos(i)*n+this.cx,r[1]=-Math.sin(i)*n+this.cy,r},e.prototype.getArea=function(){var t=this.getAngleAxis(),r=this.getRadiusAxis(),n=r.getExtent().slice();n[0]>n[1]&&n.reverse();var i=t.getExtent(),a=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:t.inverse,contain:function(s,l){var u=s-this.cx,c=l-this.cy,f=u*u+c*c,h=this.r,d=this.r0;return h!==d&&f-o<=h*h&&f+o>=d*d},x:this.cx-n[1],y:this.cy-n[1],width:n[1]*2,height:n[1]*2}},e.prototype.convertToPixel=function(t,r,n){var i=H8(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=H8(r);return i===this?this.pointToData(n):null},e}();function H8(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function tZe(e,t,r){var n=t.get("center"),i=jr(t,r).refContainer;e.cx=ve(n[0],i.width)+i.x,e.cy=ve(n[1],i.height)+i.y;var a=e.getRadiusAxis(),o=Math.min(i.width,i.height)/2,s=t.get("radius");s==null?s=[0,"100%"]:ae(s)||(s=[0,s]);var l=[ve(s[0],o),ve(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function rZe(e,t){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),e.eachSeries(function(s){if(s.coordinateSystem===r){var l=s.getData();B(Dw(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),B(Dw(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),mf(n.scale,n.model),mf(i.scale,i.model),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function nZe(e){return e.mainType==="angleAxis"}function U8(e,t){var r;if(e.type=t.get("type"),e.scale=b0(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),nZe(t)){e.inverse=e.inverse!==t.get("clockwise");var n=t.get("startAngle"),i=(r=t.get("endAngle"))!==null&&r!==void 0?r:n+(e.inverse?-360:360);e.setExtent(n,i)}t.axis=e,e.model=t}var iZe={dimensions:nie,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new eZe(i+"");a.update=rZe;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");U8(o,l),U8(s,u),tZe(a,n,t),r.push(a),n.coordinateSystem=a,a.model=n}),e.eachSeries(function(n){if(n.get("coordinateSystem")==="polar"){var i=n.getReferringComponents("polar",er).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},aZe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function P_(e,t,r){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],r]),i=e.coordToPoint([t[1],r]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function k_(e){var t=e.getRadiusAxis();return t.inverse?0:1}function Z8(e){var t=e[0],r=e[e.length-1];t&&r&&Math.abs(Math.abs(t.coord-r.coord)-360)<1e-4&&e.pop()}var oZe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.axisPointerClass="PolarAxisPointer",r}return t.prototype.render=function(r,n){if(this.group.removeAll(),!!r.get("show")){var i=r.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords({breakTicks:"none"}),l=i.getMinorTicksCoords(),u=se(i.getViewLabels(),function(c){c=Ae(c);var f=i.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(h),c});Z8(u),Z8(s),B(aZe,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&sZe[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(Nf),sZe={axisLine:function(e,t,r,n,i,a){var o=t.getModel(["axisLine","lineStyle"]),s=r.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=k_(r),f=c?0:1,h,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new If[d]({shape:{cx:r.cx,cy:r.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):h=new Fv({shape:{cx:r.cx,cy:r.cy,r:a[c],r0:a[f]},style:o.getLineStyle(),z2:1,silent:!0}),h.style.fill=null,e.add(h)},axisTick:function(e,t,r,n,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[k_(r)],u=se(n,function(c){return new mr({shape:P_(r,[l,l+s],c.coord)})});e.add(Si(u,{style:Pe(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,r,n,i,a){if(i.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[k_(r)],c=[],f=0;fx?"left":"right",S=Math.abs(m[1]-_)/g<.3?"middle":m[1]>_?"top":"bottom";if(s&&s[v]){var T=s[v];ke(T)&&T.textStyle&&(d=new et(T.textStyle,l,l.ecModel))}var C=new at({silent:Wn.isLabelSilent(t),style:Mt(d,{x:m[0],y:m[1],fill:d.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:b,verticalAlign:S})});if(e.add(C),tl({el:C,componentModel:t,itemName:f.formattedLabel,formatterParamsExtra:{isTruncated:function(){return C.isTruncated},value:f.rawLabel,tickIndex:h}}),c){var A=Wn.makeAxisEventDataBase(t);A.targetType="axisLabel",A.value=f.rawLabel,De(C).eventData=A}},this)},splitLine:function(e,t,r,n,i,a){var o=t.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],f=0;f=0?"p":"n",F=I;T&&(n[c][N]||(n[c][N]={p:I,n:I}),F=n[c][N][z]);var $=void 0,Z=void 0,j=void 0,U=void 0;if(v.dim==="radius"){var G=v.dataToCoord(D)-I,V=l.dataToCoord(N);Math.abs(G)=U})}}})}function dZe(e){var t={};B(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=aie(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),f=t[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=f.stacks;t[l]=f;var d=iie(n);h[d]||f.autoWidthCount++,h[d]=h[d]||{width:0,maxWidth:0};var v=ve(n.get("barWidth"),c),g=ve(n.get("barMaxWidth"),c),m=n.get("barGap"),x=n.get("barCategoryGap");v&&!h[d].width&&(v=Math.min(f.remainedWidth,v),h[d].width=v,f.remainedWidth-=v),g&&(h[d].maxWidth=g),m!=null&&(f.gap=m),x!=null&&(f.categoryGap=x)});var r={};return B(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=ve(n.categoryGap,o),l=ve(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),B(a,function(g,m){var x=g.maxWidth;x&&x=r.y&&t[1]<=r.y+r.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=r.y&&t[0]<=r.y+r.height},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.getAxis();return n[0]=i.coordToData(i.toLocalCoord(t[i.orient==="horizontal"?0:1])),n},e.prototype.dataToPoint=function(t,r,n){var i=this.getAxis(),a=this.getRect();n=n||[];var o=i.orient==="horizontal"?0:1;return t instanceof Array&&(t=t[0]),n[o]=i.toGlobalCoord(i.dataToCoord(+t)),n[1-o]=o===0?a.y+a.height/2:a.x+a.width/2,n},e.prototype.convertToPixel=function(t,r,n){var i=Y8(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=Y8(r);return i===this?this.pointToData(n):null},e}();function Y8(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function SZe(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new wZe(n,e,t);a.name="single_"+i,a.resize(n,t),n.coordinateSystem=a,r.push(a)}),e.eachSeries(function(n){if(n.get("coordinateSystem")==="singleAxis"){var i=n.getReferringComponents("singleAxis",er).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var TZe={create:SZe,dimensions:oie},X8=["x","y"],CZe=["width","height"],AZe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=KM(l,1-Qw(s)),c=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var h=CR(a),d=MZe[f](s,c,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=jO(i);Qne(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=jO(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=AR(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.coordinateSystem,l=Qw(o),u=KM(s,l),c=[r.x,r.y];c[l]+=n[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var f=KM(s,1-l),h=(f[1]+f[0])/2,d=[h,h];return d[l]=c[l],{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},t}(TR),MZe={line:function(e,t,r){var n=MR([t,r[0]],[t,r[1]],Qw(e));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(e,t,r){var n=e.getBandWidth(),i=r[1]-r[0];return{type:"Rect",shape:eie([t-n/2,r[0]],[n,i],Qw(e))}}};function Qw(e){return e.isHorizontal()?0:1}function KM(e,t){var r=e.getRect();return[r[X8[t]],r[X8[t]]+r[CZe[t]]]}var PZe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="single",t}(kt);function kZe(e){Ze(M0),Nf.registerAxisPointerClass("SingleAxisPointer",AZe),e.registerComponentView(PZe),e.registerComponentView(xZe),e.registerComponentModel(bb),lv(e,"single",bb,bb.defaultOption),e.registerCoordinateSystem("single",TZe)}var LZe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n,i){var a=Of(r);e.prototype.init.apply(this,arguments),q8(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),q8(this.option,r)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.layoutMode="box",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:J.color.axisLine,width:1,type:"solid"}},itemStyle:{color:J.color.neutral00,borderWidth:1,borderColor:J.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:J.size.s,color:J.color.secondary},monthLabel:{show:!0,position:"start",margin:J.size.s,align:"center",formatter:null,color:J.color.secondary},yearLabel:{show:!0,position:null,margin:J.size.xl,formatter:null,color:J.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(Ke);function q8(e,t){var r=e.cellSize,n;ae(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=se([0,1],function(a){return J3e(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Ho(e,t,{type:"box",ignoreSize:i})}var IZe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group;a.removeAll();var o=r.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(r,s,a),this._renderLines(r,s,l,a),this._renderYearText(r,s,l,a),this._renderMonthText(r,u,l,a),this._renderWeekText(r,u,s,l,a)},t.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,o=r.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToCalendarLayout([u],!1).tl,f=new Xe({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(f)}},t.prototype._renderLines=function(r,n,i,a){var o=this,s=r.coordinateSystem,l=r.getModel(["splitLine","lineStyle"]).getLineStyle(),u=r.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var f=n.start,h=0;f.time<=n.end.time;h++){v(f.formatedDate),h===0&&(f=s.getDateInfo(n.start.y+"-"+n.start.m));var d=f.date;d.setMonth(d.getMonth()+1),f=s.getDateInfo(d)}v(s.getNextNDay(n.end.time,1).formatedDate);function v(g){o._firstDayOfMonth.push(s.getDateInfo(g)),o._firstDayPoints.push(s.dataToCalendarLayout([g],!1).tl);var m=o._getLinePointsOfOneWeek(r,g,i);o._tlpoints.push(m[0]),o._blpoints.push(m[m.length-1]),u&&o._drawSplitline(m,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,i),l,a)},t.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},t.prototype._drawSplitline=function(r,n,i){var a=new an({z2:20,shape:{points:r},style:n});i.add(a)},t.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToCalendarLayout([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[i==="horizontal"?"bl":"tr"]}return s},t.prototype._formatterLabel=function(r,n){return pe(r)&&r?H3e(r,n):Ce(r)?r(n):n.nameMap},t.prototype._yearTextPositionControl=function(r,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},t.prototype._renderYearText=function(r,n,i,a){var o=r.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,f=(u[0][1]+u[1][1])/2,h=i==="horizontal"?0:1,d={top:[c,u[h][1]],bottom:[c,u[1-h][1]],left:[u[1-h][0],f],right:[u[h][0],f]},v=n.start.y;+n.end.y>+n.start.y&&(v=v+"-"+n.end.y);var g=o.get("formatter"),m={start:n.start.y,end:n.end.y,nameMap:v},x=this._formatterLabel(g,m),_=new at({z2:30,style:Mt(o,{text:x}),silent:o.get("silent")});_.attr(this._yearTextPositionControl(_,d[l],i,l,s)),a.add(_)}},t.prototype._monthTextPositionControl=function(r,n,i,a,o){var s="left",l="top",u=r[0],c=r[1];return i==="horizontal"?(c=c+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},t.prototype._renderMonthText=function(r,n,i,a){var o=r.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),f=[this._tlpoints,this._blpoints];(!s||pe(s))&&(s&&(n=II(s)||n),s=n.get(["time","monthAbbr"])||[]);var h=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var v=c==="center",g=o.get("silent"),m=0;m=a.start.time&&i.times.end.time&&r.reverse(),r},e.prototype._getRangeInfo=function(t){var r=[this.getDateInfo(t[0]),this.getDateInfo(t[1])],n;r[0].time>r[1].time&&(n=!0,r.reverse());var i=Math.floor(r[1].time/JM)-Math.floor(r[0].time/JM)+1,a=new Date(r[0].time),o=a.getDate(),s=r[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-r[1].time)*u>0;)i-=u,a.setDate(l-u);var c=Math.floor((i+r[0].day+6)/7),f=n?-c+1:c-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:c,nthWeek:f,fweek:r[0].day,lweek:r[1].day}},e.prototype._getDateByWeeksAndDay=function(t,r,n){var i=this._getRangeInfo(n);if(t>i.weeks||t===0&&ri.lweek)return null;var a=(t-1)*7-i.fweek+r,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},e.create=function(t,r){var n=[];return t.eachComponent("calendar",function(i){var a=new e(i,t,r);n.push(a),i.coordinateSystem=a}),t.eachComponent(function(i,a){x0({targetModel:a,coordSysType:"calendar",coordSysProvider:CQ})}),n},e.dimensions=["time","value"],e}();function QM(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function EZe(e){e.registerComponentModel(LZe),e.registerComponentView(IZe),e.registerCoordinateSystem("calendar",OZe)}var vs={level:1,leaf:2,nonLeaf:3},Es={none:0,all:1,body:2,corner:3};function RO(e,t,r){var n=t[Be[r]].getCell(e);return!n&&ot(e)&&e<0&&(n=t[Be[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function sie(e){var t=e||[];return t[0]=t[0]||[],t[1]=t[1]||[],t[0][0]=t[0][1]=t[1][0]=t[1][1]=NaN,t}function lie(e,t,r,n,i){K8(e[0],t,i,r,n,0),K8(e[1],t,i,r,n,1)}function K8(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=ae(o)?o:[o],l=s.length,u=!!r;if(l>=1?(J8(e,t,s,u,i,a,0),l>1&&J8(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Be[1-a]].getLocatorCount(a),f=i[Be[a]].getLocatorCount(a)-1;r===Es.body?c=pr(0,c):r===Es.corner&&(f=Li(-1,f)),f=t[0]&&e[0]<=t[1]}function tH(e,t){e.id.set(t[0][0],t[1][0]),e.span.set(t[0][1]-e.id.x+1,t[1][1]-e.id.y+1)}function jZe(e,t){e[0][0]=t[0][0],e[0][1]=t[0][1],e[1][0]=t[1][0],e[1][1]=t[1][1]}function rH(e,t,r,n){var i=RO(t[n][0],r,n),a=RO(t[n][1],r,n);e[Be[n]]=e[Tr[n]]=NaN,i&&a&&(e[Be[n]]=i.xy,e[Tr[n]]=a.xy+a.wh-i.xy)}function og(e,t,r,n){return e[Be[t]]=r,e[Be[1-t]]=n,e}function RZe(e){return e&&(e.type===vs.leaf||e.type===vs.nonLeaf)?e:null}function eS(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var nH=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=BZe(t);var n=r.get("data",!0);n!=null&&!ae(n)&&(n=[]),n?this._initByDimModelData(n):this._initBySeriesData()}return e.prototype._initByDimModelData=function(t){var r=this,n=r._cells,i=r._levels,a=[],o=0;r._leavesCount=s(t,0,0),l();return;function s(u,c,f){var h=0;return u&&B(u,function(d,v){var g;pe(d)?g={value:d}:ke(d)?(g=d,d.value!=null&&!pe(d.value)&&(g={value:null})):g={value:null};var m={type:vs.nonLeaf,ordinal:NaN,level:f,firstLeafLocator:c,id:new Ie,span:og(new Ie,r.dimIdx,1,1),option:g,xy:NaN,wh:NaN,dim:r,rect:eS()};o++,(a[c]||(a[c]=[])).push(m),i[f]||(i[f]={type:vs.level,xy:NaN,wh:NaN,option:null,id:new Ie,dim:r});var x=s(g.children,c,f+1),_=Math.max(1,x);m.span[Be[r.dimIdx]]=_,h+=_,c+=_}),h}function l(){for(var u=[];n.length=1,b=r[Be[n]],S=a.getLocatorCount(n)-1,T=new ql;for(o.resetLayoutIterator(T,n);T.next();)C(T.item);for(a.resetLayoutIterator(T,n);T.next();)C(T.item);function C(A){gn(A.wh)&&(A.wh=x),A.xy=b,A.id[Be[n]]===S&&!_&&(A.wh=r[Be[n]]+r[Tr[n]]-A.xy),b+=A.wh}}function cH(e,t){for(var r=t[Be[e]].resetCellIterator();r.next();){var n=r.item;tS(n.rect,e,n.id,n.span,t),tS(n.rect,1-e,n.id,n.span,t),n.type===vs.nonLeaf&&(n.xy=n.rect[Be[e]],n.wh=n.rect[Tr[e]])}}function fH(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;tS(i,0,a,n,t),tS(i,1,a,n,t)}})}function tS(e,t,r,n,i){e[Tr[t]]=0;var a=r[Be[t]],o=a<0?i[Be[1-t]]:i[Be[t]],s=o.getUnitLayoutInfo(t,r[Be[t]]);if(e[Be[t]]=s.xy,e[Tr[t]]=s.wh,n[Be[t]]>1){var l=o.getUnitLayoutInfo(t,r[Be[t]]+n[Be[t]]-1);e[Tr[t]]=l.xy+l.wh-s.xy}}function KZe(e,t,r){var n=vw(e,r[Tr[t]]);return zO(n,r[Tr[t]])}function zO(e,t){return Math.max(Math.min(e,be(t,1/0)),0)}function rP(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var hn={inBody:1,inCorner:2,outside:3},fo={x:null,y:null,point:[]};function hH(e,t,r,n,i){var a=r[Be[t]],o=r[Be[1-t]],s=a.getUnitLayoutInfo(t,a.getLocatorCount(t)-1),l=a.getUnitLayoutInfo(t,0),u=o.getUnitLayoutInfo(t,-o.getLocatorCount(t)),c=o.shouldShow()?o.getUnitLayoutInfo(t,-1):null,f=e.point[t]=n[t];if(!l&&!c){e[Be[t]]=hn.outside;return}if(i===Es.body){l?(e[Be[t]]=hn.inBody,f=Li(s.xy+s.wh,pr(l.xy,f)),e.point[t]=f):e[Be[t]]=hn.outside;return}else if(i===Es.corner){c?(e[Be[t]]=hn.inCorner,f=Li(c.xy+c.wh,pr(u.xy,f)),e.point[t]=f):e[Be[t]]=hn.outside;return}var h=l?l.xy:c?c.xy+c.wh:NaN,d=u?u.xy:h,v=s?s.xy+s.wh:h;if(fv){if(!i){e[Be[t]]=hn.outside;return}f=v}e.point[t]=f,e[Be[t]]=h<=f&&f<=v?hn.inBody:d<=f&&f<=h?hn.inCorner:hn.outside}function dH(e,t,r,n){var i=1-r;if(e[Be[r]]!==hn.outside)for(n[Be[r]].resetCellIterator(tP);tP.next();){var a=tP.item;if(pH(e.point[r],a.rect,r)&&pH(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Be[i]];return}}}function vH(e,t,r,n){if(e[Be[r]]!==hn.outside){var i=e[Be[r]]===hn.inCorner?n[Be[1-r]]:n[Be[r]];for(i.resetLayoutIterator(D_,r);D_.next();)if(JZe(e.point[r],D_.item)){t[r]=D_.item.id[Be[r]];return}}}function JZe(e,t){return t.xy<=e&&e<=t.xy+t.wh}function pH(e,t,r){return t[Be[r]]<=e&&e<=t[Be[r]]+t[Tr[r]]}function QZe(e){e.registerComponentModel(VZe),e.registerComponentView(ZZe),e.registerCoordinateSystem("matrix",qZe)}function eYe(e,t){var r=e.existing;if(t.id=e.keyInfo.id,!t.type&&r&&(t.type=r.type),t.parentId==null){var n=t.parentOption;n?t.parentId=n.id:r&&(t.parentId=r.parentId)}t.parentOption=null}function gH(e,t){var r;return B(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function tYe(e,t,r){var n=ie({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(He(i,n,!0),Ho(i,n,{ignoreSize:!0}),LQ(r,i),N_(r,i),N_(r,i,"shape"),N_(r,i,"style"),N_(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var cie=["transition","enterFrom","leaveTo"],rYe=cie.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function N_(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?cie:rYe,i=0;i=0;c--){var f=i[c],h=Ir(f.id,null),d=h!=null?o.get(h):null;if(d){var v=d.parent,x=qi(v),_=v===a?{width:s,height:l}:{width:x.width,height:x.height},b={},S=HT(d,f,_,null,{hv:f.hv,boundingMode:f.bounding},b);if(!qi(d).isNew&&S){for(var T=f.transition,C={},A=0;A=0)?C[P]=I:d[P]=I}lt(d,C,r,0)}else d.attr(b)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){wb(i,qi(i).option,n,r._lastGraphicModel)}),this._elMap=_e()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(kt);function $O(e){var t=xe(mH,e)?mH[e]:Sy(e),r=new t({});return qi(r).type=e,r}function yH(e,t,r,n){var i=$O(r);return t.add(i),n.set(e,i),qi(i).id=e,qi(i).isNew=!0,i}function wb(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){wb(a,t,r,n)}),sC(e,t,n),r.removeKey(qi(e).id))}function xH(e,t,r,n){e.isGroup||B([["cursor",pa.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];xe(t,a)?e[a]=be(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),B(it(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=Ce(a)?a:null}}),xe(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function oYe(e){return e=ie({},e),B(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(AQ),function(t){delete e[t]}),e}function sYe(e,t,r){var n=De(e).eventData;!e.silent&&!e.ignore&&!n&&(n=De(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),n&&(n.info=r.info)}function lYe(e){e.registerComponentModel(iYe),e.registerComponentView(aYe),e.registerPreprocessor(function(t){var r=t.graphic;ae(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var _H=["x","y","radius","angle","single"],uYe=["cartesian2d","polar","singleAxis"];function cYe(e){var t=e.get("coordinateSystem");return We(uYe,t)>=0}function Rl(e){return e+"Axis"}function fYe(e,t){var r=_e(),n=[],i=_e();e.eachComponent({mainType:"dataZoom",query:t},function(c){i.get(c.uid)||s(c)});var a;do a=!1,e.eachComponent("dataZoom",o);while(a);function o(c){!i.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){i.set(c.uid,!0),n.push(c),u(c)}function l(c){var f=!1;return c.eachTargetAxis(function(h,d){var v=r.get(h);v&&v[d]&&(f=!0)}),f}function u(c){c.eachTargetAxis(function(f,h){(r.get(f)||r.set(f,[]))[h]=!0})}return n}function fie(e){var t=e.ecModel,r={infoList:[],infoMap:_e()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(Rl(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}var nP=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},e}(),Vy=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return t.prototype.init=function(r,n,i){var a=bH(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=bH(r);He(this.option,r,!0),He(this.settledOption,n,!0),this._doInit(n)},t.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var i=this.settledOption;B([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=_e(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return B(_H,function(i){var a=this.getReferringComponents(Rl(i),kRe);if(a.specified){n=!0;var o=new nP;B(a.models,function(s){o.add(s.componentIndex)}),r.set(i,o)}},this),n},t.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===n}});l(s,"single")}function l(u,c){var f=u[0];if(f){var h=new nP;if(h.add(f.componentIndex),r.set(c,h),a=!1,c==="x"||c==="y"){var d=f.getReferringComponents("grid",er).models[0];d&&B(u,function(v){f.componentIndex!==v.componentIndex&&d===v.getReferringComponents("grid",er).models[0]&&h.add(v.componentIndex)})}}}a&&B(_H,function(u){if(a){var c=i.findComponents({mainType:Rl(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new nP;f.add(c[0].componentIndex),r.set(u,f),a=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(r){var n=this._rangePropMode,i=this.get("rangeMode");B([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,i){r==null&&(r=this.ecModel.getComponent(Rl(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){B(i.indexList,function(o){r.call(n,a,o)})})},t.prototype.getAxisProxy=function(r,n){var i=this.getAxisModel(r,n);if(i)return i.__dzAxisProxy},t.prototype.getAxisModel=function(r,n){var i=this._targetAxisInfoMap.get(r);if(i&&i.indexMap[n])return this.ecModel.getComponent(Rl(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;B([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(n[a[0]]=i[a[0]]=r[a[0]],n[a[1]]=i[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},t.prototype.setCalculatedRange=function(r){var n=this.option;B(["start","startValue","end","endValue"],function(i){n[i]=r[i]})},t.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},t.prototype.getValueRange=function(r,n){if(r==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(r,n).getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(b&&!S&&!T)return!0;b&&(m=!0),S&&(v=!0),T&&(g=!0)}return m&&v&&g})}else kh(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(g){return s(g)?g:NaN}));else{var v={};v[d]=o,u.selectRange(v)}});kh(c,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},e.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;kh(["min","max"],function(i){var a=r.get(i+"Span"),o=r.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=gt(n[0]+o,n,[0,100],!0):a!=null&&(o=gt(a,[0,100],n,!0)-n[0]),t[i+"Span"]=a,t[i+"ValueSpan"]=o},this)},e.prototype._setAxisModel=function(){var t=this.getAxisModel(),r=this._percentWindow,n=this._valueWindow;if(r){var i=wN(n,[0,500]);i=Math.min(i,20);var a=t.axis.scale.rawExtentInfo;r[0]!==0&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),r[1]!==100&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},e}();function pYe(e,t,r){var n=[1/0,-1/0];kh(r,function(o){E$e(n,o.getData(),t)});var i=e.getAxisModel(),a=cte(i.axis.scale,i,n).calculate();return[a.min,a.max]}var gYe={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(Rl(o),s);i(o,s,l,a)})})}t(function(i,a,o,s){o.__dzAxisProxy=null});var r=[];t(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new vYe(i,a,s,e),r.push(o.__dzAxisProxy))});var n=_e();return B(r,function(i){B(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(e,t){e.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(n,i){r.getAxisProxy(n,i).reset(r)}),r.eachTargetAxis(function(n,i){r.getAxisProxy(n,i).filterData(r,t)})}),e.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var i=n.getDataPercentWindow(),a=n.getDataValueWindow();r.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};function mYe(e){e.registerAction("dataZoom",function(t,r){var n=fYe(r,t);B(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var SH=!1;function DR(e){SH||(SH=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,gYe),mYe(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function yYe(e){e.registerComponentModel(hYe),e.registerComponentView(dYe),DR(e)}var ea=function(){function e(){}return e}(),hie={};function Lh(e,t){hie[e]=t}function die(e){return hie[e]}var xYe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var r=this.ecModel;B(this.option.feature,function(n,i){var a=die(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),He(n,a.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:J.color.border,borderRadius:0,borderWidth:0,padding:J.size.m,itemSize:15,itemGap:J.size.s,showTitle:!0,iconStyle:{borderColor:J.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:J.color.accent50}},tooltip:{show:!1,position:"bottom"}},t}(Ke);function vie(e,t){var r=Zv(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new Xe({shape:{x:e.x-r[3],y:e.y-r[0],width:e.width+r[1]+r[3],height:e.height+r[0]+r[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1});return i}var _Ye=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i,a){var o=this.group;if(o.removeAll(),!r.get("show"))return;var s=+r.get("itemSize"),l=r.get("orient")==="vertical",u=r.get("feature")||{},c=this._features||(this._features={}),f=[];B(u,function(_,b){f.push(b)}),new Hs(this._featureNames||[],f).add(h).update(h).remove(Fe(h,null)).execute(),this._featureNames=f;function h(_,b){var S=f[_],T=f[b],C=u[S],A=new et(C,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(C.title=a.newTitle),S&&!T){if(bYe(S))P={onclick:A.option.onclick,featureName:S};else{var I=die(S);if(!I)return;P=new I}c[S]=P}else if(P=c[T],!P)return;P.uid=Uv("toolbox-feature"),P.model=A,P.ecModel=n,P.api=i;var k=P instanceof ea;if(!S&&T){k&&P.dispose&&P.dispose(n,i);return}if(!A.get("show")||k&&P.unusable){k&&P.remove&&P.remove(n,i);return}d(A,P,S),A.setIconStatus=function(E,D){var N=this.option,z=this.iconPaths;N.iconStatus=N.iconStatus||{},N.iconStatus[E]=D,z[E]&&(D==="emphasis"?Gs:Ws)(z[E])},P instanceof ea&&P.render&&P.render(A,n,i,a)}function d(_,b,S){var T=_.getModel("iconStyle"),C=_.getModel(["emphasis","iconStyle"]),A=b instanceof ea&&b.getIcons?b.getIcons():_.get("icon"),P=_.get("title")||{},I,k;pe(A)?(I={},I[S]=A):I=A,pe(P)?(k={},k[S]=P):k=P;var E=_.iconPaths={};B(I,function(D,N){var z=Wv(D,{},{x:-s/2,y:-s/2,width:s,height:s});z.setStyle(T.getItemStyle());var F=z.ensureState("emphasis");F.style=C.getItemStyle();var $=new at({style:{text:k[N],align:C.get("textAlign"),borderRadius:C.get("textBorderRadius"),padding:C.get("textPadding"),fill:null,font:HN({fontStyle:C.get("textFontStyle"),fontFamily:C.get("textFontFamily"),fontSize:C.get("textFontSize"),fontWeight:C.get("textFontWeight")},n)},ignore:!0});z.setTextContent($),tl({el:z,componentModel:r,itemName:N,formatterParamsExtra:{title:k[N]}}),z.__title=k[N],z.on("mouseover",function(){var Z=C.getItemStyle(),j=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";$.setStyle({fill:C.get("textFill")||Z.fill||Z.stroke||J.color.neutral99,backgroundColor:C.get("textBackgroundColor")}),z.setTextConfig({position:C.get("textPosition")||j}),$.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){_.get(["iconStatus",N])!=="emphasis"&&i.leaveEmphasis(this),$.hide()}),(_.get(["iconStatus",N])==="emphasis"?Gs:Ws)(z),o.add(z),z.on("click",me(b.onclick,b,n,i,N)),E[N]=z})}var v=jr(r,i).refContainer,g=r.getBoxLayoutParams(),m=r.get("padding"),x=zt(g,v,m);Zc(r.get("orient"),o,r.get("itemGap"),x.width,x.height),HT(o,g,v,m),o.add(vie(o.getBoundingRect(),r)),l||o.eachChild(function(_){var b=_.__title,S=_.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),C=_.getTextContent(),A=C&&C.ensureState("emphasis");if(A&&!Ce(A)&&b){var P=A.style||(A.style={}),I=IT(b,at.makeFont(P)),k=_.x+o.x,E=_.y+o.y+s,D=!1;E+I.height>i.getHeight()&&(T.position="top",D=!0);var N=D?-5-I.height:s+10;k+I.width/2>i.getWidth()?(T.position=["100%",N],P.align="right"):k-I.width/2<0&&(T.position=[0,N],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){B(this._features,function(o){o instanceof ea&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){B(this._features,function(i){i instanceof ea&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){B(this._features,function(i){i instanceof ea&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(kt);function bYe(e){return e.indexOf("my")===0}var wYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){var i=this.model,a=i.get("name")||r.get("title.0.text")||"echarts",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||J.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=nt.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(f)}else if(window.navigator.msSaveOrOpenBlob||o){var h=l.split(","),d=h[0].indexOf("base64")>-1,v=o?decodeURIComponent(h[1]):h[1];d&&(v=window.atob(v));var g=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var m=v.length,x=new Uint8Array(m);m--;)x[m]=v.charCodeAt(m);var _=new Blob([x]);window.navigator.msSaveOrOpenBlob(_,g)}else{var b=document.createElement("iframe");document.body.appendChild(b);var S=b.contentWindow,T=S.document;T.open("image/svg+xml","replace"),T.write(v),T.close(),S.focus(),T.execCommand("SaveAs",!0,g),document.body.removeChild(b)}}else{var C=i.get("lang"),A='',P=window.open();P.document.write(A),P.document.title=a}},t.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:J.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(ea),TH="__ec_magicType_stack__",SYe=[["line","bar"],["stack"]],TYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var r=this.model,n=r.get("icon"),i={};return B(r.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},t.getDefaultOption=function(r){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:r.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},t.prototype.onclick=function(r,n,i){var a=this.model,o=a.get(["seriesIndex",i]);if(CH[i]){var s={series:[]},l=function(f){var h=f.subType,d=f.id,v=CH[i](h,d,f,a);v&&(Pe(v,f.option),s.series.push(v));var g=f.coordinateSystem;if(g&&g.type==="cartesian2d"&&(i==="line"||i==="bar")){var m=g.getAxesByScale("ordinal")[0];if(m){var x=m.dim,_=x+"Axis",b=f.getReferringComponents(_,er).models[0],S=b.componentIndex;s[_]=s[_]||[];for(var T=0;T<=S;T++)s[_][S]=s[_][S]||{};s[_][S].boundaryGap=i==="bar"}}};B(SYe,function(f){We(f,i)>=0&&B(f,function(h){a.setIconStatus(h,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=He({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(c="tiled")),n.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},t}(ea),CH={line:function(e,t,r,n){if(e==="bar")return He({id:t,type:"line",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(e,t,r,n){if(e==="line")return He({id:t,type:"bar",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(e,t,r,n){var i=r.get("stack")===TH;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),He({id:t,stack:i?"":TH},n.get(["option","stack"])||{},!0)}};eo({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var lC=new Array(60).join("-"),hv=" ";function CYe(e){var t={},r=[],n=[];return e.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;t[s]||(t[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),t[s].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:t,other:r,meta:n}}function AYe(e){var t=[];return B(e,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(se(r.series,function(d){return d.name})),l=[i.model.getCategories()];B(r.series,function(d){var v=d.getRawData();l.push(d.getRawData().mapArray(v.mapDimension(o),function(g){return g}))});for(var u=[s.join(hv)],c=0;c=0)return!0}var jO=new RegExp("["+hv+"]+","g");function AYe(e){for(var t=e.split(/\n+/g),r=Qw(t.shift()).split(jO),n=[],i=se(r,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=r[a];if(o[i])break}if(a<0){var s=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(t)}function OYe(e){var t=IR(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return fie(r,function(i,a){for(var o=t.length-1;o>=0;o--)if(i=t[o][a],i){n[a]=i;break}}),n}function EYe(e){hie(e).snapshots=null}function DYe(e){return IR(e).length}function IR(e){var t=hie(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var NYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){EYe(r),n.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(r){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:r.getLocaleModel().get(["toolbox","restore","title"])};return n},t}(ea);Qa({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var jYe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],OR=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=wH(r,t);B(RYe,function(o,s){(!n||!n.include||We(n.include,s)>=0)&&o(a,i._targetInfoList)})}return e.prototype.setOutputRanges=function(t,r){return this.matchOutputRanges(t,r,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var o=tP[n.brushType](0,a,i);n.__rangeOffset={offset:AH[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){B(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&B(a.coordSyses,function(o){var s=tP[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){B(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=tP[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?AH[n.brushType](a.values,o.offset,BYe(a.xyMinMax,o.xyMinMax)):a.values}},this)},e.prototype.makePanelOpts=function(t,r){return se(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:mne(i),isTargetByCursor:xne(i,t,n.coordSysModel),getLinearBrushOtherExtent:yne(i)}})},e.prototype.controlSeries=function(t,r,n){var i=this.findTargetInfo(t,n);return i===!0||i&&We(i.coordSyses,r.coordinateSystem)>=0},e.prototype.findTargetInfo=function(t,r){for(var n=this._targetInfoList,i=wH(r,t),a=0;ae[1]&&e.reverse(),e}function wH(e,t){return dd(e,t,{includeMainTypes:jYe})}var RYe={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=_e(),o={},s={};!r&&!n&&!i||(B(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),B(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),B(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];B(u.getCartesians(),function(f,h){(We(r,f.getAxis("x").model)>=0||We(n,f.getAxis("y").model)>=0)&&c.push(f)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:TH.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){B(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:TH.geo})})}},SH=[function(e,t){var r=e.xAxisModel,n=e.yAxisModel,i=e.gridModel;return!i&&r&&(i=r.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===t.gridModel},function(e,t){var r=e.geoModel;return r&&r===t.geoModel}],TH={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(ql(e)),t}},tP={lineX:Fe(CH,0),lineY:Fe(CH,1),rect:function(e,t,r,n){var i=e?t.pointToData([r[0][0],r[1][0]],n):t.dataToPoint([r[0][0],r[1][0]],n),a=e?t.pointToData([r[0][1],r[1][1]],n):t.dataToPoint([r[0][1],r[1][1]],n),o=[RO([i[0],a[0]]),RO([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,r,n){var i=[[1/0,-1/0],[1/0,-1/0]],a=se(r,function(o){var s=e?t.pointToData(o,n):t.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function CH(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=RO(se([0,1],function(s){return t?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var AH={lineX:Fe(MH,0),lineY:Fe(MH,1),rect:function(e,t,r){return[[e[0][0]-r[0]*t[0][0],e[0][1]-r[0]*t[0][1]],[e[1][0]-r[1]*t[1][0],e[1][1]-r[1]*t[1][1]]]},polygon:function(e,t,r){return se(e,function(n,i){return[n[0]-r[0]*t[i][0],n[1]-r[1]*t[i][1]]})}};function MH(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function BYe(e,t){var r=PH(e),n=PH(t),i=[r[0]/n[0],r[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function PH(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var BO=B,zYe=_Re("toolbox-dataZoom_"),$Ye=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i,a){this._brushController||(this._brushController=new nR(i.getZr()),this._brushController.on("brush",me(this._onBrush,this)).mount()),GYe(r,n,this,a,i),VYe(r,n)},t.prototype.onclick=function(r,n,i){FYe[i].call(this)},t.prototype.remove=function(r,n){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(r,n){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(r){var n=r.areas;if(!r.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new OR(ER(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,f){if(f.type==="cartesian2d"){var h=u.brushType;h==="rect"?(s("x",f,c[0]),s("y",f,c[1])):s({lineX:"x",lineY:"y"}[h],f,c)}}),IYe(a,i),this._dispatchZoomAction(i);function s(u,c,f){var h=c.getAxis(u),d=h.model,v=l(u,d,a),g=v.findRepresentativeAxisProxy(d).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(f=hu(0,f.slice(),h.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),v&&(i[v.id]={dataZoomId:v.id,startValue:f[0],endValue:f[1]})}function l(u,c,f){var h;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var v=d.getAxisModel(u,c.componentIndex);v&&(h=d)}),h}},t.prototype._dispatchZoomAction=function(r){var n=[];BO(r,function(i,a){n.push(Ae(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},t.getDefaultOption=function(r){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:r.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:J.color.backgroundTint}};return n},t}(ea),FYe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(OYe(this.ecModel))}};function ER(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex="all"),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex="all"),t}function VYe(e,t){e.setIconStatus("back",DYe(t)>1?"emphasis":"normal")}function GYe(e,t,r,n,i){var a=r._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),r._isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new OR(ER(e),t,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()}:!1)}t3e("dataZoom",function(e){var t=e.getComponent("toolbox",0),r=["feature","dataZoom"];if(!t||t.get(r)==null)return;var n=t.getModel(r),i=[],a=ER(n),o=dd(e,a);BO(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),BO(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var f=l.componentIndex,h={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:zYe+u+f};h[c]=f,i.push(h)}return i});function WYe(e){e.registerComponentModel(pYe),e.registerComponentView(gYe),Lh("saveAsImage",yYe),Lh("magicType",_Ye),Lh("dataView",kYe),Lh("dataZoom",$Ye),Lh("restore",NYe),Ze(vYe)}var HYe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:J.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:J.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:J.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:J.color.tertiary,fontSize:14}},t}(Ke);function die(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function vie(e){if(nt.domSupported){for(var t=document.documentElement.style,r=0,n=e.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,f=o+i,h=f*Math.abs(Math.cos(c))+f*Math.abs(Math.sin(c)),d=Math.round(((h-Math.SQRT2*i)/2+Math.SQRT2*i-(h-f)/2)*100)/100;s+=";"+a+":-"+d+"px";var v=t+" solid "+i+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+v,"border-right:"+v,"background-color:"+n+";"];return'
'}function JYe(e,t,r){var n="cubic-bezier(0.23,1,0.32,1)",i="",a="";return r&&(i=" "+e/2+"s "+n,a="opacity"+i+",visibility"+i),t||(i=" "+e+"s "+n,a+=(a.length?",":"")+(nt.transformSupported?""+DR+i:",left"+i+",top"+i)),YYe+":"+a}function kH(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!nt.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=nt.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+DR+":"+o+";":[["top",0],["left",0],[pie,o]]}function QYe(e){var t=[],r=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var i=be(e.get("lineHeight"),Math.round(r*3/2));r&&t.push("line-height:"+i+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return a&&o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),B(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function eXe(e,t,r,n){var i=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),c=e.get("shadowOffsetY"),f=e.getModel("textStyle"),h=iee(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(JYe(a,r,n)),o&&i.push("background-color:"+o),B(["width","color","radius"],function(v){var g="border-"+v,m=ej(g),y=e.get(m);y!=null&&i.push(g+":"+y+(v==="color"?"":"px"))}),i.push(QYe(f)),h!=null&&i.push("padding:"+Hv(h).join("px ")+"px"),i.join(";")+";"}function LH(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&zNe(e,o,r,n,i)}else{e[0]=n,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var tXe=function(){function e(t,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,nt.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),a=r.appendTo,o=a&&(pe(a)?document.querySelector(a):uf(a)?a:Ce(a)&&a(t.getDom()));LH(this._styleCoord,i,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(n),this._api=t,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,c=i.painter.getViewportRoot();Zi(c,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return e.prototype.update=function(t){if(!this._container){var r=this._api.getDom(),n=ZYe(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},e.prototype.show=function(t,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=XYe+eXe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+kH(a[0],a[1],!0)+("border-color:"+gf(r)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(t,r,n,i,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(pe(a)&&n.get("trigger")==="item"&&!die(n)&&(s=KYe(n,i,a)),pe(t))o.innerHTML=t+s;else if(t){o.innerHTML="",ae(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api,a=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(r,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||nt.node||!i.getDom())){var o=EH(a,i);this._ticket="";var s=a.dataByCoordSys,l=lXe(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=nXe;c.x=a.x,c.y=a.y,c.update(),De(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var f=Jne(a,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(EH(a,i))},t.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var c=u.getData(),f=og([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){var s=De(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;jc(i,function(c){if(c.tooltipDisabled)return l=u=null,!0;l||u||(De(c).dataIndex!=null?l=c:De(c).tooltipConfig!=null&&(u=c))},!0),l?this._showSeriesItemTooltip(r,l,n):u?this._showComponentItemTooltip(r,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},t.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=me(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},t.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=og([n.tooltipOption],a),l=this._renderMode,u=[],c=Cr("section",{blocks:[],noHeader:!0}),f=[],h=new j2;B(r,function(_){B(_.dataByAxis,function(b){var S=i.getComponent(b.axisDim+"Axis",b.axisIndex),T=b.value;if(!(!S||T==null)){var C=Yne(T,S.axis,i,b.seriesDataIndices,b.valueLabelOpt),A=Cr("section",{header:C,noHeader:!Ci(C),sortBlocks:!0,blocks:[]});c.blocks.push(A),B(b.seriesDataIndices,function(P){var I=i.getSeriesByIndex(P.seriesIndex),k=P.dataIndexInside,E=I.getDataParams(k);if(!(E.dataIndex<0)){E.axisDim=b.axisDim,E.axisIndex=b.axisIndex,E.axisType=b.axisType,E.axisId=b.axisId,E.axisValue=Lw(S.axis,{value:T}),E.axisValueLabel=C,E.marker=h.makeTooltipMarker("item",gf(E.color),l);var D=XV(I.formatTooltip(k,!0,null)),N=D.frag;if(N){var z=og([I],a).get("valueFormatter");A.blocks.push(z?ie({valueFormatter:z},N):N)}D.text&&f.push(D.text),u.push(E)}})}})}),c.blocks.reverse(),f.reverse();var d=n.position,v=s.get("order"),g=t6(c,h,l,v,i.get("useUTC"),s.get("textStyle"));g&&f.unshift(g);var m=l==="richText"?` +`),meta:t.meta}}function rS(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function kYe(e){var t=e.slice(0,e.indexOf(` +`));if(t.indexOf(hv)>=0)return!0}var FO=new RegExp("["+hv+"]+","g");function LYe(e){for(var t=e.split(/\n+/g),r=rS(t.shift()).split(FO),n=[],i=se(r,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=r[a];if(o[i])break}if(a<0){var s=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(t)}function jYe(e){var t=NR(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return pie(r,function(i,a){for(var o=t.length-1;o>=0;o--)if(i=t[o][a],i){n[a]=i;break}}),n}function RYe(e){gie(e).snapshots=null}function BYe(e){return NR(e).length}function NR(e){var t=gie(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var zYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){RYe(r),n.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(r){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:r.getLocaleModel().get(["toolbox","restore","title"])};return n},t}(ea);eo({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var $Ye=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],jR=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=AH(r,t);B(FYe,function(o,s){(!n||!n.include||We(n.include,s)>=0)&&o(a,i._targetInfoList)})}return e.prototype.setOutputRanges=function(t,r){return this.matchOutputRanges(t,r,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var o=iP[n.brushType](0,a,i);n.__rangeOffset={offset:LH[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){B(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&B(a.coordSyses,function(o){var s=iP[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){B(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=iP[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?LH[n.brushType](a.values,o.offset,VYe(a.xyMinMax,o.xyMinMax)):a.values}},this)},e.prototype.makePanelOpts=function(t,r){return se(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:bne(i),isTargetByCursor:Sne(i,t,n.coordSysModel),getLinearBrushOtherExtent:wne(i)}})},e.prototype.controlSeries=function(t,r,n){var i=this.findTargetInfo(t,n);return i===!0||i&&We(i.coordSyses,r.coordinateSystem)>=0},e.prototype.findTargetInfo=function(t,r){for(var n=this._targetInfoList,i=AH(r,t),a=0;ae[1]&&e.reverse(),e}function AH(e,t){return dd(e,t,{includeMainTypes:$Ye})}var FYe={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=_e(),o={},s={};!r&&!n&&!i||(B(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),B(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),B(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];B(u.getCartesians(),function(f,h){(We(r,f.getAxis("x").model)>=0||We(n,f.getAxis("y").model)>=0)&&c.push(f)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:PH.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){B(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:PH.geo})})}},MH=[function(e,t){var r=e.xAxisModel,n=e.yAxisModel,i=e.gridModel;return!i&&r&&(i=r.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===t.gridModel},function(e,t){var r=e.geoModel;return r&&r===t.geoModel}],PH={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Jl(e)),t}},iP={lineX:Fe(kH,0),lineY:Fe(kH,1),rect:function(e,t,r,n){var i=e?t.pointToData([r[0][0],r[1][0]],n):t.dataToPoint([r[0][0],r[1][0]],n),a=e?t.pointToData([r[0][1],r[1][1]],n):t.dataToPoint([r[0][1],r[1][1]],n),o=[VO([i[0],a[0]]),VO([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,r,n){var i=[[1/0,-1/0],[1/0,-1/0]],a=se(r,function(o){var s=e?t.pointToData(o,n):t.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function kH(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=VO(se([0,1],function(s){return t?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var LH={lineX:Fe(IH,0),lineY:Fe(IH,1),rect:function(e,t,r){return[[e[0][0]-r[0]*t[0][0],e[0][1]-r[0]*t[0][1]],[e[1][0]-r[1]*t[1][0],e[1][1]-r[1]*t[1][1]]]},polygon:function(e,t,r){return se(e,function(n,i){return[n[0]-r[0]*t[i][0],n[1]-r[1]*t[i][1]]})}};function IH(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function VYe(e,t){var r=OH(e),n=OH(t),i=[r[0]/n[0],r[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function OH(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var GO=B,GYe=TRe("toolbox-dataZoom_"),WYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i,a){this._brushController||(this._brushController=new sR(i.getZr()),this._brushController.on("brush",me(this._onBrush,this)).mount()),ZYe(r,n,this,a,i),UYe(r,n)},t.prototype.onclick=function(r,n,i){HYe[i].call(this)},t.prototype.remove=function(r,n){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(r,n){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(r){var n=r.areas;if(!r.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new jR(RR(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,f){if(f.type==="cartesian2d"){var h=u.brushType;h==="rect"?(s("x",f,c[0]),s("y",f,c[1])):s({lineX:"x",lineY:"y"}[h],f,c)}}),NYe(a,i),this._dispatchZoomAction(i);function s(u,c,f){var h=c.getAxis(u),d=h.model,v=l(u,d,a),g=v.findRepresentativeAxisProxy(d).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(f=hu(0,f.slice(),h.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),v&&(i[v.id]={dataZoomId:v.id,startValue:f[0],endValue:f[1]})}function l(u,c,f){var h;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var v=d.getAxisModel(u,c.componentIndex);v&&(h=d)}),h}},t.prototype._dispatchZoomAction=function(r){var n=[];GO(r,function(i,a){n.push(Ae(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},t.getDefaultOption=function(r){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:r.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:J.color.backgroundTint}};return n},t}(ea),HYe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(jYe(this.ecModel))}};function RR(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex="all"),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex="all"),t}function UYe(e,t){e.setIconStatus("back",BYe(t)>1?"emphasis":"normal")}function ZYe(e,t,r,n,i){var a=r._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),r._isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new jR(RR(e),t,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()}:!1)}aBe("dataZoom",function(e){var t=e.getComponent("toolbox",0),r=["feature","dataZoom"];if(!t||t.get(r)==null)return;var n=t.getModel(r),i=[],a=RR(n),o=dd(e,a);GO(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),GO(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var f=l.componentIndex,h={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:GYe+u+f};h[c]=f,i.push(h)}return i});function YYe(e){e.registerComponentModel(xYe),e.registerComponentView(_Ye),Lh("saveAsImage",wYe),Lh("magicType",TYe),Lh("dataView",EYe),Lh("dataZoom",WYe),Lh("restore",zYe),Ze(yYe)}var XYe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:J.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:J.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:J.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:J.color.tertiary,fontSize:14}},t}(Ke);function mie(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function yie(e){if(nt.domSupported){for(var t=document.documentElement.style,r=0,n=e.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,f=o+i,h=f*Math.abs(Math.cos(c))+f*Math.abs(Math.sin(c)),d=Math.round(((h-Math.SQRT2*i)/2+Math.SQRT2*i-(h-f)/2)*100)/100;s+=";"+a+":-"+d+"px";var v=t+" solid "+i+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+v,"border-right:"+v,"background-color:"+n+";"];return'
'}function rXe(e,t,r){var n="cubic-bezier(0.23,1,0.32,1)",i="",a="";return r&&(i=" "+e/2+"s "+n,a="opacity"+i+",visibility"+i),t||(i=" "+e+"s "+n,a+=(a.length?",":"")+(nt.transformSupported?""+BR+i:",left"+i+",top"+i)),JYe+":"+a}function EH(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!nt.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=nt.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+BR+":"+o+";":[["top",0],["left",0],[xie,o]]}function nXe(e){var t=[],r=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var i=be(e.get("lineHeight"),Math.round(r*3/2));r&&t.push("line-height:"+i+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return a&&o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),B(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function iXe(e,t,r,n){var i=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),c=e.get("shadowOffsetY"),f=e.getModel("textStyle"),h=lee(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(rXe(a,r,n)),o&&i.push("background-color:"+o),B(["width","color","radius"],function(v){var g="border-"+v,m=ij(g),x=e.get(m);x!=null&&i.push(g+":"+x+(v==="color"?"":"px"))}),i.push(nXe(f)),h!=null&&i.push("padding:"+Zv(h).join("px ")+"px"),i.join(";")+";"}function DH(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&GNe(e,o,r,n,i)}else{e[0]=n,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var aXe=function(){function e(t,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,nt.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),a=r.appendTo,o=a&&(pe(a)?document.querySelector(a):uf(a)?a:Ce(a)&&a(t.getDom()));DH(this._styleCoord,i,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(n),this._api=t,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,c=i.painter.getViewportRoot();Zi(c,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return e.prototype.update=function(t){if(!this._container){var r=this._api.getDom(),n=KYe(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},e.prototype.show=function(t,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=QYe+iXe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+EH(a[0],a[1],!0)+("border-color:"+gf(r)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(t,r,n,i,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(pe(a)&&n.get("trigger")==="item"&&!mie(n)&&(s=tXe(n,i,a)),pe(t))o.innerHTML=t+s;else if(t){o.innerHTML="",ae(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api,a=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(r,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||nt.node||!i.getDom())){var o=RH(a,i);this._ticket="";var s=a.dataByCoordSys,l=hXe(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=sXe;c.x=a.x,c.y=a.y,c.update(),De(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var f=rie(a,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(RH(a,i))},t.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var c=u.getData(),f=lg([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){var s=De(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;jc(i,function(c){if(c.tooltipDisabled)return l=u=null,!0;l||u||(De(c).dataIndex!=null?l=c:De(c).tooltipConfig!=null&&(u=c))},!0),l?this._showSeriesItemTooltip(r,l,n):u?this._showComponentItemTooltip(r,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},t.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=me(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},t.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=lg([n.tooltipOption],a),l=this._renderMode,u=[],c=Cr("section",{blocks:[],noHeader:!0}),f=[],h=new z2;B(r,function(_){B(_.dataByAxis,function(b){var S=i.getComponent(b.axisDim+"Axis",b.axisIndex),T=b.value;if(!(!S||T==null)){var C=Jne(T,S.axis,i,b.seriesDataIndices,b.valueLabelOpt),A=Cr("section",{header:C,noHeader:!Ci(C),sortBlocks:!0,blocks:[]});c.blocks.push(A),B(b.seriesDataIndices,function(P){var I=i.getSeriesByIndex(P.seriesIndex),k=P.dataIndexInside,E=I.getDataParams(k);if(!(E.dataIndex<0)){E.axisDim=b.axisDim,E.axisIndex=b.axisIndex,E.axisType=b.axisType,E.axisId=b.axisId,E.axisValue=Ew(S.axis,{value:T}),E.axisValueLabel=C,E.marker=h.makeTooltipMarker("item",gf(E.color),l);var D=QV(I.formatTooltip(k,!0,null)),N=D.frag;if(N){var z=lg([I],a).get("valueFormatter");A.blocks.push(z?ie({valueFormatter:z},N):N)}D.text&&f.push(D.text),u.push(E)}})}})}),c.blocks.reverse(),f.reverse();var d=n.position,v=s.get("order"),g=a6(c,h,l,v,i.get("useUTC"),s.get("textStyle"));g&&f.unshift(g);var m=l==="richText"?` -`:"
",y=f.join(m);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],d,null,h)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=De(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,f=o.dataType,h=u.getData(f),d=this._renderMode,v=r.positionDefault,g=og([h.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),m=g.get("trigger");if(!(m!=null&&m!=="item")){var y=u.getDataParams(c,f),_=new j2;y.marker=_.makeTooltipMarker("item",gf(y.color),d);var b=XV(u.formatTooltip(c,!1,f)),S=g.get("order"),T=g.get("valueFormatter"),C=b.frag,A=C?t6(T?ie({valueFormatter:T},C):C,_,d,S,a.get("useUTC"),g.get("textStyle")):b.text,P="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,A,y,P,r.offsetX,r.offsetY,r.position,r.target,_)}),i({type:"showTip",dataIndexInside:c,dataIndex:h.getRawIndex(c),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=De(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(pe(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Ae(l),l.content=In(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=r.positionDefault,v=og(f,this._tooltipModel,d?{position:d}:null),g=v.get("content"),m=Math.random()+"",y=new j2;this._showOrMove(v,function(){var _=Ae(v.get("formatterParams")||{});this._showTooltipContent(v,g,_,m,r.offsetX,r.offsetY,r.position,n,y)}),i({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(r,n,i,a,o,s,l,u,c){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var f=this._tooltipContent;f.setEnterable(r.get("enterable"));var h=r.get("formatter");l=l||r.get("position");var d=n,v=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),g=v.color;if(h)if(pe(h)){var m=r.ecModel.get("useUTC"),y=ae(i)?i[0]:i,_=y&&y.axisType&&y.axisType.indexOf("time")>=0;d=h,_&&(d=p0(y.axisValue,d,m)),d=tj(d,i,!0)}else if(Ce(h)){var b=me(function(S,T){S===this._ticket&&(f.setContent(T,c,r,g,l),this._updatePosition(r,l,o,s,f,i,u))},this);this._ticket=a,d=h(i,a,b)}else d=h;f.setContent(d,c,r,g,l),f.show(r,g),this._updatePosition(r,l,o,s,f,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||ae(n))return{color:a||o};if(!ae(n))return{color:a||n.color||n.borderColor}},t.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();n=n||r.get("position");var f=o.getSize(),h=r.get("align"),d=r.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),Ce(n)&&(n=n([i,a],s,o.el,v,{viewSize:[u,c],contentSize:f.slice()})),ae(n))i=ve(n[0],u),a=ve(n[1],c);else if(ke(n)){var g=n;g.width=f[0],g.height=f[1];var m=zt(g,{width:u,height:c});i=m.x,a=m.y,h=null,d=null}else if(pe(n)&&l){var y=sXe(n,v,f,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=aXe(i,a,o,u,c,h?null:20,d?null:20);i=y[0],a=y[1]}if(h&&(i-=DH(h)?f[0]/2:h==="right"?f[0]:0),d&&(a-=DH(d)?f[1]/2:d==="bottom"?f[1]:0),die(r)){var y=oXe(i,a,o,u,c);i=y[0],a=y[1]}o.moveTo(i,a)},t.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&B(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&B(u,function(h,d){var v=f[d]||{},g=h.seriesDataIndices||[],m=v.seriesDataIndices||[];o=o&&h.value===v.value&&h.axisType===v.axisType&&h.axisId===v.axisId&&g.length===m.length,o&&B(g,function(y,_){var b=m[_];o=o&&y.seriesIndex===b.seriesIndex&&y.dataIndex===b.dataIndex}),a&&B(h.seriesDataIndices,function(y){var _=y.seriesIndex,b=n[_],S=a[_];b&&S&&S.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},t.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},t.prototype.dispose=function(r,n){nt.node||!n.getDom()||(Cy(this,"_updatePosition"),this._tooltipContent.dispose(),LO("itemTooltip",n))},t.type="tooltip",t}(kt);function og(e,t,r){var n=t.ecModel,i;r?(i=new et(r,n,n),i=new et(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof et&&(o=o.get("tooltip",!0)),pe(o)&&(o={formatter:o}),o&&(i=new et(o,i,n)))}return i}function EH(e,t){return e.dispatchAction||me(t.dispatchAction,t)}function aXe(e,t,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(e+l+a+2>n?e-=l+a:e+=a),o!=null&&(t+u+o>i?t-=u+o:t+=o),[e,t]}function oXe(e,t,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,n)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function sXe(e,t,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-a/2;break;case"top":s=t.x+u/2-i/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+o;break;case"left":s=t.x-i-o,l=t.y+c/2-a/2;break;case"right":s=t.x+u+o,l=t.y+c/2-a/2}return[s,l]}function DH(e){return e==="center"||e==="middle"}function lXe(e,t,r){var n=SN(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=Rv(t,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=De(u).tooltipConfig;if(c&&c.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function uXe(e){Ze(T0),e.registerComponentModel(HYe),e.registerComponentView(iXe),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},sr),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},sr)}var cXe=["rect","polygon","keep","clear"];function fXe(e,t){var r=Pt(e?e.brush:[]);if(r.length){var n=[];B(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;ae(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),hXe(s),t&&!s.length&&s.push.apply(s,cXe)}}function hXe(e){var t={};B(e,function(r){t[r]=1}),e.length=0,B(t,function(r,n){e.push(n)})}var NH=B;function jH(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function zO(e,t,r){var n={};return NH(t,function(a){var o=n[a]=i();NH(e[a],function(s,l){if(Hr.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new Hr(u),l==="opacity"&&(u=Ae(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Hr(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function mie(e,t,r){var n;B(r,function(i){t.hasOwnProperty(i)&&jH(t[i])&&(n=!0)}),n&&B(r,function(i){t.hasOwnProperty(i)&&jH(t[i])?e[i]=Ae(t[i]):delete e[i]})}function dXe(e,t,r,n,i,a){var o={};B(e,function(f){var h=Hr.prepareVisualTypes(t[f]);o[f]=h});var s;function l(f){return fj(r,s,f)}function u(f,h){vee(r,s,f,h)}r.each(c);function c(f,h){s=f;var d=r.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var v=n.call(i,f),g=t[v],m=o[v],y=0,_=m.length;y<_;y++){var b=m[y];g[b]&&g[b].applyVisual(f,l,u)}}}function vXe(e,t,r,n){var i={};return B(e,function(a){var o=Hr.prepareVisualTypes(t[a]);i[a]=o}),{progress:function(o,s){var l;n!=null&&(l=s.getDimensionIndex(n));function u(T){return fj(s,f,T)}function c(T,C){vee(s,f,T,C)}for(var f,h=s.getStore();(f=o.next())!=null;){var d=s.getRawDataItem(f);if(!(d&&d.visualMap===!1))for(var v=n!=null?h.get(l,f):f,g=r(v),m=t[g],y=i[g],_=0,b=y.length;_t[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&FH(t)}};function FH(e){return new Oe(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var bXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new nR(n.getZr())).on("brush",me(this._onBrush,this)).mount()},t.prototype.render=function(r,n,i,a){this.model=r,this._updateController(r,n,i,a)},t.prototype.updateTransform=function(r,n,i,a){yie(n),this._updateController(r,n,i,a)},t.prototype.updateVisual=function(r,n,i,a){this.updateTransform(r,n,i,a)},t.prototype.updateView=function(r,n,i,a){this._updateController(r,n,i,a)},t.prototype._updateController=function(r,n,i,a){(!a||a.$from!==r.id)&&this._brushController.setPanels(r.brushTargetManager.makePanelOpts(i)).enableBrush(r.brushOption).updateCovers(r.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(r){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(r.areas,this.ecModel);(!r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:Ae(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Ae(i),$from:n})},t.type="brush",t}(kt),wXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.areas=[],r.brushOption={},r}return t.prototype.optionUpdated=function(r,n){var i=this.option;!n&&mie(i,r,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:this.option.defaultOutOfBrushColor},a.hasOwnProperty("liftZ")||(a.liftZ=5)},t.prototype.setAreas=function(r){r&&(this.areas=se(r,function(n){return VH(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=VH(this.option,r),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:J.color.backgroundTint,borderColor:J.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:J.color.disabled},t}(Ke);function VH(e,t){return He({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new et(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var SXe=["rect","polygon","lineX","lineY","keep","clear"],TXe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,B(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},t.prototype.updateView=function(r,n,i){this.render(r,n,i)},t.prototype.getIcons=function(){var r=this.model,n=r.get("icon",!0),i={};return B(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},t.prototype.onclick=function(r,n,i){var a=this._brushType,o=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},t.getDefaultOption=function(r){var n={show:!0,type:SXe.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:r.getLocaleModel().get(["toolbox","brush","title"])};return n},t}(ea);function CXe(e){e.registerComponentView(bXe),e.registerComponentModel(wXe),e.registerPreprocessor(fXe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,gXe),e.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(t,r){r.eachComponent({mainType:"brush",query:t},function(n){n.setAreas(t.areas)})}),e.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},sr),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},sr),Lh("brush",TXe)}var AXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode={type:"box",ignoreSize:!0},r}return t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:J.size.m,backgroundColor:J.color.transparent,borderColor:J.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:J.color.primary},subtextStyle:{fontSize:12,color:J.color.quaternary}},t}(Ke),MXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this.group.removeAll(),!!r.get("show")){var a=this.group,o=r.getModel("textStyle"),s=r.getModel("subtextStyle"),l=r.get("textAlign"),u=be(r.get("textBaseline"),r.get("textVerticalAlign")),c=new at({style:Mt(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=c.getBoundingRect(),h=r.get("subtext"),d=new at({style:Mt(s,{text:h,fill:s.getTextColor(),y:f.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),v=r.get("link"),g=r.get("sublink"),m=r.get("triggerEvent",!0);c.silent=!v&&!m,d.silent=!g&&!m,v&&c.on("click",function(){xw(v,"_"+r.get("target"))}),g&&d.on("click",function(){xw(g,"_"+r.get("subtarget"))}),De(c).eventData=De(d).eventData=m?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),h&&a.add(d);var y=a.getBoundingRect(),_=r.getBoxLayoutParams();_.width=y.width,_.height=y.height;var b=jr(r,i),S=zt(_,b.refContainer,r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?S.x+=S.width:l==="center"&&(S.x+=S.width/2)),u||(u=r.get("top")||r.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?S.y+=S.height:u==="middle"&&(S.y+=S.height/2),u=u||"top"),a.x=S.x,a.y=S.y,a.markRedraw();var T={align:l,verticalAlign:u};c.setStyle(T),d.setStyle(T),y=a.getBoundingRect();var C=S.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var P=new Xe({shape:{x:y.x-C[3],y:y.y-C[0],width:y.width+C[1]+C[3],height:y.height+C[0]+C[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(kt);function PXe(e){e.registerComponentModel(AXe),e.registerComponentView(MXe)}var GH=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode="box",r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),this._initData()},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(r){r==null&&(r=this.option.currentIndex);var n=this._data.count();this.option.loop?r=(r%n+n)%n:(r>=n&&(r=n-1),r<0&&(r=0)),this.option.currentIndex=r},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(r){this.option.autoPlay=!!r},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var r=this.option,n=r.data||[],i=r.axisType,a=this._names=[],o;i==="category"?(o=[],B(n,function(u,c){var f=Ir(jv(u),""),h;ke(u)?(h=Ae(u),h.value=c):h=c,o.push(h),a.push(f)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new En([{name:"value",type:s}],this);l.initData(o,a)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:J.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:J.color.secondary},data:[]},t}(Ke),xie=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline.slider",t.defaultOption=Mu(GH.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:J.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:J.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:J.color.tertiary},itemStyle:{color:J.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:J.color.accent50,borderColor:J.color.accent50,borderWidth:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0, 0, 0, 0)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z",stopIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z",nextIcon:"path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z",prevIcon:"path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z",prevBtnSize:18,nextBtnSize:18,color:J.color.accent50,borderColor:J.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:J.color.accent60},itemStyle:{color:J.color.accent60,borderColor:J.color.accent60},controlStyle:{color:J.color.accent70,borderColor:J.color.accent70}},progress:{lineStyle:{color:J.color.accent30},itemStyle:{color:J.color.accent40}},data:[]}),t}(GH);cr(xie,WT.prototype);var kXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline",t}(kt),LXe=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this,r,n,i)||this;return o.type=a||"value",o}return t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},t}(ba),nP=Math.PI,WH=Je(),IXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){this.api=n},t.prototype.render=function(r,n,i){if(this.model=r,this.api=i,this.ecModel=n,this.group.removeAll(),r.get("show",!0)){var a=this._layout(r,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return Cr("nameValue",{noName:!0,value:c})},B(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,r)},this),this._renderAxisLabel(a,s,l,r),this._position(a,r)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(r,n){var i=r.get(["label","position"]),a=r.get("orient"),o=EXe(r,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:nP/2},f=a==="vertical"?o.height:o.width,h=r.getModel("controlStyle"),d=h.get("show",!0),v=d?h.get("itemSize"):0,g=d?h.get("itemGap"):0,m=v+g,y=r.get(["label","rotate"])||0;y=y*nP/180;var _,b,S,T=h.get("position",!0),C=d&&h.get("showPlayBtn",!0),A=d&&h.get("showPrevBtn",!0),P=d&&h.get("showNextBtn",!0),I=0,k=f;T==="left"||T==="bottom"?(C&&(_=[0,0],I+=m),A&&(b=[I,0],I+=m),P&&(S=[k-v,0],k-=m)):(C&&(_=[k-v,0],k-=m),A&&(b=[0,0],I+=m),P&&(S=[k-v,0],k-=m));var E=[I,k];return r.get("inverse")&&E.reverse(),{viewRect:o,mainLength:f,orient:a,rotation:c[a],labelRotation:y,labelPosOpt:s,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||u[a],playPosition:_,prevBtnPosition:b,nextBtnPosition:S,axisExtent:E,controlSize:v,controlGap:g}},t.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=Wr(),l=o.x,u=o.y+o.height;Ya(s,s,[-l,-u]),Ks(s,s,-nP/2),Ya(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),f=_(i.getBoundingRect()),h=_(a.getBoundingRect()),d=[i.x,i.y],v=[a.x,a.y];v[0]=d[0]=c[0][0];var g=r.labelPosOpt;if(g==null||pe(g)){var m=g==="+"?0:1;b(d,f,c,1,m),b(v,h,c,1,1-m)}else{var m=g>=0?0:1;b(d,f,c,1,m),v[1]=d[1]+g}i.setPosition(d),a.setPosition(v),i.rotation=a.rotation=r.rotation,y(i),y(a);function y(S){S.originX=c[0][0]-S.x,S.originY=c[1][0]-S.y}function _(S){return[[S.x,S.x+S.width],[S.y,S.y+S.height]]}function b(S,T,C,A,P){S[A]+=C[A][P]-T[A][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=OXe(n,a);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new LXe("value",o,r.axisExtent,a);return l.model=n,l},t.prototype._createGroup=function(r){var n=this[r]=new Me;return this.group.add(n),n},t.prototype._renderAxisLine=function(r,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new mr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:ie({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new mr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Pe({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},t.prototype._renderAxisTick=function(r,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],B(l,function(u){var c=i.dataToCoord(u.value),f=s.getItemModel(u.value),h=f.getModel("itemStyle"),d=f.getModel(["emphasis","itemStyle"]),v=f.getModel(["progress","itemStyle"]),g={x:c,y:0,onclick:me(o._changeTimeline,o,u.value)},m=HH(f,h,n,g);m.ensureState("emphasis").style=d.getItemStyle(),m.ensureState("progress").style=v.getItemStyle(),Xl(m);var y=De(m);f.get("tooltip")?(y.dataIndex=u.value,y.dataModel=a):y.dataIndex=y.dataModel=null,o._tickSymbols.push(m)})},t.prototype._renderAxisLabel=function(r,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],B(u,function(c){var f=c.tickValue,h=l.getItemModel(f),d=h.getModel("label"),v=h.getModel(["emphasis","label"]),g=h.getModel(["progress","label"]),m=i.dataToCoord(c.tickValue),y=new at({x:m,y:0,rotation:r.labelRotation-r.rotation,onclick:me(o._changeTimeline,o,f),silent:!1,style:Mt(d,{text:c.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});y.ensureState("emphasis").style=Mt(v),y.ensureState("progress").style=Mt(g),n.add(y),Xl(y),WH(y).dataIndex=f,o._tickLabels.push(y)})}},t.prototype._renderControl=function(r,n,i,a){var o=r.controlSize,s=r.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),f=a.get("inverse",!0);h(r.nextBtnPosition,"next",me(this._changeTimeline,this,f?"-":"+")),h(r.prevBtnPosition,"prev",me(this._changeTimeline,this,f?"+":"-")),h(r.playPosition,c?"stop":"play",me(this._handlePlayClick,this,!c),!0);function h(d,v,g,m){if(d){var y=Xa(be(a.get(["controlStyle",v+"BtnSize"]),o),o),_=[0,-y/2,y,y],b=DXe(a,v+"Icon",_,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:m?-s:0,rectHover:!0,style:l,onclick:g});b.ensureState("emphasis").style=u,n.add(b),Xl(b)}}},t.prototype._renderCurrentPointer=function(r,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(f){f.draggable=!0,f.drift=me(u._handlePointerDrag,u),f.ondragend=me(u._handlePointerDragend,u),UH(f,u._progressLine,s,i,a,!0)},onUpdate:function(f){UH(f,u._progressLine,s,i,a)}};this._currentPointer=HH(l,l,this._mainGroup,{},this._currentPointer,c)},t.prototype._handlePlayClick=function(r){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:r,from:this.uid})},t.prototype._handlePointerDrag=function(r,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},t.prototype._handlePointerDragend=function(r){this._pointerChangeTimeline([r.offsetX,r.offsetY],!0)},t.prototype._pointerChangeTimeline=function(r,n){var i=this._toAxisCoord(r)[0],a=this._axis,o=Ai(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(v)),[s,d]}var j_={min:Fe(N_,"min"),max:Fe(N_,"max"),average:Fe(N_,"average"),median:Fe(N_,"median")};function Fy(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!$Xe(t)&&!ae(t.coord)&&ae(i)){var a=_ie(t,r,n,e);if(t=Ae(t),t.type&&j_[t.type]&&a.baseAxis&&a.valueAxis){var o=We(i,a.baseAxis.dim),s=We(i,a.valueAxis.dim),l=j_[t.type](r,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else t.coord=[t.xAxis!=null?t.xAxis:t.radiusAxis,t.yAxis!=null?t.yAxis:t.angleAxis]}if(t.coord==null||!ae(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&j_[t.type]){var c=n.getOtherAxis(u);c&&(t.value=eS(r,r.mapDimension(c.dim),t.type))}}else for(var f=t.coord,h=0;h<2;h++)j_[f[h]]&&(f[h]=eS(r,r.mapDimension(i[h]),f[h]));return t}}function _ie(e,t,r,n){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex!=null?t.getDimension(e.valueIndex):e.valueDim,i.valueAxis=r.getAxis(FXe(n,i.valueDataDim)),i.baseAxis=r.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=r.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function FXe(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function Vy(e,t){return e&&e.containData&&t.coord&&!FO(t)?e.containData(t.coord):!0}function VXe(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!FO(t)&&!FO(r)?e.containZone(t.coord,r.coord):!0}function bie(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return Jl(o,t[a])}:function(r,n,i,a){return Jl(r.value,t[a])}}function eS(e,t,r){if(r==="average"){var n=0,i=0;return e.each(t,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?e.getMedian(t):e.getDataExtent(t)[r==="max"?1:0]}var iP=Je(),jR=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(){this.markerGroupMap=_e()},t.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){iP(s).keep=!1}),n.eachSeries(function(s){var l=Wo.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!iP(s).keep&&a.group.remove(s.group)}),GXe(n,o,this.type)},t.prototype.markKeep=function(r){iP(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;B(r,function(a){var o=Wo.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?jJ(l):IN(l))})}})},t.type="marker",t}(kt);function GXe(e,t,r){e.eachSeries(function(n){var i=Wo.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=pf(i),s=o.z,l=o.zlevel;$T(a.group,s,l)}})}function YH(e,t,r){var n=t.coordinateSystem,i=r.getWidth(),a=r.getHeight(),o=n&&n.getArea&&n.getArea();e.each(function(s){var l=e.getItemModel(s),u=l.get("relativeTo")==="coordinate",c=u?o?o.width:0:i,f=u?o?o.height:0:a,h=u&&o?o.x:0,d=u&&o?o.y:0,v,g=ve(l.get("x"),c)+h,m=ve(l.get("y"),f)+d;if(!isNaN(g)&&!isNaN(m))v=[g,m];else if(t.getMarkerPosition)v=t.getMarkerPosition(e.getValues(e.dimensions,s));else if(n){var y=e.get(n.dimensions[0],s),_=e.get(n.dimensions[1],s);v=n.dataToPoint([y,_])}isNaN(g)||(v[0]=g),isNaN(m)||(v[1]=m),e.setItemLayout(s,v)})}var WXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Wo.getMarkerModelFromSeries(a,"markPoint");o&&(YH(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new _0),f=HXe(o,r,n);n.setData(f),YH(n.getData(),r,a),f.each(function(h){var d=f.getItemModel(h),v=d.getShallow("symbol"),g=d.getShallow("symbolSize"),m=d.getShallow("symbolRotate"),y=d.getShallow("symbolOffset"),_=d.getShallow("symbolKeepAspect");if(Ce(v)||Ce(g)||Ce(m)||Ce(y)){var b=n.getRawValue(h),S=n.getDataParams(h);Ce(v)&&(v=v(b,S)),Ce(g)&&(g=g(b,S)),Ce(m)&&(m=m(b,S)),Ce(y)&&(y=y(b,S))}var T=d.getModel("itemStyle").getItemStyle(),C=d.get("z2"),A=m0(l,"color");T.fill||(T.fill=A),f.setItemVisual(h,{z2:be(C,0),symbol:v,symbolSize:g,symbolRotate:m,symbolOffset:y,symbolKeepAspect:_,style:T})}),c.updateData(f),this.group.add(c.group),f.eachItemGraphicEl(function(h){h.traverse(function(d){De(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markPoint",t}(jR);function HXe(e,t,r){var n;e?n=se(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return ie(ie({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new En(n,r),a=se(r.get("data"),Fe(Fy,t));e&&(a=ht(a,Fe(Vy,e)));var o=bie(!!e,n);return i.initData(a,null,o),i}function UXe(e){e.registerComponentModel(zXe),e.registerComponentView(WXe),e.registerPreprocessor(function(t){NR(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var ZXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.createMarkerModelFromSeries=function(r,n,i){return new t(r,n,i)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(Wo),R_=Je(),YXe=function(e,t,r,n){var i=e.getData(),a;if(ae(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=t.getAxis(n.yAxis!=null?"y":"x"),l=rn(n.yAxis,n.xAxis);else{var u=_ie(n,i,t,e);s=u.valueAxis;var c=Tj(i,u.valueDataDim);l=eS(i,c,o)}var f=s.dim==="x"?0:1,h=1-f,d=Ae(n),v={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,v.coord[h]=1/0;var g=r.get("precision");g>=0&&ot(l)&&(l=+l.toFixed(Math.min(g,20))),d.coord[f]=v.coord[f]=l,a=[d,v,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var m=[Fy(e,a[0]),Fy(e,a[1]),ie({},a[2])];return m[2].type=m[2].type||null,He(m[2],m[0]),He(m[2],m[1]),m};function tS(e){return!isNaN(e)&&!isFinite(e)}function XH(e,t,r,n){var i=1-e,a=n.dimensions[e];return tS(t[i])&&tS(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function XXe(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(XH(1,r,n,e)||XH(0,r,n,e)))return!0}return Vy(e,t[0])&&Vy(e,t[1])}function aP(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ve(o.get("x"),i.getWidth()),u=ve(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,f=e.get(c[0],t),h=e.get(c[1],t);s=a.dataToPoint([f,h])}if(fu(a,"cartesian2d")){var d=a.getAxis("x"),v=a.getAxis("y"),c=a.dimensions;tS(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):tS(e.get(c[1],t))&&(s[1]=v.toGlobalCoord(v.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}e.setItemLayout(t,s)}var qXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Wo.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=R_(o).from,u=R_(o).to;l.each(function(c){aP(l,c,!0,a,i),aP(u,c,!1,a,i)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new tR);this.group.add(c.group);var f=KXe(o,r,n),h=f.from,d=f.to,v=f.line;R_(n).from=h,R_(n).to=d,n.setData(v);var g=n.get("symbol"),m=n.get("symbolSize"),y=n.get("symbolRotate"),_=n.get("symbolOffset");ae(g)||(g=[g,g]),ae(m)||(m=[m,m]),ae(y)||(y=[y,y]),ae(_)||(_=[_,_]),f.from.each(function(S){b(h,S,!0),b(d,S,!1)}),v.each(function(S){var T=v.getItemModel(S),C=T.getModel("lineStyle").getLineStyle();v.setItemLayout(S,[h.getItemLayout(S),d.getItemLayout(S)]);var A=T.get("z2");C.stroke==null&&(C.stroke=h.getItemVisual(S,"style").fill),v.setItemVisual(S,{z2:be(A,0),fromSymbolKeepAspect:h.getItemVisual(S,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(S,"symbolOffset"),fromSymbolRotate:h.getItemVisual(S,"symbolRotate"),fromSymbolSize:h.getItemVisual(S,"symbolSize"),fromSymbol:h.getItemVisual(S,"symbol"),toSymbolKeepAspect:d.getItemVisual(S,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(S,"symbolOffset"),toSymbolRotate:d.getItemVisual(S,"symbolRotate"),toSymbolSize:d.getItemVisual(S,"symbolSize"),toSymbol:d.getItemVisual(S,"symbol"),style:C})}),c.updateData(v),f.line.eachItemGraphicEl(function(S){De(S).dataModel=n,S.traverse(function(T){De(T).dataModel=n})});function b(S,T,C){var A=S.getItemModel(T);aP(S,T,C,r,a);var P=A.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=m0(l,"color")),S.setItemVisual(T,{symbolKeepAspect:A.get("symbolKeepAspect"),symbolOffset:be(A.get("symbolOffset",!0),_[C?0:1]),symbolRotate:be(A.get("symbolRotate",!0),y[C?0:1]),symbolSize:be(A.get("symbolSize"),m[C?0:1]),symbol:be(A.get("symbol",!0),g[C?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(jR);function KXe(e,t,r){var n;e?n=se(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return ie(ie({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new En(n,r),a=new En(n,r),o=new En([],r),s=se(r.get("data"),Fe(YXe,t,e,r));e&&(s=ht(s,Fe(XXe,e)));var l=bie(!!e,n);return i.initData(se(s,function(u){return u[0]}),null,l),a.initData(se(s,function(u){return u[1]}),null,l),o.initData(se(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function JXe(e){e.registerComponentModel(ZXe),e.registerComponentView(qXe),e.registerPreprocessor(function(t){NR(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var QXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.createMarkerModelFromSeries=function(r,n,i){return new t(r,n,i)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(Wo),B_=Je(),eqe=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=Fy(e,i),s=Fy(e,a),l=o.coord,u=s.coord;l[0]=rn(l[0],-1/0),l[1]=rn(l[1],-1/0),u[0]=rn(u[0],1/0),u[1]=rn(u[1],1/0);var c=ST([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function rS(e){return!isNaN(e)&&!isFinite(e)}function qH(e,t,r,n){var i=1-e;return rS(t[i])&&rS(r[i])}function tqe(e,t){var r=t.coord[0],n=t.coord[1],i={coord:r,x:t.x0,y:t.y0},a={coord:n,x:t.x1,y:t.y1};return fu(e,"cartesian2d")?r&&n&&(qH(1,r,n)||qH(0,r,n))?!0:VXe(e,i,a):Vy(e,i)||Vy(e,a)}function KH(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ve(o.get(r[0]),i.getWidth()),u=ve(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var c=e.getValues(["x0","y0"],t),f=e.getValues(["x1","y1"],t),h=a.clampData(c),d=a.clampData(f),v=[];r[0]==="x0"?v[0]=h[0]>d[0]?f[0]:c[0]:v[0]=h[0]>d[0]?c[0]:f[0],r[1]==="y0"?v[1]=h[1]>d[1]?f[1]:c[1]:v[1]=h[1]>d[1]?c[1]:f[1],s=n.getMarkerPosition(v,r,!0)}else{var g=e.get(r[0],t),m=e.get(r[1],t),y=[g,m];a.clampData&&a.clampData(y,y),s=a.dataToPoint(y,!0)}if(fu(a,"cartesian2d")){var _=a.getAxis("x"),b=a.getAxis("y"),g=e.get(r[0],t),m=e.get(r[1],t);rS(g)?s[0]=_.toGlobalCoord(_.getExtent()[r[0]==="x0"?0:1]):rS(m)&&(s[1]=b.toGlobalCoord(b.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var JH=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],rqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Wo.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=se(JH,function(f){return KH(s,l,f,a,i)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Me});this.group.add(c.group),this.markKeep(c);var f=nqe(o,r,n);n.setData(f),f.each(function(h){var d=se(JH,function(k){return KH(f,h,k,r,a)}),v=o.getAxis("x").scale,g=o.getAxis("y").scale,m=v.getExtent(),y=g.getExtent(),_=[v.parse(f.get("x0",h)),v.parse(f.get("x1",h))],b=[g.parse(f.get("y0",h)),g.parse(f.get("y1",h))];Ai(_),Ai(b);var S=!(m[0]>_[1]||m[1]<_[0]||y[0]>b[1]||y[1]=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:J.size.m,align:"auto",backgroundColor:J.color.transparent,borderColor:J.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:J.color.disabled,inactiveBorderColor:J.color.disabled,inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:J.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:J.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:J.color.tertiary,borderWidth:1,borderColor:J.color.border},emphasis:{selectorLabel:{show:!0,color:J.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(Ke),bh=Fe,GO=B,z_=Me,wie=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.newlineDisabled=!1,r}return t.prototype.init=function(){this.group.add(this._contentGroup=new z_),this.group.add(this._selectorGroup=new z_),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var c=jr(r,i).refContainer,f=r.getBoxLayoutParams(),h=r.get("padding"),d=zt(f,c,h),v=this.layoutInner(r,o,d,a,l,u),g=zt(Pe({width:v.width,height:v.height},f),c,h);this.group.x=g.x-v.x,this.group.y=g.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=cie(v,r))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(r,n,i,a,o,s,l){var u=this.getContentGroup(),c=_e(),f=n.get("selectedMode"),h=n.get("triggerEvent"),d=[];i.eachRawSeries(function(v){!v.get("legendHoverLink")&&d.push(v.id)}),GO(n.getData(),function(v,g){var m=this,y=v.get("name");if(!this.newlineDisabled&&(y===""||y===` -`)){var _=new z_;_.newline=!0,u.add(_);return}var b=i.getSeriesByName(y)[0];if(!c.get(y))if(b){var S=b.getData(),T=S.getVisual("legendLineStyle")||{},C=S.getVisual("legendIcon"),A=S.getVisual("style"),P=this._createItem(b,y,g,v,n,r,T,A,C,f,a);P.on("click",bh(QH,y,null,a,d)).on("mouseover",bh(WO,b.name,null,a,d)).on("mouseout",bh(HO,b.name,null,a,d)),i.ssr&&P.eachChild(function(I){var k=De(I);k.seriesIndex=b.seriesIndex,k.dataIndex=g,k.ssrType="legend"}),h&&P.eachChild(function(I){m.packEventData(I,n,b,g,y)}),c.set(y,!0)}else i.eachRawSeries(function(I){var k=this;if(!c.get(y)&&I.legendVisualProvider){var E=I.legendVisualProvider;if(!E.containName(y))return;var D=E.indexOfName(y),N=E.getItemVisual(D,"style"),z=E.getItemVisual(D,"legendIcon"),F=On(N.fill);F&&F[3]===0&&(F[3]=.2,N=ie(ie({},N),{fill:la(F,"rgba")}));var $=this._createItem(I,y,g,v,n,r,{},N,z,f,a);$.on("click",bh(QH,null,y,a,d)).on("mouseover",bh(WO,null,y,a,d)).on("mouseout",bh(HO,null,y,a,d)),i.ssr&&$.eachChild(function(Z){var j=De(Z);j.seriesIndex=I.seriesIndex,j.dataIndex=g,j.ssrType="legend"}),h&&$.eachChild(function(Z){k.packEventData(Z,n,I,g,y)}),c.set(y,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},t.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};De(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();GO(r,function(u){var c=u.type,f=new at({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(f);var h=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);Ur(f,{normal:h,emphasis:d},{defaultText:u.title}),Xl(f)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,f,h){var d=r.visualDrawType,v=o.get("itemWidth"),g=o.get("itemHeight"),m=o.isSelected(n),y=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),b=a.get("icon");c=b||c||"roundRect";var S=oqe(c,a,l,u,d,m,h),T=new z_,C=a.getModel("textStyle");if(Ce(r.getLegendIcon)&&(!b||b==="inherit"))T.add(r.getLegendIcon({itemWidth:v,itemHeight:g,icon:c,iconRotate:y,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:_}));else{var A=b==="inherit"&&r.getData().getVisual("symbol")?y==="inherit"?r.getData().getVisual("symbolRotate"):y:0;T.add(sqe({itemWidth:v,itemHeight:g,icon:c,iconRotate:A,itemStyle:S.itemStyle,symbolKeepAspect:_}))}var P=s==="left"?v+5:-5,I=s,k=o.get("formatter"),E=n;pe(k)&&k?E=k.replace("{name}",n??""):Ce(k)&&(E=k(n));var D=m?C.getTextColor():a.get("inactiveColor");T.add(new at({style:Mt(C,{text:E,x:P,y:g/2,fill:D,align:I,verticalAlign:"middle"},{inheritColor:D})}));var N=new Xe({shape:T.getBoundingRect(),style:{fill:"transparent"}}),z=a.getModel("tooltip");return z.get("show")&&Qs({el:N,componentModel:o,itemName:n,itemTooltipOption:z.option}),T.add(N),T.eachChild(function(F){F.silent=!0}),N.silent=!f,this.getContentGroup().add(T),Xl(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Zc(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),f=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){Zc("horizontal",u,r.get("selectorItemGap",!0));var h=u.getBoundingRect(),d=[-h.x,-h.y],v=r.get("selectorButtonGap",!0),g=r.getOrient().index,m=g===0?"width":"height",y=g===0?"height":"width",_=g===0?"y":"x";s==="end"?d[g]+=c[m]+v:f[g]+=h[m]+v,d[1-g]+=c[y]/2-h[y]/2,u.x=d[0],u.y=d[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[m]=c[m]+v+h[m],b[y]=Math.max(c[y],h[y]),b[_]=Math.min(0,h[_]+d[1-g]),b}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(kt);function oqe(e,t,r,n,i,a,o){function s(m,y){m.lineWidth==="auto"&&(m.lineWidth=y.lineWidth>0?2:0),GO(m,function(_,b){m[b]==="inherit"&&(m[b]=y[b])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?n.decal:iv(f,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var h=t.getModel("lineStyle"),d=h.getLineStyle();if(s(d,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),d.stroke==="auto"&&(d.stroke=n.fill),!a){var v=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth=v==="auto"?n.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),d.stroke=h.get("inactiveColor"),d.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function sqe(e){var t=e.icon||"roundRect",r=xr(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return r.setStyle(e.itemStyle),r.rotation=(e.iconRotate||0)*Math.PI/180,r.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=J.color.neutral00,r.style.lineWidth=2),r}function QH(e,t,r,n){HO(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),WO(e,t,r,n)}function Sie(e){for(var t=e.getZr().storage.getDisplayList(),r,n=0,i=t.length;ni[o],m=[-d.x,-d.y];n||(m[a]=c[u]);var y=[0,0],_=[-v.x,-v.y],b=be(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(g){var S=r.get("pageButtonPosition",!0);S==="end"?_[a]+=i[o]-v[o]:y[a]+=v[o]+b}_[1-a]+=d[s]/2-v[s]/2,c.setPosition(m),f.setPosition(y),h.setPosition(_);var T={x:0,y:0};if(T[o]=g?i[o]:d[o],T[s]=Math.max(d[s],v[s]),T[l]=Math.min(0,v[l]+_[1-a]),f.__rectSize=i[o],g){var C={x:0,y:0};C[o]=Math.max(i[o]-v[o]-b,0),C[s]=T[s],f.setClipPath(new Xe({shape:C})),f.__rectSize=C[o]}else h.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var A=this._getPageInfo(r);return A.pageIndex!=null&<(c,{x:A.contentPosition[0],y:A.contentPosition[1]},g?r:null),this._updatePageInfoView(r,A),T},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;B(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",h=n[f]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",h?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=h?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",pe(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=oP[o],l=sP[o],u=this._findTargetItemIndex(n),c=i.children(),f=c[u],h=c.length,d=h?1:0,v={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return v;var g=S(f);v.contentPosition[o]=-g.s;for(var m=u+1,y=g,_=g,b=null;m<=h;++m)b=S(c[m]),(!b&&_.e>y.s+a||b&&!T(b,y.s))&&(_.i>y.i?y=_:y=b,y&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=y.i),++v.pageCount)),_=b;for(var m=u-1,y=g,_=g,b=null;m>=-1;--m)b=S(c[m]),(!b||!T(_,b.s))&&y.i<_.i&&(_=y,v.pagePrevDataIndex==null&&(v.pagePrevDataIndex=y.i),++v.pageCount,++v.pageIndex),y=b;return v;function S(C){if(C){var A=C.getBoundingRect(),P=A[l]+C[l];return{s:P,e:P+A[s],i:C.__legendDataIndex}}}function T(C,A){return C.e>=A&&C.s<=A+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t}(wie);function hqe(e){e.registerAction("legendScroll","legendscroll",function(t,r){var n=t.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:t},function(i){i.setScrollDataIndex(n)})})}function dqe(e){Ze(Tie),e.registerComponentModel(cqe),e.registerComponentView(fqe),hqe(e)}function vqe(e){Ze(Tie),Ze(dqe)}var pqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="dataZoom.inside",t.defaultOption=Mu($y.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}($y),RR=Je();function gqe(e,t,r){RR(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function mqe(e,t){for(var r=RR(e).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=u),o=o&&l.get("preventDefaultMouseMove",!0)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:r,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint}}}}function wqe(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=RR(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=_e());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=sie(a);B(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,yqe(r,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=_e());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){Cie(i,a);return}var c=bqe(l,a,r);o.enable(c.controlType,c.opt),Yv(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Sqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return t.prototype.render=function(r,n,i){if(e.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),gqe(i,r,{pan:me(lP.pan,this),zoom:me(lP.zoom,this),scrollMove:me(lP.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){mqe(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(kR),lP={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=uP[t](null,[n.originX,n.originY],o,r,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(hu(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:nU(function(e,t,r,n,i,a){var o=uP[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:nU(function(e,t,r,n,i,a){var o=uP[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function nU(e){return function(t,r,n,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,r,n,i);if(hu(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var uP={grid:function(e,t,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem.getRect();return e=e||[0,0],a.dim==="x"?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),r.mainType==="radiusAxis"?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,r,n,i){var a=r.axis,o=i.model.coordinateSystem.getRect(),s={};return e=e||[0,0],a.orient==="horizontal"?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function Aie(e){LR(e),e.registerComponentModel(pqe),e.registerComponentView(Sqe),wqe(e)}var Tqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=Mu($y.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:J.color.accent10,borderRadius:0,backgroundColor:J.color.transparent,dataBackground:{lineStyle:{color:J.color.accent30,width:.5},areaStyle:{color:J.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:J.color.accent40,width:.5},areaStyle:{color:J.color.accent20,opacity:.3}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:J.color.neutral00,borderColor:J.color.accent20},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:J.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:J.color.tertiary},brushSelect:!0,brushStyle:{color:J.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:J.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}($y),ug=Xe,Cqe=1,cP=30,Aqe=7,cg="horizontal",iU="vertical",Mqe=5,Pqe=["line","bar","candlestick","scatter"],kqe={easing:"cubicOut",duration:100,delay:0},Lqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._displayables={},r}return t.prototype.init=function(r,n){this.api=n,this._onBrush=me(this._onBrush,this),this._onBrushEnd=me(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),Yv(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Cy(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new Me;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(n),this._positionGroup()},t.prototype._resetLocation=function(){var r=this.dataZoomModel,n=this.api,i=r.get("brushSelect"),a=i?Aqe:0,o=jr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===cg?{right:o.width-s.x-s.width,top:o.height-cP-l-a,width:s.width,height:cP}:{right:l,top:s.y,width:cP,height:s.height},c=Of(r.option);B(["right","top","width","height"],function(h){c[h]==="ph"&&(c[h]=u[h])});var f=zt(c,o);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===iU&&this._size.reverse()},t.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===cg&&!o?{scaleY:l?1:-1,scaleX:1}:i===cg&&o?{scaleY:l?1:-1,scaleX:-1}:i===iU&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]);r.x=n.x-u.x,r.y=n.y-u.y,r.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var r=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=r.get("brushSelect");i.add(new ug({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new ug({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:me(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},t.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var n=this._size,i=this._shadowSize||[],a=r.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var f=o.getDataExtent(r.thisDim),h=o.getDataExtent(l),d=(h[1]-h[0])*.3;h=[h[0]-d,h[1]+d];var v=[0,n[1]],g=[0,n[0]],m=[[n[0],0],[0,0]],y=[],_=g[1]/Math.max(1,o.count()-1),b=n[0]/(f[1]-f[0]),S=r.thisAxis.type==="time",T=-_,C=Math.round(o.count()/n[0]),A;o.each([r.thisDim,l],function(D,N,z){if(C>0&&z%C){S||(T+=_);return}T=S?(+D-f[0])*b:T+_;var F=N==null||isNaN(N)||N==="",$=F?0:gt(N,h,v,!0);F&&!A&&z?(m.push([m[m.length-1][0],0]),y.push([y[y.length-1][0],0])):!F&&A&&(m.push([T,0]),y.push([T,0])),F||(m.push([T,$]),y.push([T,$])),A=F}),u=this._shadowPolygonPts=m,c=this._shadowPolylinePts=y}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var P=this.dataZoomModel;function I(D){var N=P.getModel(D?"selectedDataBackground":"dataBackground"),z=new Me,F=new bn({shape:{points:u},segmentIgnoreThreshold:1,style:N.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),$=new an({shape:{points:c},segmentIgnoreThreshold:1,style:N.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return z.add(F),z.add($),z}for(var k=0;k<3;k++){var E=I(k===1);this._displayables.sliderGroup.add(E),this._displayables.dataShadowSegs.push(E)}},t.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,n=r.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return r.eachTargetAxis(function(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();B(l,function(u){if(!i&&!(n!==!0&&We(Pqe,u.get("type"))<0)){var c=a.getComponent(Nl(o),s).axis,f=Iqe(o),h,d=u.coordinateSystem;f!=null&&d.getOtherAxis&&(h=d.getOtherAxis(c).inverse),f=u.getData().mapDimension(f);var v=u.getData().mapDimension(o);i={thisAxis:c,series:u,thisDim:v,otherDim:f,otherAxisInverse:h}}},this)},this),i}},t.prototype._renderHandle=function(){var r=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,f=l.get("brushSelect"),h=n.filler=new ug({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new ug({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:Cqe,fill:J.color.transparent}})),B([0,1],function(b){var S=l.get("handleIcon");!ww[S]&&S.indexOf("path://")<0&&S.indexOf("image://")<0&&(S="path://"+S);var T=xr(S,-1,0,2,2,null,!0);T.attr({cursor:Oqe(this._orient),draggable:!0,drift:me(this._onDragMove,this,b),ondragend:me(this._onDragEnd,this),onmouseover:me(this._showDataInfo,this,!0),onmouseout:me(this._showDataInfo,this,!1),z2:5});var C=T.getBoundingRect(),A=l.get("handleSize");this._handleHeight=ve(A,this._size[1]),this._handleWidth=C.width/C.height*this._handleHeight,T.setStyle(l.getModel("handleStyle").getItemStyle()),T.style.strokeNoScale=!0,T.rectHover=!0,T.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Xl(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[b]=T);var I=l.getModel("textStyle"),k=l.get("handleLabel")||{},E=k.show||!1;r.add(a[b]=new at({silent:!0,invisible:!E,style:Mt(I,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:I.getTextColor(),font:I.getFont()}),z2:10}))},this);var d=h;if(f){var v=ve(l.get("moveHandleSize"),s[1]),g=n.moveHandle=new Xe({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:v}}),m=v*.8,y=n.moveHandleIcon=xr(l.get("moveHandleIcon"),-m/2,-m/2,m,m,J.color.neutral00,!0);y.silent=!0,y.y=s[1]+v/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(v,10));d=n.moveZone=new Xe({invisible:!0,shape:{y:s[1]-_,height:v+_}}),d.on("mouseover",function(){u.enterEmphasis(g)}).on("mouseout",function(){u.leaveEmphasis(g)}),o.add(g),o.add(y),o.add(d)}d.attr({draggable:!0,cursor:"default",drift:me(this._onDragMove,this,"all"),ondragstart:me(this._showDataInfo,this,!0),ondragend:me(this._onDragEnd,this),onmouseover:me(this._showDataInfo,this,!0),onmouseout:me(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[gt(r[0],[0,100],n,!0),gt(r[1],[0,100],n,!0)]},t.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];hu(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?gt(s.minSpan,l,o,!0):null,s.maxSpan!=null?gt(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Ai([gt(a[0],o,l,!0),gt(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},t.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=Ai(i.slice()),o=this._size;B([0,1],function(d){var v=n.handles[d],g=this._handleHeight;v.attr({scaleX:g/2,scaleY:g/2,x:i[d]+(d?-1:1),y:o[1]/2-g/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;cn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(r){var n=r.offsetX,i=r.offsetY;this._brushStart=new Ie(n,i),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(r){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100],l=this._handleEnds=[i.x,i.x+i.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();hu(0,l,o,0,u.minSpan!=null?gt(u.minSpan,s,o,!0):null,u.maxSpan!=null?gt(u.maxSpan,s,o,!0):null),this._range=Ai([gt(l[0],o,s,!0),gt(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&($s(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},t.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new ug({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,n),c=l.transformCoordToLocal(s.x,s.y),f=this._size;u[0]=Math.max(Math.min(f[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:f[1]})},t.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?kqe:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=sie(this.dataZoomModel).infoList;if(!r&&n.length){var i=n[0].model.coordinateSystem;r=i.getRect&&i.getRect()}if(!r){var a=this.api.getWidth(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},t.type="dataZoom.slider",t}(kR);function Iqe(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function Oqe(e){return e==="vertical"?"ns-resize":"ew-resize"}function Mie(e){e.registerComponentModel(Tqe),e.registerComponentView(Lqe),LR(e)}function Eqe(e){Ze(Aie),Ze(Mie)}var Pie={get:function(e,t,r){var n=Ae((Dqe[e]||{})[t]);return r&&ae(n)?n[n.length-1]:n}},Dqe={color:{active:["#006edd","#e0ffff"],inactive:[J.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},aU=Hr.mapVisual,Nqe=Hr.eachVisual,jqe=ae,oU=B,Rqe=Ai,Bqe=gt,nS=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i)},t.prototype.optionUpdated=function(r,n){var i=this.option;!n&&mie(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=me(r,this),this.controllerVisuals=zO(this.option.controller,n,r),this.targetVisuals=zO(this.option.target,n,r)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var r=this.option.seriesId,n=this.option.seriesIndex;n==null&&r==null&&(n="all");var i=Rv(this.ecModel,"series",{index:n,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return se(i,function(a){return a.componentIndex})},t.prototype.eachTargetSeries=function(r,n){B(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&r.call(n,a)},this)},t.prototype.isTargetSeries=function(r){var n=!1;return this.eachTargetSeries(function(i){i===r&&(n=!0)}),n},t.prototype.formatValueText=function(r,n,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],ae(r)&&(r=r.slice(),u=!0);var c=n?r:u?[f(r[0]),f(r[1])]:f(r);if(pe(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(Ce(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===s[0]?i[0]+" "+c[1]:r[1]===s[1]?i[1]+" "+c[0]:c[0]+" - "+c[1];return c;function f(h){return h===s[0]?"min":h===s[1]?"max":(+h).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var r=this.option,n=Rqe([r.min,r.max]);this._dataExtent=n},t.prototype.getDataDimensionIndex=function(r){var n=this.option.dimension;if(n!=null)return r.getDimensionIndex(n);for(var i=r.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=r.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var r=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),o=n.controller||(n.controller={});He(a,i),He(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(f){jqe(n.color)&&!f.inRange&&(f.inRange={color:n.color.slice().reverse()}),f.inRange=f.inRange||{color:r.get("gradientColor")}}function u(f,h,d){var v=f[h],g=f[d];v&&!g&&(g=f[d]={},oU(v,function(m,y){if(Hr.isValidType(y)){var _=Pie.get(y,"inactive",s);_!=null&&(g[y]=_,y==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function c(f){var h=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,d=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,v=this.get("inactiveColor"),g=this.getItemSymbol(),m=g||"roundRect";oU(this.stateList,function(y){var _=this.itemSize,b=f[y];b||(b=f[y]={color:s?v:[v]}),b.symbol==null&&(b.symbol=h&&Ae(h)||(s?m:[m])),b.symbolSize==null&&(b.symbolSize=d&&Ae(d)||(s?_[0]:[_[0],_[0]])),b.symbol=aU(b.symbol,function(C){return C==="none"?m:C});var S=b.symbolSize;if(S!=null){var T=-1/0;Nqe(S,function(C){C>T&&(T=C)}),b.symbolSize=aU(S,function(C){return Bqe(C,[0,T],[0,_[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(r){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(r){return null},t.prototype.getVisualMeta=function(r){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:J.color.transparent,borderColor:J.color.borderTint,contentColor:J.color.theme[0],inactiveColor:J.color.disabled,borderWidth:0,padding:J.size.m,textGap:10,precision:0,textStyle:{color:J.color.secondary}},t}(Ke),sU=[20,140],zqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(r,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=sU[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=sU[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):ae(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],r[0]),n[1]=Math.min(n[1],r[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),B(this.stateList,function(r){var n=this.option.controller[r].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},t.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},t.prototype.getSelected=function(){var r=this.getExtent(),n=Ai((this.get("range")||[]).slice());return n[0]>r[1]&&(n[0]=r[1]),n[1]>r[1]&&(n[1]=r[1]),n[0]=i[1]||r<=n[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(r){var n=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},t.prototype.getVisualMeta=function(r){var n=lU(this,"outOfRange",this.getExtent()),i=lU(this,"inRange",this.option.range.slice()),a=[];function o(d,v){a.push({value:d,color:r(d,v)})}for(var s=0,l=0,u=i.length,c=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/i})}return a.push({color:this.getControllerVisual(r[1],"color",n),offset:1}),a},t.prototype._createBarPoints=function(r,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],r[0]],[i[0],r[0]],[i[0],r[1]],[i[0]-n[1],r[1]]]},t.prototype._createBarGroup=function(r){var n=this._orient,i=this.visualMapModel.get("inverse");return new Me(n==="horizontal"&&!i?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},t.prototype._updateHandle=function(r,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),c=this._applyTransform("left",i.mainGroup);$qe([0,1],function(f){var h=o[f];h.setStyle("fill",n.handlesColor[f]),h.y=r[f];var d=vo(r[f],[0,l[1]],u,!0),v=this.getControllerVisual(d,"symbolSize");h.scaleX=h.scaleY=v/l[0],h.x=l[0]-v/2;var g=Wa(i.handleLabelPoints[f],ql(h,this.group));if(this._orient==="horizontal"){var m=c==="left"||c==="top"?(l[0]-v)/2:(l[0]-v)/-2;g[1]+=m}s[f].setStyle({x:g[0],y:g[1],text:a.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(r,n,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,f=c.indicator;if(f){f.attr("invisible",!1);var h={convertOpacityToAlpha:!0},d=this.getControllerVisual(r,"color",h),v=this.getControllerVisual(r,"symbolSize"),g=vo(r,s,u,!0),m=l[0]-v/2,y={x:f.x,y:f.y};f.y=g,f.x=m;var _=Wa(c.indicatorLabelPoint,ql(f,this.group)),b=c.indicatorLabel;b.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,C=T==="horizontal";b.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:C?S:"middle",align:C?"center":S});var A={x:m,y:g,style:{fill:d}},P={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var I={duration:100,easing:"cubicInOut",additive:!0};f.x=y.x,f.y=y.y,f.animateTo(A,I),b.animateTo(P,I)}else f.attr(A),b.attr(P);this._firstShowIndicator=!1;var k=this._shapes.handleLabels;if(k)for(var E=0;Eo[1]&&(f[1]=1/0),n&&(f[0]===-1/0?this._showIndicator(c,f[1],"< ",l):f[1]===1/0?this._showIndicator(c,f[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var h=this._hoverLinkDataIndices,d=[];(n||hU(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var v=SRe(h,d);this._dispatchHighDown("downplay",_b(v[0],i)),this._dispatchHighDown("highlight",_b(v[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(jc(r.target,function(l){var u=De(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},t.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=o,n.push(a))}}),e.getData().setVisual("visualMeta",n)}}];function Yqe(e,t,r,n){for(var i=t.targetVisuals[n],a=Hr.prepareVisualTypes(i),o={color:m0(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(Hqe,Uqe),B(Zqe,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(Xqe))}function Oie(e){e.registerComponentModel(zqe),e.registerComponentView(Gqe),Iie(e)}var qqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._pieceList=[],r}return t.prototype.optionUpdated=function(r,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],Kqe[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=Ae(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=se(this._pieceList,function(l){return l=Ae(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=Hr.listVisualTypes(),a=this.isCategory();B(r.pieces,function(s){B(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),B(n,function(s,l){var u=!1;B(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&B(this.stateList,function(c){(r[c]||(r[c]={}))[l]=Pie.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,o=(n?i:r).selected||{};if(i.selected=o,B(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;B(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(r){this.option.selected=Ae(r)},t.prototype.getValueState=function(r){var n=Hr.findPieceIndex(r,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(r){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=Hr.findPieceIndex(l,i);c===r&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},this),n},t.prototype.getRepresentValue=function(r){var n;if(this.isCategory())n=r.value;else if(r.value!=null)n=r.value;else{var i=r.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},t.prototype.getVisualMeta=function(r){if(this.isCategory())return;var n=[],i=["",""],a=this;function o(c,f){var h=a.getRepresentValue({interval:c});f||(f=a.getValueState(h));var d=r(h,f);c[0]===-1/0?i[0]=d:c[1]===1/0?i[1]=d:n.push({value:c[0],color:d},{value:c[1],color:d})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return B(s,function(c){var f=c.interval;f&&(f[0]>u&&o([u,f[0]],"outOfRange"),o(f.slice()),u=f[1])},this),{stops:n,outerColors:i}},t.type="visualMap.piecewise",t.defaultOption=Mu(nS.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(nS),Kqe={splitNumber:function(e){var t=this.option,r=Math.min(t.precision,20),n=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(r)!==a&&r<5;)r++;t.precision=r,a=+a.toFixed(r),t.minOpen&&e.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function gU(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var Jqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.doRender=function(){var r=this.group;r.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,o=this._getItemAlign(),s=n.itemSize,l=this._getViewData(),u=l.endsText,c=rn(n.get("showLabel",!0),!u),f=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),B(l.viewPieceList,function(h){var d=h.piece,v=new Me;v.onclick=me(this._onItemClick,this,d),this._enableHoverLink(v,h.indexInModelPieceList);var g=n.getRepresentValue(d);if(this._createItemSymbol(v,g,[0,0,s[0],s[1]],f),c){var m=this.visualMapModel.getValueState(g),y=a.get("align")||o;v.add(new at({style:Mt(a,{x:y==="right"?-i:s[0]+i,y:s[1]/2,text:d.text,verticalAlign:a.get("verticalAlign")||"middle",align:y,opacity:be(a.get("opacity"),m==="outOfRange"?.5:1)}),silent:f}))}r.add(v)},this),u&&this._renderEndsText(r,u[1],s,c,o),Zc(n.get("orient"),r,n.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},t.prototype._enableHoverLink=function(r,n){var i=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:_b(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return Lie(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},t.prototype._renderEndsText=function(r,n,i,a,o){if(n){var s=new Me,l=this.visualMapModel.textStyleModel;s.add(new at({style:Mt(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),r.add(s)}},t.prototype._getViewData=function(){var r=this.visualMapModel,n=se(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},t.prototype._createItemSymbol=function(r,n,i,a){var o=xr(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,r.add(o)},t.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=Ae(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,B(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},t.type="visualMap.piecewise",t}(kie);function Eie(e){e.registerComponentModel(qqe),e.registerComponentView(Jqe),Iie(e)}function Qqe(e){Ze(Oie),Ze(Eie)}var eKe=function(){function e(t){this._thumbnailModel=t}return e.prototype.reset=function(t){this._renderVersion=t.getMainProcessVersion()},e.prototype.renderContent=function(t){var r=t.api.getViewOfComponentModel(this._thumbnailModel);r&&(t.group.silent=!0,r.renderContent({group:t.group,targetTrans:t.targetTrans,z2Range:nQ(t.group),roamType:t.roamType,viewportRect:t.viewportRect,renderVersion:this._renderVersion}))},e.prototype.updateWindow=function(t,r){var n=r.getViewOfComponentModel(this._thumbnailModel);n&&n.updateWindow({targetTrans:t,renderVersion:this._renderVersion})},e}(),tKe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.preventAutoZ=!0,r}return t.prototype.optionUpdated=function(r,n){this._updateBridge()},t.prototype._updateBridge=function(){var r=this._birdge=this._birdge||new eKe(this);if(this._target=null,this.ecModel.eachSeries(function(i){FW(i,null)}),this.shouldShow()){var n=this.getTarget();FW(n.baseMapProvider,r)}},t.prototype.shouldShow=function(){return this.getShallow("show",!0)},t.prototype.getBridge=function(){return this._birdge},t.prototype.getTarget=function(){if(this._target)return this._target;var r=this.getReferringComponents("series",{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];return r?r.subType!=="graph"&&(r=null):r=this.ecModel.queryComponents({mainType:"series",subType:"graph"})[0],this._target={baseMapProvider:r},this._target},t.type="thumbnail",t.layoutMode="box",t.dependencies=["series","geo"],t.defaultOption={show:!0,right:1,bottom:1,height:"25%",width:"25%",itemStyle:{borderColor:J.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:J.color.neutral30,borderColor:J.color.neutral40,opacity:.3},z:10},t}(Ke),rKe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this._api=i,this._model=r,this._coordSys||(this._coordSys=new Rf),!this._isEnabled()){this._clear();return}this._renderVersion=i.getMainProcessVersion();var a=this.group;a.removeAll();var o=r.getModel("itemStyle"),s=o.getItemStyle();s.fill==null&&(s.fill=n.get("backgroundColor")||J.color.neutral00);var l=jr(r,i).refContainer,u=zt(SQ(r,!0),l),c=s.lineWidth||0,f=this._contentRect=vf(u.clone(),c/2,!0,!0),h=new Me;a.add(h),h.setClipPath(new Xe({shape:f.plain()}));var d=this._targetGroup=new Me;h.add(d);var v=u.plain();v.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new Xe({style:s,shape:v,silent:!1,cursor:"grab"}));var g=r.getModel("windowStyle"),m=g.getShallow("borderRadius",!0);h.add(this._windowRect=new Xe({shape:{x:0,y:0,width:0,height:0,r:m},style:g.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),yU(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),yU(this._model,this))},t.prototype._dealRenderContent=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=this._targetGroup,i=this._coordSys,a=this._contentRect;if(n.removeAll(),!!r){var o=r.group,s=o.getBoundingRect();n.add(o),this._bgRect.z2=r.z2Range.min-10,i.setBoundingRect(s.x,s.y,s.width,s.height);var l=zt({left:"center",top:"center",aspect:s.width/s.height},a);i.setViewRect(l.x,l.y,l.width,l.height),o.attr(i.getTransformInfo().raw),this._windowRect.z2=r.z2Range.max+10,this._resetRoamController(r.roamType)}}},t.prototype.updateWindow=function(r){var n=this._bridgeRendered;n&&n.renderVersion===r.renderVersion&&(n.targetTrans=r.targetTrans),this._isEnabled()&&this._dealUpdateWindow()},t.prototype._dealUpdateWindow=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=va([],r.targetTrans),i=Va([],this._coordSys.transform,n);this._transThisToTarget=va([],i);var a=r.viewportRect;a?a=a.clone():a=new Oe(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(Pe({r:s},a))}},t.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new jf(i.getZr())),!r||!this._isEnabled()){a.disable();return}a.enable(r,{api:i,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(o,s,l){return n._contentRect.contain(s,l)}}}),a.off("pan").off("zoom").on("pan",me(this._onPan,this)).on("zoom",me(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=lr([],[r.oldX,r.oldY],n),a=lr([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(mU(this._model.getTarget().baseMapProvider,{dx:a[0]-i[0],dy:a[1]-i[1]}))}},t.prototype._onZoom=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=lr([],[r.originX,r.originY],n);this._api.dispatchAction(mU(this._model.getTarget().baseMapProvider,{zoom:1/r.scale,originX:i[0],originY:i[1]}))}},t.prototype._isEnabled=function(){var r=this._model;if(!r||!r.shouldShow())return!1;var n=r.getTarget().baseMapProvider;return!!n},t.prototype._clear=function(){this.group.removeAll(),this._bridgeRendered=null,this._roamController&&this._roamController.disable()},t.prototype.remove=function(){this._clear()},t.prototype.dispose=function(){this._clear()},t.type="thumbnail",t}(kt);function mU(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,ie(n,t),n}function yU(e,t){var r=pf(e);$T(t.group,r.z,r.zlevel)}function nKe(e){e.registerComponentModel(tKe),e.registerComponentView(rKe)}var iKe={label:{enabled:!0},decal:{show:!1}},xU=Je(),aKe={};function oKe(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=Ae(iKe);He(n.label,e.getLocaleModel().get("aria"),!1),He(r.option,n,!1),i(),a();function i(){var u=r.getModel("decal"),c=u.get("show");if(c){var f=_e();e.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),xU(h).scope=d}}),e.eachRawSeries(function(h){if(e.isSeriesFiltered(h))return;if(Ce(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var _=II(h.ecModel,h.name,aKe,e.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",S(b,_))}else{var v=h.getRawData(),g={},m=xU(h).scope;d.each(function(T){var C=d.getRawIndex(T);g[C]=T});var y=v.count();v.each(function(T){var C=g[T],A=v.getName(T)||T+"",P=II(h.ecModel,A,m,y),I=d.getItemVisual(C,"decal");d.setItemVisual(C,"decal",S(I,P))})}function S(T,C){var A=T?ie(ie({},C),T):C;return A.dirty=!0,A}})}}function a(){var u=t.getZr().dom;if(u){var c=e.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=Pe(f.option,c),!!f.get("enabled")){if(u.setAttribute("role","img"),f.get("description")){u.setAttribute("aria-label",f.get("description"));return}var h=e.getSeriesCount(),d=f.get(["data","maxCount"])||10,v=f.get(["series","maxCount"])||10,g=Math.min(h,v),m;if(!(h<1)){var y=s();if(y){var _=f.get(["general","withTitle"]);m=o(_,{title:y})}else m=f.get(["general","withoutTitle"]);var b=[],S=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);m+=o(S,{seriesCount:h}),e.eachSeries(function(P,I){if(I1?f.get(["series","multiple",D]):f.get(["series","single",D]),k=o(k,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var N=P.getData();if(N.count()>d){var z=f.get(["data","partialData"]);k+=o(z,{displayCnt:d})}else k+=f.get(["data","allData"]);for(var F=f.get(["data","separator","middle"]),$=f.get(["data","separator","end"]),Z=f.get(["data","excludeDimensionId"]),j=[],U=0;U":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},uKe=function(){function e(t){var r=this._condVal=pe(t)?new RegExp(t):MK(t)?t:null;if(r==null){var n="";mt(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return pe(r)?this._condVal.test(t):ot(r)?this._condVal.test(t+""):!1},e}(),cKe=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),fKe=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[N,z]}function c(N,z,F,$){Jh(N,F)&&Jh(z,$)||i.push(N,z,F,$,F,$)}function f(N,z,F,$,Z,j){var U=Math.abs(z-N),G=Math.tan(U/4)*4/3,V=zP:E2&&n.push(i),n}function ZO(e,t,r,n,i,a,o,s,l,u){if(Jh(e,r)&&Jh(t,n)&&Jh(i,o)&&Jh(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-e,d=s-t,v=Math.sqrt(h*h+d*d);h/=v,d/=v;var g=r-e,m=n-t,y=i-o,_=a-s,b=g*g+m*m,S=y*y+_*_;if(b=0&&P=0){l.push(o,s);return}var I=[],k=[];uu(e,r,i,o,.5,I),uu(t,n,a,s,.5,k),ZO(I[0],k[0],I[1],k[1],I[2],k[2],I[3],k[3],l,u),ZO(I[4],k[4],I[5],k[5],I[6],k[6],I[7],k[7],l,u)}function CKe(e,t){var r=UO(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),f=Nie([l,u],c?0:1,t),h=(c?s:u)/f.length,d=0;di,o=Nie([n,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=e[s]/o.length,h=0;h1?null:new Ie(g*l+e,g*u+t)}function PKe(e,t,r){var n=new Ie;Ie.sub(n,r,t),n.normalize();var i=new Ie;Ie.sub(i,e,t);var a=i.dot(n);return a}function Sh(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function kKe(e,t,r){for(var n=e.length,i=[],a=0;ao?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),kKe(t,u,c)}function iS(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);iS(e,a[0],i,n),iS(e,a[1],r-i,n)}return n}function LKe(e,t){for(var r=[],n=0;n0;u/=2){var c=0,f=0;(e&u)>0&&(c=1),(t&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(e=u-1-e,t=u-1-t),l=e,e=t,t=l)}return s}function sS(e){var t=1/0,r=1/0,n=-1/0,i=-1/0,a=se(e,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),r=Math.min(f,r),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=se(a,function(s,l){return{cp:s,z:zKe(s[0],s[1],t,r,n,i),path:e[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function Bie(e){return EKe(e.path,e.count)}function YO(){return{fromIndividuals:[],toIndividuals:[],count:0}}function $Ke(e,t,r){var n=[];function i(T){for(var C=0;C=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var VKe={clone:function(e){for(var t=[],r=1-Math.pow(1-e.path.style.opacity,1/e.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;PU(e)&&(u=e,c=t),PU(t)&&(u=t,c=e);function f(y,_,b,S,T){var C=y.many,A=y.one;if(C.length===1&&!T){var P=_?C[0]:A,I=_?A:C[0];if(aS(P))f({many:[P],one:I},!0,b,S,!0);else{var k=s?Pe({delay:s(b,S)},l):l;zR(P,I,k),a(P,I,P,I,k)}}else for(var E=Pe({dividePath:VKe[r],individualDelay:s&&function(Z,j,U,G){return s(Z+b,S)}},l),D=_?$Ke(C,A,E):FKe(A,C,E),N=D.fromIndividuals,z=D.toIndividuals,F=N.length,$=0;$t.length,d=u?kU(c,u):kU(h?t:e,[h?e:t]),v=0,g=0;gzie))for(var a=n.getIndices(),o=0;o0&&C.group.traverse(function(P){P instanceof tt&&!P.animators.length&&P.animateFrom({style:{opacity:0}},A)})})}function DU(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function NU(e){return ae(e)?e.sort().join(","):e}function _l(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function XKe(e,t){var r=_e(),n=_e(),i=_e();return B(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=DU(a),c=NU(u);n.set(c,{dataGroupId:s,data:l}),ae(u)&&B(u,function(f){i.set(f,{key:c,dataGroupId:s,data:l})})}),B(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=DU(a),u=NU(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:_l(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:_l(s),data:s}]});else if(ae(l)){var f=[];B(l,function(v){var g=n.get(v);g.data&&f.push({dataGroupId:g.dataGroupId,divide:_l(g.data),data:g.data})}),f.length&&r.set(u,{oldSeries:f,newSeries:[{dataGroupId:o,data:s,divide:_l(s)}]})}else{var h=i.get(l);if(h){var d=r.get(h.key);d||(d={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:_l(h.data)}],newSeries:[]},r.set(h.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:_l(s)})}}}}),r}function jU(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:_l(t.oldData[s]),groupIdDim:o.dimension})}),B(Pt(e.to),function(o){var s=jU(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:_l(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&$ie(i,a,n)}function KKe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){B(Pt(n.seriesTransition),function(i){B(Pt(i.to),function(a){for(var o=n.updatedSeries,s=0;so.vmin?r+=o.vmin-n+(t-o.vmin)/(o.vmax-o.vmin)*o.gapReal:r+=t-n,n=o.vmax,i=!1;break}r+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(r+=t-n),r},e.prototype.unelapse=function(t){for(var r=RU,n=BU,i=!0,a=0,o=0;ol?a=s.vmin+(t-l)/(u-l)*(s.vmax-s.vmin):a=n+t-r,n=s.vmax,i=!1;break}r=u,n=s.vmax}return i&&(a=n+t-r),a},e}();function QKe(){return new JKe}var RU=0,BU=0;function eJe(e,t){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};B(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=$R(s,t);if(u){var c=u.vmin!==s.vmin,f=u.vmax!==s.vmax,h=u.vmax-u.vmin;if(!(c&&f))if(c||f){var d=c?"S":"E";a[d][l.type].has=!0,a[d][l.type].span=h,a[d][l.type].inExtFrac=h/(s.vmax-s.vmin),a[d][l.type].val=l.val}else n[l.type].span+=h,n[l.type].val+=l.val}});var o=r*(0+(t[1]-t[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));B(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?Math.max(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function tJe(e,t,r,n,i,a){e!=="no"&&B(r,function(o){var s=$R(o,a);if(s)for(var l=t.length-1;l>=0;l--){var u=t[l],c=n(u),f=i*3/4;c>s.vmin-f&&ct[0]&&r=0&&o<1-1e-5}B(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:Ae(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(pe(o.gap)){var u=Ci(o.gap);if(u.match(/%$/)){var c=parseFloat(u)/100;i(c)||(c=0),s.gapParsed.type="tpPrct",s.gapParsed.val=c,l=!0}}if(!l){var f=t(o.gap);(!isFinite(f)||f<0)&&(f=0),s.gapParsed.type="tpAbs",s.gapParsed.val=f}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&B(["vmin","vmax"],function(d){s[d]<0&&(s[d]=0)}),s.vmin>s.vmax){var h=s.vmax;s.vmax=s.vmin,s.vmin=h}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return B(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function FR(e,t){return qO(t)===qO(e)}function qO(e){return e.start+"_\0_"+e.end}function nJe(e,t,r){var n=[];B(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),B(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=Tu(n,function(u){return FR(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return B(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function iJe(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=Tu(r,function(f){return FR(f.breakOption,e.break.parsedBreak.breakOption)}),l=n(Math.pow(t,o.vmin),s.vmin),u=n(Math.pow(t,o.vmax),s.vmax),c={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?gr(Math.pow(t,o.vmin+o.gapParsed.val))-l:o.gapParsed.val};i={type:e.break.type,parsedBreak:{breakOption:o.breakOption,vmin:l,vmax:u,gapParsed:c,gapReal:o.gapReal}},a=s[e.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function aJe(e,t,r){var n={noNegative:!0},i=XO(e,r,n),a=XO(e,r,n),o=Math.log(t);return a.breaks=se(a.breaks,function(s){var l=Math.log(s.vmin)/o,u=Math.log(s.vmax)/o,c={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?Math.log(s.vmin+s.gapParsed.val)/o-l:s.gapParsed.val};return{vmin:l,vmax:u,gapParsed:c,gapReal:s.gapReal,breakOption:s.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var oJe={vmin:"start",vmax:"end"};function sJe(e,t){return t&&(e=e||{},e.break={type:oJe[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function lJe(){LBe({createScaleBreakContext:QKe,pruneTicksByBreak:tJe,addBreaksToTicks:rJe,parseAxisBreakOption:XO,identifyAxisBreak:FR,serializeAxisBreakIdentifier:qO,retrieveAxisBreakPairs:nJe,getTicksLogTransformBreak:iJe,logarithmicParseBreaksFromOption:aJe,makeAxisLabelFormatterParamBreak:sJe})}var zU=Je();function uJe(e,t){var r=Tu(e,function(n){return Sr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function cJe(e){B(e,function(t){return t.shouldRemove=!0})}function fJe(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function hJe(e,t,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Sr())return;var o=Sr().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(I){return I.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),c=s.get("zigzagMaxSpan");u=Math.max(2,u||0),c=Math.max(u,c||0);var f=s.get("expandOnClick"),h=s.get("zigzagZ"),d=s.getModel("itemStyle"),v=d.getItemStyle(),g=v.stroke,m=v.lineWidth,y=v.lineDash,_=v.fill,b=new Me({ignoreModelZ:!0}),S=a.isHorizontal(),T=zU(t).visualList||(zU(t).visualList=[]);cJe(T);for(var C=function(I){var k=o[I][0].break.parsedBreak,E=[];E[0]=a.toGlobalCoord(a.dataToCoord(k.vmin,!0)),E[1]=a.toGlobalCoord(a.dataToCoord(k.vmax,!0)),E[1]=j;he&&(K=j);var Re=[],ge=[];Re[$]=E,ge[$]=D,!le&&!he&&(Re[$]+=Y?-l:l,ge[$]-=Y?l:-l),Re[Z]=K,ge[Z]=K,G.push(Re),V.push(ge);var ne=void 0;if(ee_[1]&&_.reverse(),{coordPair:_,brkId:Sr().serializeAxisBreakIdentifier(y.breakOption)}});l.sort(function(m,y){return m.coordPair[0]-y.coordPair[0]});for(var u=o[0],c=null,f=0;f=0?l[0].width:l[1].width),h=(f+c.x)/2-u.x,d=Math.min(h,h-c.x),v=Math.max(h,h-c.x),g=v<0?v:d>0?d:0;s=(h-g)/c.x}var m=new Ie,y=new Ie;Ie.scale(m,n,-s),Ie.scale(y,n,1-s),KI(r[0],m),KI(r[1],y)}function pJe(e,t){var r={breaks:[]};return B(t.breaks,function(n){if(n){var i=Tu(e.get("breaks",!0),function(s){return Sr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===KT?!0:a===sre?!1:a===lre?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function gJe(){f6e({adjustBreakLabelPair:vJe,buildAxisBreakLine:dJe,rectCoordBuildBreakAxis:hJe,updateModelAxisBreak:pJe})}function mJe(e){m6e(e),lJe(),gJe()}function yJe(){B6e(xJe)}function xJe(e,t){B(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=_Je(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);t[i]-=n[i]+a,r.position==="top"?t.y+=n.height+a:r.position==="left"&&(t.x+=n.width+a)}}})}function _Je(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof av?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=Kv(e),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c1&&arguments[1]!==void 0?arguments[1]:60,i=null;return function(){for(var a=this,o=arguments.length,s=new Array(o),l=0;l12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function RJe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function BJe(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function zJe({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=W.useRef(null),[a,o]=W.useState("connected"),s=W.useMemo(()=>{const m=new Set;return t.forEach(y=>{m.add(y.from_node),m.add(y.to_node)}),m},[t]),l=W.useMemo(()=>{let m=e;return a==="connected"?m=m.filter(y=>s.has(y.node_num)):a==="infra"&&(m=m.filter(y=>VU.includes(y.role))),m},[e,a,s]),u=W.useMemo(()=>new Map(l.map(m=>[m.node_num,m])),[l]),c=W.useMemo(()=>t.filter(m=>u.has(m.from_node)&&u.has(m.to_node)),[t,u]),f=W.useMemo(()=>{const m=new Set;return r!==null&&c.forEach(y=>{y.from_node===r&&m.add(y.to_node),y.to_node===r&&m.add(y.from_node)}),m},[r,c]),h=W.useMemo(()=>{const m=l.map(_=>{const b=RJe(_.latitude),S=FU[b%FU.length],T=VU.includes(_.role),C=_.node_num===r,A=f.has(_.node_num),P=r===null||C||A;return{id:String(_.node_num),name:_.short_name,value:_.node_num,symbolSize:BJe(_.role),itemStyle:{color:T?S:"#111827",borderColor:S,borderWidth:T?0:2,opacity:P?1:.15},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace",color:P?"#94a3b8":"#94a3b820"},nodeNum:_.node_num,longName:_.long_name,role:_.role}}),y=c.map(_=>{const b=r===null||_.from_node===r||_.to_node===r;return{source:String(_.from_node),target:String(_.to_node),value:_.snr,lineStyle:{color:jJe(_.snr),width:b&&r!==null?2:1,opacity:r===null?.4:b?.6:.04}}});return{nodes:m,links:y}},[l,c,r,f]),d=W.useMemo(()=>({backgroundColor:"#111827",tooltip:{trigger:"item",backgroundColor:"#1e293b",borderColor:"#334155",textStyle:{color:"#e2e8f0",fontFamily:"JetBrains Mono, monospace",fontSize:11},formatter:m=>{if(m.data&&m.data.longName){const y=m.data;return`${y.name}
${y.longName}
Role: ${y.role}`}return""}},series:[{type:"graph",layout:"force",roam:!0,draggable:!0,animation:!1,data:h.nodes,links:h.links,force:{repulsion:200,edgeLength:[80,120],gravity:.1},emphasis:{focus:"adjacency",blurScope:"coordinateSystem",scale:1.1,lineStyle:{width:2}},blur:{itemStyle:{opacity:.15},lineStyle:{opacity:.04}},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace"},edgeLabel:{show:!1},edgeSymbol:["none","none"]}]}),[h]),v=W.useCallback(m=>{if(m.data&&"nodeNum"in m.data){const y=m.data.nodeNum;n(r===y?null:y??null)}},[r,n]),g=W.useMemo(()=>({click:v}),[v]);return W.useEffect(()=>{var y;const m=(y=i.current)==null?void 0:y.getEchartsInstance();m&&m.setOption(d,{notMerge:!1,lazyUpdate:!0})},[d]),x.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[x.jsx(NJe,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:g,opts:{renderer:"canvas"}}),x.jsxs("div",{className:"absolute top-4 left-4 flex items-center gap-2 bg-bg-card/90 backdrop-blur-sm border border-border rounded px-3 py-2",children:[x.jsx(eD,{size:14,className:"text-slate-500"}),x.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:m,label:y})=>x.jsx("button",{onClick:()=>o(m),className:`px-2 py-1 text-xs rounded transition-colors ${a===m?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:y},m))}),x.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes • ",c.length," edges"]})]}),x.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[x.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),x.jsx("div",{className:"space-y-1",children:[{label:"Excellent (>12)",color:"#22c55e"},{label:"Good (8-12)",color:"#4ade80"},{label:"Fair (5-8)",color:"#f59e0b"},{label:"Marginal (3-5)",color:"#f97316"},{label:"Poor (<3)",color:"#ef4444"}].map(m=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:m.color}}),x.jsx("span",{className:"text-xs text-slate-500",children:m.label})]},m.label))})]}),x.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[x.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),x.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-blue-500"}),x.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function Gie(e,t){const r=W.useRef(t);W.useEffect(function(){t!==r.current&&e.attributionControl!=null&&(r.current!=null&&e.attributionControl.removeAttribution(r.current),t!=null&&e.attributionControl.addAttribution(t)),r.current=t},[e,t])}function $Je(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const FJe=1;function VJe(e){return Object.freeze({__version:FJe,map:e})}function Wie(e,t){return Object.freeze({...e,...t})}const Hie=W.createContext(null),Uie=Hie.Provider;function uC(){const e=W.useContext(Hie);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function GJe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return W.useImperativeHandle(n,()=>i),r.children==null?null:Q.createElement(Uie,{value:a},r.children)}return W.forwardRef(t)}function WJe(e){function t(r,n){const[i,a]=W.useState(!1),{instance:o}=e(r,a).current;W.useImperativeHandle(n,()=>o),W.useEffect(function(){i&&o.update()},[o,i,r.children]);const s=o._contentNode;return s?fZ.createPortal(r.children,s):null}return W.forwardRef(t)}function HJe(e){function t(r,n){const{instance:i}=e(r).current;return W.useImperativeHandle(n,()=>i),null}return W.forwardRef(t)}function HR(e,t){const r=W.useRef();W.useEffect(function(){return t!=null&&e.instance.on(t),r.current=t,function(){r.current!=null&&e.instance.off(r.current),r.current=null}},[e,t])}function cC(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function UJe(e,t){return function(n,i){const a=uC(),o=e(cC(n,a),a);return Gie(a.map,n.attribution),HR(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var QO={exports:{}};/* @preserve +`:"
",x=f.join(m);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,x,u,Math.random()+"",o[0],o[1],d,null,h)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=De(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,f=o.dataType,h=u.getData(f),d=this._renderMode,v=r.positionDefault,g=lg([h.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),m=g.get("trigger");if(!(m!=null&&m!=="item")){var x=u.getDataParams(c,f),_=new z2;x.marker=_.makeTooltipMarker("item",gf(x.color),d);var b=QV(u.formatTooltip(c,!1,f)),S=g.get("order"),T=g.get("valueFormatter"),C=b.frag,A=C?a6(T?ie({valueFormatter:T},C):C,_,d,S,a.get("useUTC"),g.get("textStyle")):b.text,P="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,A,x,P,r.offsetX,r.offsetY,r.position,r.target,_)}),i({type:"showTip",dataIndexInside:c,dataIndex:h.getRawIndex(c),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=De(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(pe(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Ae(l),l.content=In(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=r.positionDefault,v=lg(f,this._tooltipModel,d?{position:d}:null),g=v.get("content"),m=Math.random()+"",x=new z2;this._showOrMove(v,function(){var _=Ae(v.get("formatterParams")||{});this._showTooltipContent(v,g,_,m,r.offsetX,r.offsetY,r.position,n,x)}),i({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(r,n,i,a,o,s,l,u,c){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var f=this._tooltipContent;f.setEnterable(r.get("enterable"));var h=r.get("formatter");l=l||r.get("position");var d=n,v=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),g=v.color;if(h)if(pe(h)){var m=r.ecModel.get("useUTC"),x=ae(i)?i[0]:i,_=x&&x.axisType&&x.axisType.indexOf("time")>=0;d=h,_&&(d=y0(x.axisValue,d,m)),d=aj(d,i,!0)}else if(Ce(h)){var b=me(function(S,T){S===this._ticket&&(f.setContent(T,c,r,g,l),this._updatePosition(r,l,o,s,f,i,u))},this);this._ticket=a,d=h(i,a,b)}else d=h;f.setContent(d,c,r,g,l),f.show(r,g),this._updatePosition(r,l,o,s,f,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||ae(n))return{color:a||o};if(!ae(n))return{color:a||n.color||n.borderColor}},t.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();n=n||r.get("position");var f=o.getSize(),h=r.get("align"),d=r.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),Ce(n)&&(n=n([i,a],s,o.el,v,{viewSize:[u,c],contentSize:f.slice()})),ae(n))i=ve(n[0],u),a=ve(n[1],c);else if(ke(n)){var g=n;g.width=f[0],g.height=f[1];var m=zt(g,{width:u,height:c});i=m.x,a=m.y,h=null,d=null}else if(pe(n)&&l){var x=fXe(n,v,f,r.get("borderWidth"));i=x[0],a=x[1]}else{var x=uXe(i,a,o,u,c,h?null:20,d?null:20);i=x[0],a=x[1]}if(h&&(i-=BH(h)?f[0]/2:h==="right"?f[0]:0),d&&(a-=BH(d)?f[1]/2:d==="bottom"?f[1]:0),mie(r)){var x=cXe(i,a,o,u,c);i=x[0],a=x[1]}o.moveTo(i,a)},t.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&B(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&B(u,function(h,d){var v=f[d]||{},g=h.seriesDataIndices||[],m=v.seriesDataIndices||[];o=o&&h.value===v.value&&h.axisType===v.axisType&&h.axisId===v.axisId&&g.length===m.length,o&&B(g,function(x,_){var b=m[_];o=o&&x.seriesIndex===b.seriesIndex&&x.dataIndex===b.dataIndex}),a&&B(h.seriesDataIndices,function(x){var _=x.seriesIndex,b=n[_],S=a[_];b&&S&&S.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},t.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},t.prototype.dispose=function(r,n){nt.node||!n.getDom()||(My(this,"_updatePosition"),this._tooltipContent.dispose(),NO("itemTooltip",n))},t.type="tooltip",t}(kt);function lg(e,t,r){var n=t.ecModel,i;r?(i=new et(r,n,n),i=new et(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof et&&(o=o.get("tooltip",!0)),pe(o)&&(o={formatter:o}),o&&(i=new et(o,i,n)))}return i}function RH(e,t){return e.dispatchAction||me(t.dispatchAction,t)}function uXe(e,t,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(e+l+a+2>n?e-=l+a:e+=a),o!=null&&(t+u+o>i?t-=u+o:t+=o),[e,t]}function cXe(e,t,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,n)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function fXe(e,t,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-a/2;break;case"top":s=t.x+u/2-i/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+o;break;case"left":s=t.x-i-o,l=t.y+c/2-a/2;break;case"right":s=t.x+u+o,l=t.y+c/2-a/2}return[s,l]}function BH(e){return e==="center"||e==="middle"}function hXe(e,t,r){var n=MN(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=zv(t,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=De(u).tooltipConfig;if(c&&c.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function dXe(e){Ze(M0),e.registerComponentModel(XYe),e.registerComponentView(lXe),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},sr),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},sr)}var vXe=["rect","polygon","keep","clear"];function pXe(e,t){var r=Pt(e?e.brush:[]);if(r.length){var n=[];B(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;ae(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),gXe(s),t&&!s.length&&s.push.apply(s,vXe)}}function gXe(e){var t={};B(e,function(r){t[r]=1}),e.length=0,B(t,function(r,n){e.push(n)})}var zH=B;function $H(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function WO(e,t,r){var n={};return zH(t,function(a){var o=n[a]=i();zH(e[a],function(s,l){if(Hr.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new Hr(u),l==="opacity"&&(u=Ae(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Hr(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function bie(e,t,r){var n;B(r,function(i){t.hasOwnProperty(i)&&$H(t[i])&&(n=!0)}),n&&B(r,function(i){t.hasOwnProperty(i)&&$H(t[i])?e[i]=Ae(t[i]):delete e[i]})}function mXe(e,t,r,n,i,a){var o={};B(e,function(f){var h=Hr.prepareVisualTypes(t[f]);o[f]=h});var s;function l(f){return pj(r,s,f)}function u(f,h){yee(r,s,f,h)}r.each(c);function c(f,h){s=f;var d=r.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var v=n.call(i,f),g=t[v],m=o[v],x=0,_=m.length;x<_;x++){var b=m[x];g[b]&&g[b].applyVisual(f,l,u)}}}function yXe(e,t,r,n){var i={};return B(e,function(a){var o=Hr.prepareVisualTypes(t[a]);i[a]=o}),{progress:function(o,s){var l;n!=null&&(l=s.getDimensionIndex(n));function u(T){return pj(s,f,T)}function c(T,C){yee(s,f,T,C)}for(var f,h=s.getStore();(f=o.next())!=null;){var d=s.getRawDataItem(f);if(!(d&&d.visualMap===!1))for(var v=n!=null?h.get(l,f):f,g=r(v),m=t[g],x=i[g],_=0,b=x.length;_t[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&HH(t)}};function HH(e){return new Oe(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var CXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new sR(n.getZr())).on("brush",me(this._onBrush,this)).mount()},t.prototype.render=function(r,n,i,a){this.model=r,this._updateController(r,n,i,a)},t.prototype.updateTransform=function(r,n,i,a){wie(n),this._updateController(r,n,i,a)},t.prototype.updateVisual=function(r,n,i,a){this.updateTransform(r,n,i,a)},t.prototype.updateView=function(r,n,i,a){this._updateController(r,n,i,a)},t.prototype._updateController=function(r,n,i,a){(!a||a.$from!==r.id)&&this._brushController.setPanels(r.brushTargetManager.makePanelOpts(i)).enableBrush(r.brushOption).updateCovers(r.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(r){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(r.areas,this.ecModel);(!r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:Ae(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Ae(i),$from:n})},t.type="brush",t}(kt),AXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.areas=[],r.brushOption={},r}return t.prototype.optionUpdated=function(r,n){var i=this.option;!n&&bie(i,r,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:this.option.defaultOutOfBrushColor},a.hasOwnProperty("liftZ")||(a.liftZ=5)},t.prototype.setAreas=function(r){r&&(this.areas=se(r,function(n){return UH(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=UH(this.option,r),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:J.color.backgroundTint,borderColor:J.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:J.color.disabled},t}(Ke);function UH(e,t){return He({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new et(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var MXe=["rect","polygon","lineX","lineY","keep","clear"],PXe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,B(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},t.prototype.updateView=function(r,n,i){this.render(r,n,i)},t.prototype.getIcons=function(){var r=this.model,n=r.get("icon",!0),i={};return B(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},t.prototype.onclick=function(r,n,i){var a=this._brushType,o=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},t.getDefaultOption=function(r){var n={show:!0,type:MXe.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:r.getLocaleModel().get(["toolbox","brush","title"])};return n},t}(ea);function kXe(e){e.registerComponentView(CXe),e.registerComponentModel(AXe),e.registerPreprocessor(pXe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,_Xe),e.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(t,r){r.eachComponent({mainType:"brush",query:t},function(n){n.setAreas(t.areas)})}),e.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},sr),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},sr),Lh("brush",PXe)}var LXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode={type:"box",ignoreSize:!0},r}return t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:J.size.m,backgroundColor:J.color.transparent,borderColor:J.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:J.color.primary},subtextStyle:{fontSize:12,color:J.color.quaternary}},t}(Ke),IXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this.group.removeAll(),!!r.get("show")){var a=this.group,o=r.getModel("textStyle"),s=r.getModel("subtextStyle"),l=r.get("textAlign"),u=be(r.get("textBaseline"),r.get("textVerticalAlign")),c=new at({style:Mt(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=c.getBoundingRect(),h=r.get("subtext"),d=new at({style:Mt(s,{text:h,fill:s.getTextColor(),y:f.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),v=r.get("link"),g=r.get("sublink"),m=r.get("triggerEvent",!0);c.silent=!v&&!m,d.silent=!g&&!m,v&&c.on("click",function(){ww(v,"_"+r.get("target"))}),g&&d.on("click",function(){ww(g,"_"+r.get("subtarget"))}),De(c).eventData=De(d).eventData=m?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),h&&a.add(d);var x=a.getBoundingRect(),_=r.getBoxLayoutParams();_.width=x.width,_.height=x.height;var b=jr(r,i),S=zt(_,b.refContainer,r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?S.x+=S.width:l==="center"&&(S.x+=S.width/2)),u||(u=r.get("top")||r.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?S.y+=S.height:u==="middle"&&(S.y+=S.height/2),u=u||"top"),a.x=S.x,a.y=S.y,a.markRedraw();var T={align:l,verticalAlign:u};c.setStyle(T),d.setStyle(T),x=a.getBoundingRect();var C=S.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var P=new Xe({shape:{x:x.x-C[3],y:x.y-C[0],width:x.width+C[1]+C[3],height:x.height+C[0]+C[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(kt);function OXe(e){e.registerComponentModel(LXe),e.registerComponentView(IXe)}var ZH=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode="box",r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),this._initData()},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(r){r==null&&(r=this.option.currentIndex);var n=this._data.count();this.option.loop?r=(r%n+n)%n:(r>=n&&(r=n-1),r<0&&(r=0)),this.option.currentIndex=r},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(r){this.option.autoPlay=!!r},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var r=this.option,n=r.data||[],i=r.axisType,a=this._names=[],o;i==="category"?(o=[],B(n,function(u,c){var f=Ir(Bv(u),""),h;ke(u)?(h=Ae(u),h.value=c):h=c,o.push(h),a.push(f)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new En([{name:"value",type:s}],this);l.initData(o,a)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:J.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:J.color.secondary},data:[]},t}(Ke),Sie=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline.slider",t.defaultOption=Mu(ZH.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:J.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:J.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:J.color.tertiary},itemStyle:{color:J.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:J.color.accent50,borderColor:J.color.accent50,borderWidth:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0, 0, 0, 0)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z",stopIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z",nextIcon:"path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z",prevIcon:"path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z",prevBtnSize:18,nextBtnSize:18,color:J.color.accent50,borderColor:J.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:J.color.accent60},itemStyle:{color:J.color.accent60,borderColor:J.color.accent60},controlStyle:{color:J.color.accent70,borderColor:J.color.accent70}},progress:{lineStyle:{color:J.color.accent30},itemStyle:{color:J.color.accent40}},data:[]}),t}(ZH);cr(Sie,ZT.prototype);var EXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline",t}(kt),DXe=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this,r,n,i)||this;return o.type=a||"value",o}return t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},t}(ba),oP=Math.PI,YH=Je(),NXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){this.api=n},t.prototype.render=function(r,n,i){if(this.model=r,this.api=i,this.ecModel=n,this.group.removeAll(),r.get("show",!0)){var a=this._layout(r,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return Cr("nameValue",{noName:!0,value:c})},B(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,r)},this),this._renderAxisLabel(a,s,l,r),this._position(a,r)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(r,n){var i=r.get(["label","position"]),a=r.get("orient"),o=RXe(r,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:oP/2},f=a==="vertical"?o.height:o.width,h=r.getModel("controlStyle"),d=h.get("show",!0),v=d?h.get("itemSize"):0,g=d?h.get("itemGap"):0,m=v+g,x=r.get(["label","rotate"])||0;x=x*oP/180;var _,b,S,T=h.get("position",!0),C=d&&h.get("showPlayBtn",!0),A=d&&h.get("showPrevBtn",!0),P=d&&h.get("showNextBtn",!0),I=0,k=f;T==="left"||T==="bottom"?(C&&(_=[0,0],I+=m),A&&(b=[I,0],I+=m),P&&(S=[k-v,0],k-=m)):(C&&(_=[k-v,0],k-=m),A&&(b=[0,0],I+=m),P&&(S=[k-v,0],k-=m));var E=[I,k];return r.get("inverse")&&E.reverse(),{viewRect:o,mainLength:f,orient:a,rotation:c[a],labelRotation:x,labelPosOpt:s,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||u[a],playPosition:_,prevBtnPosition:b,nextBtnPosition:S,axisExtent:E,controlSize:v,controlGap:g}},t.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=Wr(),l=o.x,u=o.y+o.height;Xa(s,s,[-l,-u]),Qs(s,s,-oP/2),Xa(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),f=_(i.getBoundingRect()),h=_(a.getBoundingRect()),d=[i.x,i.y],v=[a.x,a.y];v[0]=d[0]=c[0][0];var g=r.labelPosOpt;if(g==null||pe(g)){var m=g==="+"?0:1;b(d,f,c,1,m),b(v,h,c,1,1-m)}else{var m=g>=0?0:1;b(d,f,c,1,m),v[1]=d[1]+g}i.setPosition(d),a.setPosition(v),i.rotation=a.rotation=r.rotation,x(i),x(a);function x(S){S.originX=c[0][0]-S.x,S.originY=c[1][0]-S.y}function _(S){return[[S.x,S.x+S.width],[S.y,S.y+S.height]]}function b(S,T,C,A,P){S[A]+=C[A][P]-T[A][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=jXe(n,a);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new DXe("value",o,r.axisExtent,a);return l.model=n,l},t.prototype._createGroup=function(r){var n=this[r]=new Me;return this.group.add(n),n},t.prototype._renderAxisLine=function(r,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new mr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:ie({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new mr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Pe({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},t.prototype._renderAxisTick=function(r,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],B(l,function(u){var c=i.dataToCoord(u.value),f=s.getItemModel(u.value),h=f.getModel("itemStyle"),d=f.getModel(["emphasis","itemStyle"]),v=f.getModel(["progress","itemStyle"]),g={x:c,y:0,onclick:me(o._changeTimeline,o,u.value)},m=XH(f,h,n,g);m.ensureState("emphasis").style=d.getItemStyle(),m.ensureState("progress").style=v.getItemStyle(),Kl(m);var x=De(m);f.get("tooltip")?(x.dataIndex=u.value,x.dataModel=a):x.dataIndex=x.dataModel=null,o._tickSymbols.push(m)})},t.prototype._renderAxisLabel=function(r,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],B(u,function(c){var f=c.tickValue,h=l.getItemModel(f),d=h.getModel("label"),v=h.getModel(["emphasis","label"]),g=h.getModel(["progress","label"]),m=i.dataToCoord(c.tickValue),x=new at({x:m,y:0,rotation:r.labelRotation-r.rotation,onclick:me(o._changeTimeline,o,f),silent:!1,style:Mt(d,{text:c.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});x.ensureState("emphasis").style=Mt(v),x.ensureState("progress").style=Mt(g),n.add(x),Kl(x),YH(x).dataIndex=f,o._tickLabels.push(x)})}},t.prototype._renderControl=function(r,n,i,a){var o=r.controlSize,s=r.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),f=a.get("inverse",!0);h(r.nextBtnPosition,"next",me(this._changeTimeline,this,f?"-":"+")),h(r.prevBtnPosition,"prev",me(this._changeTimeline,this,f?"+":"-")),h(r.playPosition,c?"stop":"play",me(this._handlePlayClick,this,!c),!0);function h(d,v,g,m){if(d){var x=qa(be(a.get(["controlStyle",v+"BtnSize"]),o),o),_=[0,-x/2,x,x],b=BXe(a,v+"Icon",_,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:m?-s:0,rectHover:!0,style:l,onclick:g});b.ensureState("emphasis").style=u,n.add(b),Kl(b)}}},t.prototype._renderCurrentPointer=function(r,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(f){f.draggable=!0,f.drift=me(u._handlePointerDrag,u),f.ondragend=me(u._handlePointerDragend,u),qH(f,u._progressLine,s,i,a,!0)},onUpdate:function(f){qH(f,u._progressLine,s,i,a)}};this._currentPointer=XH(l,l,this._mainGroup,{},this._currentPointer,c)},t.prototype._handlePlayClick=function(r){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:r,from:this.uid})},t.prototype._handlePointerDrag=function(r,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},t.prototype._handlePointerDragend=function(r){this._pointerChangeTimeline([r.offsetX,r.offsetY],!0)},t.prototype._pointerChangeTimeline=function(r,n){var i=this._toAxisCoord(r)[0],a=this._axis,o=Ai(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(v)),[s,d]}var z_={min:Fe(B_,"min"),max:Fe(B_,"max"),average:Fe(B_,"average"),median:Fe(B_,"median")};function Gy(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!WXe(t)&&!ae(t.coord)&&ae(i)){var a=Tie(t,r,n,e);if(t=Ae(t),t.type&&z_[t.type]&&a.baseAxis&&a.valueAxis){var o=We(i,a.baseAxis.dim),s=We(i,a.valueAxis.dim),l=z_[t.type](r,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else t.coord=[t.xAxis!=null?t.xAxis:t.radiusAxis,t.yAxis!=null?t.yAxis:t.angleAxis]}if(t.coord==null||!ae(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&z_[t.type]){var c=n.getOtherAxis(u);c&&(t.value=nS(r,r.mapDimension(c.dim),t.type))}}else for(var f=t.coord,h=0;h<2;h++)z_[f[h]]&&(f[h]=nS(r,r.mapDimension(i[h]),f[h]));return t}}function Tie(e,t,r,n){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex!=null?t.getDimension(e.valueIndex):e.valueDim,i.valueAxis=r.getAxis(HXe(n,i.valueDataDim)),i.baseAxis=r.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=r.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function HXe(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function Wy(e,t){return e&&e.containData&&t.coord&&!UO(t)?e.containData(t.coord):!0}function UXe(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!UO(t)&&!UO(r)?e.containZone(t.coord,r.coord):!0}function Cie(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return eu(o,t[a])}:function(r,n,i,a){return eu(r.value,t[a])}}function nS(e,t,r){if(r==="average"){var n=0,i=0;return e.each(t,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?e.getMedian(t):e.getDataExtent(t)[r==="max"?1:0]}var sP=Je(),$R=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(){this.markerGroupMap=_e()},t.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){sP(s).keep=!1}),n.eachSeries(function(s){var l=Zo.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!sP(s).keep&&a.group.remove(s.group)}),ZXe(n,o,this.type)},t.prototype.markKeep=function(r){sP(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;B(r,function(a){var o=Zo.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?$J(l):NN(l))})}})},t.type="marker",t}(kt);function ZXe(e,t,r){e.eachSeries(function(n){var i=Zo.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=pf(i),s=o.z,l=o.zlevel;GT(a.group,s,l)}})}function JH(e,t,r){var n=t.coordinateSystem,i=r.getWidth(),a=r.getHeight(),o=n&&n.getArea&&n.getArea();e.each(function(s){var l=e.getItemModel(s),u=l.get("relativeTo")==="coordinate",c=u?o?o.width:0:i,f=u?o?o.height:0:a,h=u&&o?o.x:0,d=u&&o?o.y:0,v,g=ve(l.get("x"),c)+h,m=ve(l.get("y"),f)+d;if(!isNaN(g)&&!isNaN(m))v=[g,m];else if(t.getMarkerPosition)v=t.getMarkerPosition(e.getValues(e.dimensions,s));else if(n){var x=e.get(n.dimensions[0],s),_=e.get(n.dimensions[1],s);v=n.dataToPoint([x,_])}isNaN(g)||(v[0]=g),isNaN(m)||(v[1]=m),e.setItemLayout(s,v)})}var YXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Zo.getMarkerModelFromSeries(a,"markPoint");o&&(JH(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new S0),f=XXe(o,r,n);n.setData(f),JH(n.getData(),r,a),f.each(function(h){var d=f.getItemModel(h),v=d.getShallow("symbol"),g=d.getShallow("symbolSize"),m=d.getShallow("symbolRotate"),x=d.getShallow("symbolOffset"),_=d.getShallow("symbolKeepAspect");if(Ce(v)||Ce(g)||Ce(m)||Ce(x)){var b=n.getRawValue(h),S=n.getDataParams(h);Ce(v)&&(v=v(b,S)),Ce(g)&&(g=g(b,S)),Ce(m)&&(m=m(b,S)),Ce(x)&&(x=x(b,S))}var T=d.getModel("itemStyle").getItemStyle(),C=d.get("z2"),A=_0(l,"color");T.fill||(T.fill=A),f.setItemVisual(h,{z2:be(C,0),symbol:v,symbolSize:g,symbolRotate:m,symbolOffset:x,symbolKeepAspect:_,style:T})}),c.updateData(f),this.group.add(c.group),f.eachItemGraphicEl(function(h){h.traverse(function(d){De(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markPoint",t}($R);function XXe(e,t,r){var n;e?n=se(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return ie(ie({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new En(n,r),a=se(r.get("data"),Fe(Gy,t));e&&(a=ht(a,Fe(Wy,e)));var o=Cie(!!e,n);return i.initData(a,null,o),i}function qXe(e){e.registerComponentModel(GXe),e.registerComponentView(YXe),e.registerPreprocessor(function(t){zR(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var KXe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.createMarkerModelFromSeries=function(r,n,i){return new t(r,n,i)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(Zo),$_=Je(),JXe=function(e,t,r,n){var i=e.getData(),a;if(ae(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=t.getAxis(n.yAxis!=null?"y":"x"),l=rn(n.yAxis,n.xAxis);else{var u=Tie(n,i,t,e);s=u.valueAxis;var c=Pj(i,u.valueDataDim);l=nS(i,c,o)}var f=s.dim==="x"?0:1,h=1-f,d=Ae(n),v={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,v.coord[h]=1/0;var g=r.get("precision");g>=0&&ot(l)&&(l=+l.toFixed(Math.min(g,20))),d.coord[f]=v.coord[f]=l,a=[d,v,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var m=[Gy(e,a[0]),Gy(e,a[1]),ie({},a[2])];return m[2].type=m[2].type||null,He(m[2],m[0]),He(m[2],m[1]),m};function iS(e){return!isNaN(e)&&!isFinite(e)}function QH(e,t,r,n){var i=1-e,a=n.dimensions[e];return iS(t[i])&&iS(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function QXe(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(QH(1,r,n,e)||QH(0,r,n,e)))return!0}return Wy(e,t[0])&&Wy(e,t[1])}function lP(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ve(o.get("x"),i.getWidth()),u=ve(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,f=e.get(c[0],t),h=e.get(c[1],t);s=a.dataToPoint([f,h])}if(fu(a,"cartesian2d")){var d=a.getAxis("x"),v=a.getAxis("y"),c=a.dimensions;iS(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):iS(e.get(c[1],t))&&(s[1]=v.toGlobalCoord(v.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}e.setItemLayout(t,s)}var eqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Zo.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=$_(o).from,u=$_(o).to;l.each(function(c){lP(l,c,!0,a,i),lP(u,c,!1,a,i)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new aR);this.group.add(c.group);var f=tqe(o,r,n),h=f.from,d=f.to,v=f.line;$_(n).from=h,$_(n).to=d,n.setData(v);var g=n.get("symbol"),m=n.get("symbolSize"),x=n.get("symbolRotate"),_=n.get("symbolOffset");ae(g)||(g=[g,g]),ae(m)||(m=[m,m]),ae(x)||(x=[x,x]),ae(_)||(_=[_,_]),f.from.each(function(S){b(h,S,!0),b(d,S,!1)}),v.each(function(S){var T=v.getItemModel(S),C=T.getModel("lineStyle").getLineStyle();v.setItemLayout(S,[h.getItemLayout(S),d.getItemLayout(S)]);var A=T.get("z2");C.stroke==null&&(C.stroke=h.getItemVisual(S,"style").fill),v.setItemVisual(S,{z2:be(A,0),fromSymbolKeepAspect:h.getItemVisual(S,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(S,"symbolOffset"),fromSymbolRotate:h.getItemVisual(S,"symbolRotate"),fromSymbolSize:h.getItemVisual(S,"symbolSize"),fromSymbol:h.getItemVisual(S,"symbol"),toSymbolKeepAspect:d.getItemVisual(S,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(S,"symbolOffset"),toSymbolRotate:d.getItemVisual(S,"symbolRotate"),toSymbolSize:d.getItemVisual(S,"symbolSize"),toSymbol:d.getItemVisual(S,"symbol"),style:C})}),c.updateData(v),f.line.eachItemGraphicEl(function(S){De(S).dataModel=n,S.traverse(function(T){De(T).dataModel=n})});function b(S,T,C){var A=S.getItemModel(T);lP(S,T,C,r,a);var P=A.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=_0(l,"color")),S.setItemVisual(T,{symbolKeepAspect:A.get("symbolKeepAspect"),symbolOffset:be(A.get("symbolOffset",!0),_[C?0:1]),symbolRotate:be(A.get("symbolRotate",!0),x[C?0:1]),symbolSize:be(A.get("symbolSize"),m[C?0:1]),symbol:be(A.get("symbol",!0),g[C?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}($R);function tqe(e,t,r){var n;e?n=se(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return ie(ie({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new En(n,r),a=new En(n,r),o=new En([],r),s=se(r.get("data"),Fe(JXe,t,e,r));e&&(s=ht(s,Fe(QXe,e)));var l=Cie(!!e,n);return i.initData(se(s,function(u){return u[0]}),null,l),a.initData(se(s,function(u){return u[1]}),null,l),o.initData(se(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function rqe(e){e.registerComponentModel(KXe),e.registerComponentView(eqe),e.registerPreprocessor(function(t){zR(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var nqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.createMarkerModelFromSeries=function(r,n,i){return new t(r,n,i)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(Zo),F_=Je(),iqe=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=Gy(e,i),s=Gy(e,a),l=o.coord,u=s.coord;l[0]=rn(l[0],-1/0),l[1]=rn(l[1],-1/0),u[0]=rn(u[0],1/0),u[1]=rn(u[1],1/0);var c=AT([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function aS(e){return!isNaN(e)&&!isFinite(e)}function eU(e,t,r,n){var i=1-e;return aS(t[i])&&aS(r[i])}function aqe(e,t){var r=t.coord[0],n=t.coord[1],i={coord:r,x:t.x0,y:t.y0},a={coord:n,x:t.x1,y:t.y1};return fu(e,"cartesian2d")?r&&n&&(eU(1,r,n)||eU(0,r,n))?!0:UXe(e,i,a):Wy(e,i)||Wy(e,a)}function tU(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ve(o.get(r[0]),i.getWidth()),u=ve(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var c=e.getValues(["x0","y0"],t),f=e.getValues(["x1","y1"],t),h=a.clampData(c),d=a.clampData(f),v=[];r[0]==="x0"?v[0]=h[0]>d[0]?f[0]:c[0]:v[0]=h[0]>d[0]?c[0]:f[0],r[1]==="y0"?v[1]=h[1]>d[1]?f[1]:c[1]:v[1]=h[1]>d[1]?c[1]:f[1],s=n.getMarkerPosition(v,r,!0)}else{var g=e.get(r[0],t),m=e.get(r[1],t),x=[g,m];a.clampData&&a.clampData(x,x),s=a.dataToPoint(x,!0)}if(fu(a,"cartesian2d")){var _=a.getAxis("x"),b=a.getAxis("y"),g=e.get(r[0],t),m=e.get(r[1],t);aS(g)?s[0]=_.toGlobalCoord(_.getExtent()[r[0]==="x0"?0:1]):aS(m)&&(s[1]=b.toGlobalCoord(b.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var rU=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],oqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Zo.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=se(rU,function(f){return tU(s,l,f,a,i)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Me});this.group.add(c.group),this.markKeep(c);var f=sqe(o,r,n);n.setData(f),f.each(function(h){var d=se(rU,function(k){return tU(f,h,k,r,a)}),v=o.getAxis("x").scale,g=o.getAxis("y").scale,m=v.getExtent(),x=g.getExtent(),_=[v.parse(f.get("x0",h)),v.parse(f.get("x1",h))],b=[g.parse(f.get("y0",h)),g.parse(f.get("y1",h))];Ai(_),Ai(b);var S=!(m[0]>_[1]||m[1]<_[0]||x[0]>b[1]||x[1]=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:J.size.m,align:"auto",backgroundColor:J.color.transparent,borderColor:J.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:J.color.disabled,inactiveBorderColor:J.color.disabled,inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:J.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:J.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:J.color.tertiary,borderWidth:1,borderColor:J.color.border},emphasis:{selectorLabel:{show:!0,color:J.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(Ke),bh=Fe,YO=B,V_=Me,Aie=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.newlineDisabled=!1,r}return t.prototype.init=function(){this.group.add(this._contentGroup=new V_),this.group.add(this._selectorGroup=new V_),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var c=jr(r,i).refContainer,f=r.getBoxLayoutParams(),h=r.get("padding"),d=zt(f,c,h),v=this.layoutInner(r,o,d,a,l,u),g=zt(Pe({width:v.width,height:v.height},f),c,h);this.group.x=g.x-v.x,this.group.y=g.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=vie(v,r))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(r,n,i,a,o,s,l){var u=this.getContentGroup(),c=_e(),f=n.get("selectedMode"),h=n.get("triggerEvent"),d=[];i.eachRawSeries(function(v){!v.get("legendHoverLink")&&d.push(v.id)}),YO(n.getData(),function(v,g){var m=this,x=v.get("name");if(!this.newlineDisabled&&(x===""||x===` +`)){var _=new V_;_.newline=!0,u.add(_);return}var b=i.getSeriesByName(x)[0];if(!c.get(x))if(b){var S=b.getData(),T=S.getVisual("legendLineStyle")||{},C=S.getVisual("legendIcon"),A=S.getVisual("style"),P=this._createItem(b,x,g,v,n,r,T,A,C,f,a);P.on("click",bh(nU,x,null,a,d)).on("mouseover",bh(XO,b.name,null,a,d)).on("mouseout",bh(qO,b.name,null,a,d)),i.ssr&&P.eachChild(function(I){var k=De(I);k.seriesIndex=b.seriesIndex,k.dataIndex=g,k.ssrType="legend"}),h&&P.eachChild(function(I){m.packEventData(I,n,b,g,x)}),c.set(x,!0)}else i.eachRawSeries(function(I){var k=this;if(!c.get(x)&&I.legendVisualProvider){var E=I.legendVisualProvider;if(!E.containName(x))return;var D=E.indexOfName(x),N=E.getItemVisual(D,"style"),z=E.getItemVisual(D,"legendIcon"),F=On(N.fill);F&&F[3]===0&&(F[3]=.2,N=ie(ie({},N),{fill:la(F,"rgba")}));var $=this._createItem(I,x,g,v,n,r,{},N,z,f,a);$.on("click",bh(nU,null,x,a,d)).on("mouseover",bh(XO,null,x,a,d)).on("mouseout",bh(qO,null,x,a,d)),i.ssr&&$.eachChild(function(Z){var j=De(Z);j.seriesIndex=I.seriesIndex,j.dataIndex=g,j.ssrType="legend"}),h&&$.eachChild(function(Z){k.packEventData(Z,n,I,g,x)}),c.set(x,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},t.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};De(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();YO(r,function(u){var c=u.type,f=new at({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(f);var h=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);Ur(f,{normal:h,emphasis:d},{defaultText:u.title}),Kl(f)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,f,h){var d=r.visualDrawType,v=o.get("itemWidth"),g=o.get("itemHeight"),m=o.isSelected(n),x=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),b=a.get("icon");c=b||c||"roundRect";var S=cqe(c,a,l,u,d,m,h),T=new V_,C=a.getModel("textStyle");if(Ce(r.getLegendIcon)&&(!b||b==="inherit"))T.add(r.getLegendIcon({itemWidth:v,itemHeight:g,icon:c,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:_}));else{var A=b==="inherit"&&r.getData().getVisual("symbol")?x==="inherit"?r.getData().getVisual("symbolRotate"):x:0;T.add(fqe({itemWidth:v,itemHeight:g,icon:c,iconRotate:A,itemStyle:S.itemStyle,symbolKeepAspect:_}))}var P=s==="left"?v+5:-5,I=s,k=o.get("formatter"),E=n;pe(k)&&k?E=k.replace("{name}",n??""):Ce(k)&&(E=k(n));var D=m?C.getTextColor():a.get("inactiveColor");T.add(new at({style:Mt(C,{text:E,x:P,y:g/2,fill:D,align:I,verticalAlign:"middle"},{inheritColor:D})}));var N=new Xe({shape:T.getBoundingRect(),style:{fill:"transparent"}}),z=a.getModel("tooltip");return z.get("show")&&tl({el:N,componentModel:o,itemName:n,itemTooltipOption:z.option}),T.add(N),T.eachChild(function(F){F.silent=!0}),N.silent=!f,this.getContentGroup().add(T),Kl(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Zc(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),f=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){Zc("horizontal",u,r.get("selectorItemGap",!0));var h=u.getBoundingRect(),d=[-h.x,-h.y],v=r.get("selectorButtonGap",!0),g=r.getOrient().index,m=g===0?"width":"height",x=g===0?"height":"width",_=g===0?"y":"x";s==="end"?d[g]+=c[m]+v:f[g]+=h[m]+v,d[1-g]+=c[x]/2-h[x]/2,u.x=d[0],u.y=d[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[m]=c[m]+v+h[m],b[x]=Math.max(c[x],h[x]),b[_]=Math.min(0,h[_]+d[1-g]),b}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(kt);function cqe(e,t,r,n,i,a,o){function s(m,x){m.lineWidth==="auto"&&(m.lineWidth=x.lineWidth>0?2:0),YO(m,function(_,b){m[b]==="inherit"&&(m[b]=x[b])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?n.decal:iv(f,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var h=t.getModel("lineStyle"),d=h.getLineStyle();if(s(d,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),d.stroke==="auto"&&(d.stroke=n.fill),!a){var v=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth=v==="auto"?n.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),d.stroke=h.get("inactiveColor"),d.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function fqe(e){var t=e.icon||"roundRect",r=xr(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return r.setStyle(e.itemStyle),r.rotation=(e.iconRotate||0)*Math.PI/180,r.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=J.color.neutral00,r.style.lineWidth=2),r}function nU(e,t,r,n){qO(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),XO(e,t,r,n)}function Mie(e){for(var t=e.getZr().storage.getDisplayList(),r,n=0,i=t.length;ni[o],m=[-d.x,-d.y];n||(m[a]=c[u]);var x=[0,0],_=[-v.x,-v.y],b=be(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(g){var S=r.get("pageButtonPosition",!0);S==="end"?_[a]+=i[o]-v[o]:x[a]+=v[o]+b}_[1-a]+=d[s]/2-v[s]/2,c.setPosition(m),f.setPosition(x),h.setPosition(_);var T={x:0,y:0};if(T[o]=g?i[o]:d[o],T[s]=Math.max(d[s],v[s]),T[l]=Math.min(0,v[l]+_[1-a]),f.__rectSize=i[o],g){var C={x:0,y:0};C[o]=Math.max(i[o]-v[o]-b,0),C[s]=T[s],f.setClipPath(new Xe({shape:C})),f.__rectSize=C[o]}else h.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var A=this._getPageInfo(r);return A.pageIndex!=null&<(c,{x:A.contentPosition[0],y:A.contentPosition[1]},g?r:null),this._updatePageInfoView(r,A),T},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;B(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",h=n[f]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",h?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=h?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",pe(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=uP[o],l=cP[o],u=this._findTargetItemIndex(n),c=i.children(),f=c[u],h=c.length,d=h?1:0,v={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return v;var g=S(f);v.contentPosition[o]=-g.s;for(var m=u+1,x=g,_=g,b=null;m<=h;++m)b=S(c[m]),(!b&&_.e>x.s+a||b&&!T(b,x.s))&&(_.i>x.i?x=_:x=b,x&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=x.i),++v.pageCount)),_=b;for(var m=u-1,x=g,_=g,b=null;m>=-1;--m)b=S(c[m]),(!b||!T(_,b.s))&&x.i<_.i&&(_=x,v.pagePrevDataIndex==null&&(v.pagePrevDataIndex=x.i),++v.pageCount,++v.pageIndex),x=b;return v;function S(C){if(C){var A=C.getBoundingRect(),P=A[l]+C[l];return{s:P,e:P+A[s],i:C.__legendDataIndex}}}function T(C,A){return C.e>=A&&C.s<=A+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t}(Aie);function gqe(e){e.registerAction("legendScroll","legendscroll",function(t,r){var n=t.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:t},function(i){i.setScrollDataIndex(n)})})}function mqe(e){Ze(Pie),e.registerComponentModel(vqe),e.registerComponentView(pqe),gqe(e)}function yqe(e){Ze(Pie),Ze(mqe)}var xqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="dataZoom.inside",t.defaultOption=Mu(Vy.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Vy),FR=Je();function _qe(e,t,r){FR(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function bqe(e,t){for(var r=FR(e).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=u),o=o&&l.get("preventDefaultMouseMove",!0)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:r,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint}}}}function Aqe(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=FR(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=_e());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=fie(a);B(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,wqe(r,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=_e());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){kie(i,a);return}var c=Cqe(l,a,r);o.enable(c.controlType,c.opt),qv(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Mqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return t.prototype.render=function(r,n,i){if(e.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),_qe(i,r,{pan:me(fP.pan,this),zoom:me(fP.zoom,this),scrollMove:me(fP.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){bqe(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(ER),fP={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=hP[t](null,[n.originX,n.originY],o,r,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(hu(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:sU(function(e,t,r,n,i,a){var o=hP[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:sU(function(e,t,r,n,i,a){var o=hP[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function sU(e){return function(t,r,n,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,r,n,i);if(hu(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var hP={grid:function(e,t,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem.getRect();return e=e||[0,0],a.dim==="x"?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),r.mainType==="radiusAxis"?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,r,n,i){var a=r.axis,o=i.model.coordinateSystem.getRect(),s={};return e=e||[0,0],a.orient==="horizontal"?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function Lie(e){DR(e),e.registerComponentModel(xqe),e.registerComponentView(Mqe),Aqe(e)}var Pqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=Mu(Vy.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:J.color.accent10,borderRadius:0,backgroundColor:J.color.transparent,dataBackground:{lineStyle:{color:J.color.accent30,width:.5},areaStyle:{color:J.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:J.color.accent40,width:.5},areaStyle:{color:J.color.accent20,opacity:.3}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:J.color.neutral00,borderColor:J.color.accent20},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:J.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:J.color.tertiary},brushSelect:!0,brushStyle:{color:J.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:J.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(Vy),fg=Xe,kqe=1,dP=30,Lqe=7,hg="horizontal",lU="vertical",Iqe=5,Oqe=["line","bar","candlestick","scatter"],Eqe={easing:"cubicOut",duration:100,delay:0},Dqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._displayables={},r}return t.prototype.init=function(r,n){this.api=n,this._onBrush=me(this._onBrush,this),this._onBrushEnd=me(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),qv(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){My(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new Me;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(n),this._positionGroup()},t.prototype._resetLocation=function(){var r=this.dataZoomModel,n=this.api,i=r.get("brushSelect"),a=i?Lqe:0,o=jr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===hg?{right:o.width-s.x-s.width,top:o.height-dP-l-a,width:s.width,height:dP}:{right:l,top:s.y,width:dP,height:s.height},c=Of(r.option);B(["right","top","width","height"],function(h){c[h]==="ph"&&(c[h]=u[h])});var f=zt(c,o);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===lU&&this._size.reverse()},t.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===hg&&!o?{scaleY:l?1:-1,scaleX:1}:i===hg&&o?{scaleY:l?1:-1,scaleX:-1}:i===lU&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]);r.x=n.x-u.x,r.y=n.y-u.y,r.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var r=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=r.get("brushSelect");i.add(new fg({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new fg({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:me(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},t.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var n=this._size,i=this._shadowSize||[],a=r.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var f=o.getDataExtent(r.thisDim),h=o.getDataExtent(l),d=(h[1]-h[0])*.3;h=[h[0]-d,h[1]+d];var v=[0,n[1]],g=[0,n[0]],m=[[n[0],0],[0,0]],x=[],_=g[1]/Math.max(1,o.count()-1),b=n[0]/(f[1]-f[0]),S=r.thisAxis.type==="time",T=-_,C=Math.round(o.count()/n[0]),A;o.each([r.thisDim,l],function(D,N,z){if(C>0&&z%C){S||(T+=_);return}T=S?(+D-f[0])*b:T+_;var F=N==null||isNaN(N)||N==="",$=F?0:gt(N,h,v,!0);F&&!A&&z?(m.push([m[m.length-1][0],0]),x.push([x[x.length-1][0],0])):!F&&A&&(m.push([T,0]),x.push([T,0])),F||(m.push([T,$]),x.push([T,$])),A=F}),u=this._shadowPolygonPts=m,c=this._shadowPolylinePts=x}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var P=this.dataZoomModel;function I(D){var N=P.getModel(D?"selectedDataBackground":"dataBackground"),z=new Me,F=new bn({shape:{points:u},segmentIgnoreThreshold:1,style:N.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),$=new an({shape:{points:c},segmentIgnoreThreshold:1,style:N.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return z.add(F),z.add($),z}for(var k=0;k<3;k++){var E=I(k===1);this._displayables.sliderGroup.add(E),this._displayables.dataShadowSegs.push(E)}},t.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,n=r.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return r.eachTargetAxis(function(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();B(l,function(u){if(!i&&!(n!==!0&&We(Oqe,u.get("type"))<0)){var c=a.getComponent(Rl(o),s).axis,f=Nqe(o),h,d=u.coordinateSystem;f!=null&&d.getOtherAxis&&(h=d.getOtherAxis(c).inverse),f=u.getData().mapDimension(f);var v=u.getData().mapDimension(o);i={thisAxis:c,series:u,thisDim:v,otherDim:f,otherAxisInverse:h}}},this)},this),i}},t.prototype._renderHandle=function(){var r=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,f=l.get("brushSelect"),h=n.filler=new fg({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new fg({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:kqe,fill:J.color.transparent}})),B([0,1],function(b){var S=l.get("handleIcon");!Cw[S]&&S.indexOf("path://")<0&&S.indexOf("image://")<0&&(S="path://"+S);var T=xr(S,-1,0,2,2,null,!0);T.attr({cursor:jqe(this._orient),draggable:!0,drift:me(this._onDragMove,this,b),ondragend:me(this._onDragEnd,this),onmouseover:me(this._showDataInfo,this,!0),onmouseout:me(this._showDataInfo,this,!1),z2:5});var C=T.getBoundingRect(),A=l.get("handleSize");this._handleHeight=ve(A,this._size[1]),this._handleWidth=C.width/C.height*this._handleHeight,T.setStyle(l.getModel("handleStyle").getItemStyle()),T.style.strokeNoScale=!0,T.rectHover=!0,T.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Kl(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[b]=T);var I=l.getModel("textStyle"),k=l.get("handleLabel")||{},E=k.show||!1;r.add(a[b]=new at({silent:!0,invisible:!E,style:Mt(I,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:I.getTextColor(),font:I.getFont()}),z2:10}))},this);var d=h;if(f){var v=ve(l.get("moveHandleSize"),s[1]),g=n.moveHandle=new Xe({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:v}}),m=v*.8,x=n.moveHandleIcon=xr(l.get("moveHandleIcon"),-m/2,-m/2,m,m,J.color.neutral00,!0);x.silent=!0,x.y=s[1]+v/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(v,10));d=n.moveZone=new Xe({invisible:!0,shape:{y:s[1]-_,height:v+_}}),d.on("mouseover",function(){u.enterEmphasis(g)}).on("mouseout",function(){u.leaveEmphasis(g)}),o.add(g),o.add(x),o.add(d)}d.attr({draggable:!0,cursor:"default",drift:me(this._onDragMove,this,"all"),ondragstart:me(this._showDataInfo,this,!0),ondragend:me(this._onDragEnd,this),onmouseover:me(this._showDataInfo,this,!0),onmouseout:me(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[gt(r[0],[0,100],n,!0),gt(r[1],[0,100],n,!0)]},t.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];hu(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?gt(s.minSpan,l,o,!0):null,s.maxSpan!=null?gt(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Ai([gt(a[0],o,l,!0),gt(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},t.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=Ai(i.slice()),o=this._size;B([0,1],function(d){var v=n.handles[d],g=this._handleHeight;v.attr({scaleX:g/2,scaleY:g/2,x:i[d]+(d?-1:1),y:o[1]/2-g/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;cn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(r){var n=r.offsetX,i=r.offsetY;this._brushStart=new Ie(n,i),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(r){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100],l=this._handleEnds=[i.x,i.x+i.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();hu(0,l,o,0,u.minSpan!=null?gt(u.minSpan,s,o,!0):null,u.maxSpan!=null?gt(u.maxSpan,s,o,!0):null),this._range=Ai([gt(l[0],o,s,!0),gt(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(Vs(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},t.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new fg({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,n),c=l.transformCoordToLocal(s.x,s.y),f=this._size;u[0]=Math.max(Math.min(f[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:f[1]})},t.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?Eqe:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=fie(this.dataZoomModel).infoList;if(!r&&n.length){var i=n[0].model.coordinateSystem;r=i.getRect&&i.getRect()}if(!r){var a=this.api.getWidth(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},t.type="dataZoom.slider",t}(ER);function Nqe(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function jqe(e){return e==="vertical"?"ns-resize":"ew-resize"}function Iie(e){e.registerComponentModel(Pqe),e.registerComponentView(Dqe),DR(e)}function Rqe(e){Ze(Lie),Ze(Iie)}var Oie={get:function(e,t,r){var n=Ae((Bqe[e]||{})[t]);return r&&ae(n)?n[n.length-1]:n}},Bqe={color:{active:["#006edd","#e0ffff"],inactive:[J.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},uU=Hr.mapVisual,zqe=Hr.eachVisual,$qe=ae,cU=B,Fqe=Ai,Vqe=gt,oS=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i)},t.prototype.optionUpdated=function(r,n){var i=this.option;!n&&bie(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=me(r,this),this.controllerVisuals=WO(this.option.controller,n,r),this.targetVisuals=WO(this.option.target,n,r)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var r=this.option.seriesId,n=this.option.seriesIndex;n==null&&r==null&&(n="all");var i=zv(this.ecModel,"series",{index:n,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return se(i,function(a){return a.componentIndex})},t.prototype.eachTargetSeries=function(r,n){B(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&r.call(n,a)},this)},t.prototype.isTargetSeries=function(r){var n=!1;return this.eachTargetSeries(function(i){i===r&&(n=!0)}),n},t.prototype.formatValueText=function(r,n,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],ae(r)&&(r=r.slice(),u=!0);var c=n?r:u?[f(r[0]),f(r[1])]:f(r);if(pe(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(Ce(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===s[0]?i[0]+" "+c[1]:r[1]===s[1]?i[1]+" "+c[0]:c[0]+" - "+c[1];return c;function f(h){return h===s[0]?"min":h===s[1]?"max":(+h).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var r=this.option,n=Fqe([r.min,r.max]);this._dataExtent=n},t.prototype.getDataDimensionIndex=function(r){var n=this.option.dimension;if(n!=null)return r.getDimensionIndex(n);for(var i=r.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=r.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var r=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),o=n.controller||(n.controller={});He(a,i),He(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(f){$qe(n.color)&&!f.inRange&&(f.inRange={color:n.color.slice().reverse()}),f.inRange=f.inRange||{color:r.get("gradientColor")}}function u(f,h,d){var v=f[h],g=f[d];v&&!g&&(g=f[d]={},cU(v,function(m,x){if(Hr.isValidType(x)){var _=Oie.get(x,"inactive",s);_!=null&&(g[x]=_,x==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function c(f){var h=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,d=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,v=this.get("inactiveColor"),g=this.getItemSymbol(),m=g||"roundRect";cU(this.stateList,function(x){var _=this.itemSize,b=f[x];b||(b=f[x]={color:s?v:[v]}),b.symbol==null&&(b.symbol=h&&Ae(h)||(s?m:[m])),b.symbolSize==null&&(b.symbolSize=d&&Ae(d)||(s?_[0]:[_[0],_[0]])),b.symbol=uU(b.symbol,function(C){return C==="none"?m:C});var S=b.symbolSize;if(S!=null){var T=-1/0;zqe(S,function(C){C>T&&(T=C)}),b.symbolSize=uU(S,function(C){return Vqe(C,[0,T],[0,_[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(r){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(r){return null},t.prototype.getVisualMeta=function(r){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:J.color.transparent,borderColor:J.color.borderTint,contentColor:J.color.theme[0],inactiveColor:J.color.disabled,borderWidth:0,padding:J.size.m,textGap:10,precision:0,textStyle:{color:J.color.secondary}},t}(Ke),fU=[20,140],Gqe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(r,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=fU[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=fU[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):ae(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],r[0]),n[1]=Math.min(n[1],r[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),B(this.stateList,function(r){var n=this.option.controller[r].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},t.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},t.prototype.getSelected=function(){var r=this.getExtent(),n=Ai((this.get("range")||[]).slice());return n[0]>r[1]&&(n[0]=r[1]),n[1]>r[1]&&(n[1]=r[1]),n[0]=i[1]||r<=n[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(r){var n=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},t.prototype.getVisualMeta=function(r){var n=hU(this,"outOfRange",this.getExtent()),i=hU(this,"inRange",this.option.range.slice()),a=[];function o(d,v){a.push({value:d,color:r(d,v)})}for(var s=0,l=0,u=i.length,c=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/i})}return a.push({color:this.getControllerVisual(r[1],"color",n),offset:1}),a},t.prototype._createBarPoints=function(r,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],r[0]],[i[0],r[0]],[i[0],r[1]],[i[0]-n[1],r[1]]]},t.prototype._createBarGroup=function(r){var n=this._orient,i=this.visualMapModel.get("inverse");return new Me(n==="horizontal"&&!i?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},t.prototype._updateHandle=function(r,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),c=this._applyTransform("left",i.mainGroup);Wqe([0,1],function(f){var h=o[f];h.setStyle("fill",n.handlesColor[f]),h.y=r[f];var d=po(r[f],[0,l[1]],u,!0),v=this.getControllerVisual(d,"symbolSize");h.scaleX=h.scaleY=v/l[0],h.x=l[0]-v/2;var g=Ha(i.handleLabelPoints[f],Jl(h,this.group));if(this._orient==="horizontal"){var m=c==="left"||c==="top"?(l[0]-v)/2:(l[0]-v)/-2;g[1]+=m}s[f].setStyle({x:g[0],y:g[1],text:a.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(r,n,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,f=c.indicator;if(f){f.attr("invisible",!1);var h={convertOpacityToAlpha:!0},d=this.getControllerVisual(r,"color",h),v=this.getControllerVisual(r,"symbolSize"),g=po(r,s,u,!0),m=l[0]-v/2,x={x:f.x,y:f.y};f.y=g,f.x=m;var _=Ha(c.indicatorLabelPoint,Jl(f,this.group)),b=c.indicatorLabel;b.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,C=T==="horizontal";b.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:C?S:"middle",align:C?"center":S});var A={x:m,y:g,style:{fill:d}},P={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var I={duration:100,easing:"cubicInOut",additive:!0};f.x=x.x,f.y=x.y,f.animateTo(A,I),b.animateTo(P,I)}else f.attr(A),b.attr(P);this._firstShowIndicator=!1;var k=this._shapes.handleLabels;if(k)for(var E=0;Eo[1]&&(f[1]=1/0),n&&(f[0]===-1/0?this._showIndicator(c,f[1],"< ",l):f[1]===1/0?this._showIndicator(c,f[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var h=this._hoverLinkDataIndices,d=[];(n||gU(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var v=MRe(h,d);this._dispatchHighDown("downplay",Sb(v[0],i)),this._dispatchHighDown("highlight",Sb(v[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(jc(r.target,function(l){var u=De(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},t.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=o,n.push(a))}}),e.getData().setVisual("visualMeta",n)}}];function Jqe(e,t,r,n){for(var i=t.targetVisuals[n],a=Hr.prepareVisualTypes(i),o={color:_0(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(Xqe,qqe),B(Kqe,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(Qqe))}function jie(e){e.registerComponentModel(Gqe),e.registerComponentView(Zqe),Nie(e)}var eKe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._pieceList=[],r}return t.prototype.optionUpdated=function(r,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],tKe[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=Ae(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=se(this._pieceList,function(l){return l=Ae(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=Hr.listVisualTypes(),a=this.isCategory();B(r.pieces,function(s){B(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),B(n,function(s,l){var u=!1;B(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&B(this.stateList,function(c){(r[c]||(r[c]={}))[l]=Oie.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,o=(n?i:r).selected||{};if(i.selected=o,B(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;B(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(r){this.option.selected=Ae(r)},t.prototype.getValueState=function(r){var n=Hr.findPieceIndex(r,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(r){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=Hr.findPieceIndex(l,i);c===r&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},this),n},t.prototype.getRepresentValue=function(r){var n;if(this.isCategory())n=r.value;else if(r.value!=null)n=r.value;else{var i=r.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},t.prototype.getVisualMeta=function(r){if(this.isCategory())return;var n=[],i=["",""],a=this;function o(c,f){var h=a.getRepresentValue({interval:c});f||(f=a.getValueState(h));var d=r(h,f);c[0]===-1/0?i[0]=d:c[1]===1/0?i[1]=d:n.push({value:c[0],color:d},{value:c[1],color:d})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return B(s,function(c){var f=c.interval;f&&(f[0]>u&&o([u,f[0]],"outOfRange"),o(f.slice()),u=f[1])},this),{stops:n,outerColors:i}},t.type="visualMap.piecewise",t.defaultOption=Mu(oS.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(oS),tKe={splitNumber:function(e){var t=this.option,r=Math.min(t.precision,20),n=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(r)!==a&&r<5;)r++;t.precision=r,a=+a.toFixed(r),t.minOpen&&e.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function _U(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var rKe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.doRender=function(){var r=this.group;r.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,o=this._getItemAlign(),s=n.itemSize,l=this._getViewData(),u=l.endsText,c=rn(n.get("showLabel",!0),!u),f=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),B(l.viewPieceList,function(h){var d=h.piece,v=new Me;v.onclick=me(this._onItemClick,this,d),this._enableHoverLink(v,h.indexInModelPieceList);var g=n.getRepresentValue(d);if(this._createItemSymbol(v,g,[0,0,s[0],s[1]],f),c){var m=this.visualMapModel.getValueState(g),x=a.get("align")||o;v.add(new at({style:Mt(a,{x:x==="right"?-i:s[0]+i,y:s[1]/2,text:d.text,verticalAlign:a.get("verticalAlign")||"middle",align:x,opacity:be(a.get("opacity"),m==="outOfRange"?.5:1)}),silent:f}))}r.add(v)},this),u&&this._renderEndsText(r,u[1],s,c,o),Zc(n.get("orient"),r,n.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},t.prototype._enableHoverLink=function(r,n){var i=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:Sb(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return Die(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},t.prototype._renderEndsText=function(r,n,i,a,o){if(n){var s=new Me,l=this.visualMapModel.textStyleModel;s.add(new at({style:Mt(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),r.add(s)}},t.prototype._getViewData=function(){var r=this.visualMapModel,n=se(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},t.prototype._createItemSymbol=function(r,n,i,a){var o=xr(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,r.add(o)},t.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=Ae(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,B(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},t.type="visualMap.piecewise",t}(Eie);function Rie(e){e.registerComponentModel(eKe),e.registerComponentView(rKe),Nie(e)}function nKe(e){Ze(jie),Ze(Rie)}var iKe=function(){function e(t){this._thumbnailModel=t}return e.prototype.reset=function(t){this._renderVersion=t.getMainProcessVersion()},e.prototype.renderContent=function(t){var r=t.api.getViewOfComponentModel(this._thumbnailModel);r&&(t.group.silent=!0,r.renderContent({group:t.group,targetTrans:t.targetTrans,z2Range:sQ(t.group),roamType:t.roamType,viewportRect:t.viewportRect,renderVersion:this._renderVersion}))},e.prototype.updateWindow=function(t,r){var n=r.getViewOfComponentModel(this._thumbnailModel);n&&n.updateWindow({targetTrans:t,renderVersion:this._renderVersion})},e}(),aKe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.preventAutoZ=!0,r}return t.prototype.optionUpdated=function(r,n){this._updateBridge()},t.prototype._updateBridge=function(){var r=this._birdge=this._birdge||new iKe(this);if(this._target=null,this.ecModel.eachSeries(function(i){HW(i,null)}),this.shouldShow()){var n=this.getTarget();HW(n.baseMapProvider,r)}},t.prototype.shouldShow=function(){return this.getShallow("show",!0)},t.prototype.getBridge=function(){return this._birdge},t.prototype.getTarget=function(){if(this._target)return this._target;var r=this.getReferringComponents("series",{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];return r?r.subType!=="graph"&&(r=null):r=this.ecModel.queryComponents({mainType:"series",subType:"graph"})[0],this._target={baseMapProvider:r},this._target},t.type="thumbnail",t.layoutMode="box",t.dependencies=["series","geo"],t.defaultOption={show:!0,right:1,bottom:1,height:"25%",width:"25%",itemStyle:{borderColor:J.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:J.color.neutral30,borderColor:J.color.neutral40,opacity:.3},z:10},t}(Ke),oKe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this._api=i,this._model=r,this._coordSys||(this._coordSys=new Rf),!this._isEnabled()){this._clear();return}this._renderVersion=i.getMainProcessVersion();var a=this.group;a.removeAll();var o=r.getModel("itemStyle"),s=o.getItemStyle();s.fill==null&&(s.fill=n.get("backgroundColor")||J.color.neutral00);var l=jr(r,i).refContainer,u=zt(MQ(r,!0),l),c=s.lineWidth||0,f=this._contentRect=vf(u.clone(),c/2,!0,!0),h=new Me;a.add(h),h.setClipPath(new Xe({shape:f.plain()}));var d=this._targetGroup=new Me;h.add(d);var v=u.plain();v.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new Xe({style:s,shape:v,silent:!1,cursor:"grab"}));var g=r.getModel("windowStyle"),m=g.getShallow("borderRadius",!0);h.add(this._windowRect=new Xe({shape:{x:0,y:0,width:0,height:0,r:m},style:g.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),wU(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),wU(this._model,this))},t.prototype._dealRenderContent=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=this._targetGroup,i=this._coordSys,a=this._contentRect;if(n.removeAll(),!!r){var o=r.group,s=o.getBoundingRect();n.add(o),this._bgRect.z2=r.z2Range.min-10,i.setBoundingRect(s.x,s.y,s.width,s.height);var l=zt({left:"center",top:"center",aspect:s.width/s.height},a);i.setViewRect(l.x,l.y,l.width,l.height),o.attr(i.getTransformInfo().raw),this._windowRect.z2=r.z2Range.max+10,this._resetRoamController(r.roamType)}}},t.prototype.updateWindow=function(r){var n=this._bridgeRendered;n&&n.renderVersion===r.renderVersion&&(n.targetTrans=r.targetTrans),this._isEnabled()&&this._dealUpdateWindow()},t.prototype._dealUpdateWindow=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=va([],r.targetTrans),i=Ga([],this._coordSys.transform,n);this._transThisToTarget=va([],i);var a=r.viewportRect;a?a=a.clone():a=new Oe(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(Pe({r:s},a))}},t.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new jf(i.getZr())),!r||!this._isEnabled()){a.disable();return}a.enable(r,{api:i,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(o,s,l){return n._contentRect.contain(s,l)}}}),a.off("pan").off("zoom").on("pan",me(this._onPan,this)).on("zoom",me(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=lr([],[r.oldX,r.oldY],n),a=lr([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(bU(this._model.getTarget().baseMapProvider,{dx:a[0]-i[0],dy:a[1]-i[1]}))}},t.prototype._onZoom=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=lr([],[r.originX,r.originY],n);this._api.dispatchAction(bU(this._model.getTarget().baseMapProvider,{zoom:1/r.scale,originX:i[0],originY:i[1]}))}},t.prototype._isEnabled=function(){var r=this._model;if(!r||!r.shouldShow())return!1;var n=r.getTarget().baseMapProvider;return!!n},t.prototype._clear=function(){this.group.removeAll(),this._bridgeRendered=null,this._roamController&&this._roamController.disable()},t.prototype.remove=function(){this._clear()},t.prototype.dispose=function(){this._clear()},t.type="thumbnail",t}(kt);function bU(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,ie(n,t),n}function wU(e,t){var r=pf(e);GT(t.group,r.z,r.zlevel)}function sKe(e){e.registerComponentModel(aKe),e.registerComponentView(oKe)}var lKe={label:{enabled:!0},decal:{show:!1}},SU=Je(),uKe={};function cKe(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=Ae(lKe);He(n.label,e.getLocaleModel().get("aria"),!1),He(r.option,n,!1),i(),a();function i(){var u=r.getModel("decal"),c=u.get("show");if(c){var f=_e();e.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),SU(h).scope=d}}),e.eachRawSeries(function(h){if(e.isSeriesFiltered(h))return;if(Ce(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var _=jI(h.ecModel,h.name,uKe,e.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",S(b,_))}else{var v=h.getRawData(),g={},m=SU(h).scope;d.each(function(T){var C=d.getRawIndex(T);g[C]=T});var x=v.count();v.each(function(T){var C=g[T],A=v.getName(T)||T+"",P=jI(h.ecModel,A,m,x),I=d.getItemVisual(C,"decal");d.setItemVisual(C,"decal",S(I,P))})}function S(T,C){var A=T?ie(ie({},C),T):C;return A.dirty=!0,A}})}}function a(){var u=t.getZr().dom;if(u){var c=e.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=Pe(f.option,c),!!f.get("enabled")){if(u.setAttribute("role","img"),f.get("description")){u.setAttribute("aria-label",f.get("description"));return}var h=e.getSeriesCount(),d=f.get(["data","maxCount"])||10,v=f.get(["series","maxCount"])||10,g=Math.min(h,v),m;if(!(h<1)){var x=s();if(x){var _=f.get(["general","withTitle"]);m=o(_,{title:x})}else m=f.get(["general","withoutTitle"]);var b=[],S=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);m+=o(S,{seriesCount:h}),e.eachSeries(function(P,I){if(I1?f.get(["series","multiple",D]):f.get(["series","single",D]),k=o(k,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var N=P.getData();if(N.count()>d){var z=f.get(["data","partialData"]);k+=o(z,{displayCnt:d})}else k+=f.get(["data","allData"]);for(var F=f.get(["data","separator","middle"]),$=f.get(["data","separator","end"]),Z=f.get(["data","excludeDimensionId"]),j=[],U=0;U":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},dKe=function(){function e(t){var r=this._condVal=pe(t)?new RegExp(t):IK(t)?t:null;if(r==null){var n="";mt(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return pe(r)?this._condVal.test(t):ot(r)?this._condVal.test(t+""):!1},e}(),vKe=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),pKe=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[N,z]}function c(N,z,F,$){Jh(N,F)&&Jh(z,$)||i.push(N,z,F,$,F,$)}function f(N,z,F,$,Z,j){var U=Math.abs(z-N),G=Math.tan(U/4)*4/3,V=zP:E2&&n.push(i),n}function JO(e,t,r,n,i,a,o,s,l,u){if(Jh(e,r)&&Jh(t,n)&&Jh(i,o)&&Jh(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-e,d=s-t,v=Math.sqrt(h*h+d*d);h/=v,d/=v;var g=r-e,m=n-t,x=i-o,_=a-s,b=g*g+m*m,S=x*x+_*_;if(b=0&&P=0){l.push(o,s);return}var I=[],k=[];uu(e,r,i,o,.5,I),uu(t,n,a,s,.5,k),JO(I[0],k[0],I[1],k[1],I[2],k[2],I[3],k[3],l,u),JO(I[4],k[4],I[5],k[5],I[6],k[6],I[7],k[7],l,u)}function kKe(e,t){var r=KO(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),f=zie([l,u],c?0:1,t),h=(c?s:u)/f.length,d=0;di,o=zie([n,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=e[s]/o.length,h=0;h1?null:new Ie(g*l+e,g*u+t)}function OKe(e,t,r){var n=new Ie;Ie.sub(n,r,t),n.normalize();var i=new Ie;Ie.sub(i,e,t);var a=i.dot(n);return a}function Sh(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function EKe(e,t,r){for(var n=e.length,i=[],a=0;ao?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),EKe(t,u,c)}function sS(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);sS(e,a[0],i,n),sS(e,a[1],r-i,n)}return n}function DKe(e,t){for(var r=[],n=0;n0;u/=2){var c=0,f=0;(e&u)>0&&(c=1),(t&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(e=u-1-e,t=u-1-t),l=e,e=t,t=l)}return s}function cS(e){var t=1/0,r=1/0,n=-1/0,i=-1/0,a=se(e,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),r=Math.min(f,r),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=se(a,function(s,l){return{cp:s,z:GKe(s[0],s[1],t,r,n,i),path:e[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function Vie(e){return RKe(e.path,e.count)}function QO(){return{fromIndividuals:[],toIndividuals:[],count:0}}function WKe(e,t,r){var n=[];function i(T){for(var C=0;C=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var UKe={clone:function(e){for(var t=[],r=1-Math.pow(1-e.path.style.opacity,1/e.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;OU(e)&&(u=e,c=t),OU(t)&&(u=t,c=e);function f(x,_,b,S,T){var C=x.many,A=x.one;if(C.length===1&&!T){var P=_?C[0]:A,I=_?A:C[0];if(lS(P))f({many:[P],one:I},!0,b,S,!0);else{var k=s?Pe({delay:s(b,S)},l):l;GR(P,I,k),a(P,I,P,I,k)}}else for(var E=Pe({dividePath:UKe[r],individualDelay:s&&function(Z,j,U,G){return s(Z+b,S)}},l),D=_?WKe(C,A,E):HKe(A,C,E),N=D.fromIndividuals,z=D.toIndividuals,F=N.length,$=0;$t.length,d=u?EU(c,u):EU(h?t:e,[h?e:t]),v=0,g=0;gGie))for(var a=n.getIndices(),o=0;o0&&C.group.traverse(function(P){P instanceof tt&&!P.animators.length&&P.animateFrom({style:{opacity:0}},A)})})}function BU(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function zU(e){return ae(e)?e.sort().join(","):e}function wl(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function QKe(e,t){var r=_e(),n=_e(),i=_e();return B(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=BU(a),c=zU(u);n.set(c,{dataGroupId:s,data:l}),ae(u)&&B(u,function(f){i.set(f,{key:c,dataGroupId:s,data:l})})}),B(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=BU(a),u=zU(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:wl(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:wl(s),data:s}]});else if(ae(l)){var f=[];B(l,function(v){var g=n.get(v);g.data&&f.push({dataGroupId:g.dataGroupId,divide:wl(g.data),data:g.data})}),f.length&&r.set(u,{oldSeries:f,newSeries:[{dataGroupId:o,data:s,divide:wl(s)}]})}else{var h=i.get(l);if(h){var d=r.get(h.key);d||(d={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:wl(h.data)}],newSeries:[]},r.set(h.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:wl(s)})}}}}),r}function $U(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:wl(t.oldData[s]),groupIdDim:o.dimension})}),B(Pt(e.to),function(o){var s=$U(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:wl(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&Wie(i,a,n)}function tJe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){B(Pt(n.seriesTransition),function(i){B(Pt(i.to),function(a){for(var o=n.updatedSeries,s=0;so.vmin?r+=o.vmin-n+(t-o.vmin)/(o.vmax-o.vmin)*o.gapReal:r+=t-n,n=o.vmax,i=!1;break}r+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(r+=t-n),r},e.prototype.unelapse=function(t){for(var r=FU,n=VU,i=!0,a=0,o=0;ol?a=s.vmin+(t-l)/(u-l)*(s.vmax-s.vmin):a=n+t-r,n=s.vmax,i=!1;break}r=u,n=s.vmax}return i&&(a=n+t-r),a},e}();function nJe(){return new rJe}var FU=0,VU=0;function iJe(e,t){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};B(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=WR(s,t);if(u){var c=u.vmin!==s.vmin,f=u.vmax!==s.vmax,h=u.vmax-u.vmin;if(!(c&&f))if(c||f){var d=c?"S":"E";a[d][l.type].has=!0,a[d][l.type].span=h,a[d][l.type].inExtFrac=h/(s.vmax-s.vmin),a[d][l.type].val=l.val}else n[l.type].span+=h,n[l.type].val+=l.val}});var o=r*(0+(t[1]-t[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));B(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?Math.max(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function aJe(e,t,r,n,i,a){e!=="no"&&B(r,function(o){var s=WR(o,a);if(s)for(var l=t.length-1;l>=0;l--){var u=t[l],c=n(u),f=i*3/4;c>s.vmin-f&&ct[0]&&r=0&&o<1-1e-5}B(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:Ae(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(pe(o.gap)){var u=Ci(o.gap);if(u.match(/%$/)){var c=parseFloat(u)/100;i(c)||(c=0),s.gapParsed.type="tpPrct",s.gapParsed.val=c,l=!0}}if(!l){var f=t(o.gap);(!isFinite(f)||f<0)&&(f=0),s.gapParsed.type="tpAbs",s.gapParsed.val=f}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&B(["vmin","vmax"],function(d){s[d]<0&&(s[d]=0)}),s.vmin>s.vmax){var h=s.vmax;s.vmax=s.vmin,s.vmin=h}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return B(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function HR(e,t){return tE(t)===tE(e)}function tE(e){return e.start+"_\0_"+e.end}function sJe(e,t,r){var n=[];B(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),B(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=Tu(n,function(u){return HR(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return B(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function lJe(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=Tu(r,function(f){return HR(f.breakOption,e.break.parsedBreak.breakOption)}),l=n(Math.pow(t,o.vmin),s.vmin),u=n(Math.pow(t,o.vmax),s.vmax),c={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?gr(Math.pow(t,o.vmin+o.gapParsed.val))-l:o.gapParsed.val};i={type:e.break.type,parsedBreak:{breakOption:o.breakOption,vmin:l,vmax:u,gapParsed:c,gapReal:o.gapReal}},a=s[e.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function uJe(e,t,r){var n={noNegative:!0},i=eE(e,r,n),a=eE(e,r,n),o=Math.log(t);return a.breaks=se(a.breaks,function(s){var l=Math.log(s.vmin)/o,u=Math.log(s.vmax)/o,c={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?Math.log(s.vmin+s.gapParsed.val)/o-l:s.gapParsed.val};return{vmin:l,vmax:u,gapParsed:c,gapReal:s.gapReal,breakOption:s.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var cJe={vmin:"start",vmax:"end"};function fJe(e,t){return t&&(e=e||{},e.break={type:cJe[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function hJe(){D3e({createScaleBreakContext:nJe,pruneTicksByBreak:aJe,addBreaksToTicks:oJe,parseAxisBreakOption:eE,identifyAxisBreak:HR,serializeAxisBreakIdentifier:tE,retrieveAxisBreakPairs:sJe,getTicksLogTransformBreak:lJe,logarithmicParseBreaksFromOption:uJe,makeAxisLabelFormatterParamBreak:fJe})}var GU=Je();function dJe(e,t){var r=Tu(e,function(n){return Sr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function vJe(e){B(e,function(t){return t.shouldRemove=!0})}function pJe(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function gJe(e,t,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Sr())return;var o=Sr().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(I){return I.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),c=s.get("zigzagMaxSpan");u=Math.max(2,u||0),c=Math.max(u,c||0);var f=s.get("expandOnClick"),h=s.get("zigzagZ"),d=s.getModel("itemStyle"),v=d.getItemStyle(),g=v.stroke,m=v.lineWidth,x=v.lineDash,_=v.fill,b=new Me({ignoreModelZ:!0}),S=a.isHorizontal(),T=GU(t).visualList||(GU(t).visualList=[]);vJe(T);for(var C=function(I){var k=o[I][0].break.parsedBreak,E=[];E[0]=a.toGlobalCoord(a.dataToCoord(k.vmin,!0)),E[1]=a.toGlobalCoord(a.dataToCoord(k.vmax,!0)),E[1]=j;he&&(K=j);var Re=[],ge=[];Re[$]=E,ge[$]=D,!le&&!he&&(Re[$]+=Y?-l:l,ge[$]-=Y?l:-l),Re[Z]=K,ge[Z]=K,G.push(Re),V.push(ge);var ne=void 0;if(ee_[1]&&_.reverse(),{coordPair:_,brkId:Sr().serializeAxisBreakIdentifier(x.breakOption)}});l.sort(function(m,x){return m.coordPair[0]-x.coordPair[0]});for(var u=o[0],c=null,f=0;f=0?l[0].width:l[1].width),h=(f+c.x)/2-u.x,d=Math.min(h,h-c.x),v=Math.max(h,h-c.x),g=v<0?v:d>0?d:0;s=(h-g)/c.x}var m=new Ie,x=new Ie;Ie.scale(m,n,-s),Ie.scale(x,n,1-s),rO(r[0],m),rO(r[1],x)}function xJe(e,t){var r={breaks:[]};return B(t.breaks,function(n){if(n){var i=Tu(e.get("breaks",!0),function(s){return Sr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===eC?!0:a===fre?!1:a===hre?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function _Je(){p6e({adjustBreakLabelPair:yJe,buildAxisBreakLine:mJe,rectCoordBuildBreakAxis:gJe,updateModelAxisBreak:xJe})}function bJe(e){b6e(e),hJe(),_Je()}function wJe(){V6e(SJe)}function SJe(e,t){B(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=TJe(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);t[i]-=n[i]+a,r.position==="top"?t.y+=n.height+a:r.position==="left"&&(t.x+=n.width+a)}}})}function TJe(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof av?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=Qv(e),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c1&&arguments[1]!==void 0?arguments[1]:60,i=null;return function(){for(var a=this,o=arguments.length,s=new Array(o),l=0;l12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function FJe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function VJe(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function GJe({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=W.useRef(null),[a,o]=W.useState("connected"),s=W.useMemo(()=>{const m=new Set;return t.forEach(x=>{m.add(x.from_node),m.add(x.to_node)}),m},[t]),l=W.useMemo(()=>{let m=e;return a==="connected"?m=m.filter(x=>s.has(x.node_num)):a==="infra"&&(m=m.filter(x=>UU.includes(x.role))),m},[e,a,s]),u=W.useMemo(()=>new Map(l.map(m=>[m.node_num,m])),[l]),c=W.useMemo(()=>t.filter(m=>u.has(m.from_node)&&u.has(m.to_node)),[t,u]),f=W.useMemo(()=>{const m=new Set;return r!==null&&c.forEach(x=>{x.from_node===r&&m.add(x.to_node),x.to_node===r&&m.add(x.from_node)}),m},[r,c]),h=W.useMemo(()=>{const m=l.map(_=>{const b=FJe(_.latitude),S=HU[b%HU.length],T=UU.includes(_.role),C=_.node_num===r,A=f.has(_.node_num),P=r===null||C||A;return{id:String(_.node_num),name:_.short_name,value:_.node_num,symbolSize:VJe(_.role),itemStyle:{color:T?S:"#111827",borderColor:S,borderWidth:T?0:2,opacity:P?1:.15},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace",color:P?"#94a3b8":"#94a3b820"},nodeNum:_.node_num,longName:_.long_name,role:_.role}}),x=c.map(_=>{const b=r===null||_.from_node===r||_.to_node===r;return{source:String(_.from_node),target:String(_.to_node),value:_.snr,lineStyle:{color:$Je(_.snr),width:b&&r!==null?2:1,opacity:r===null?.4:b?.6:.04}}});return{nodes:m,links:x}},[l,c,r,f]),d=W.useMemo(()=>({backgroundColor:"#111827",tooltip:{trigger:"item",backgroundColor:"#1e293b",borderColor:"#334155",textStyle:{color:"#e2e8f0",fontFamily:"JetBrains Mono, monospace",fontSize:11},formatter:m=>{if(m.data&&m.data.longName){const x=m.data;return`${x.name}
${x.longName}
Role: ${x.role}`}return""}},series:[{type:"graph",layout:"force",roam:!0,draggable:!0,animation:!1,data:h.nodes,links:h.links,force:{repulsion:200,edgeLength:[80,120],gravity:.1},emphasis:{focus:"adjacency",blurScope:"coordinateSystem",scale:1.1,lineStyle:{width:2}},blur:{itemStyle:{opacity:.15},lineStyle:{opacity:.04}},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace"},edgeLabel:{show:!1},edgeSymbol:["none","none"]}]}),[h]),v=W.useCallback(m=>{if(m.data&&"nodeNum"in m.data){const x=m.data.nodeNum;n(r===x?null:x??null)}},[r,n]),g=W.useMemo(()=>({click:v}),[v]);return W.useEffect(()=>{var x;const m=(x=i.current)==null?void 0:x.getEchartsInstance();m&&m.setOption(d,{notMerge:!1,lazyUpdate:!0})},[d]),y.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[y.jsx(zJe,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:g,opts:{renderer:"canvas"}}),y.jsxs("div",{className:"absolute top-4 left-4 flex items-center gap-2 bg-bg-card/90 backdrop-blur-sm border border-border rounded px-3 py-2",children:[y.jsx(aD,{size:14,className:"text-slate-500"}),y.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:m,label:x})=>y.jsx("button",{onClick:()=>o(m),className:`px-2 py-1 text-xs rounded transition-colors ${a===m?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:x},m))}),y.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes • ",c.length," edges"]})]}),y.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[y.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),y.jsx("div",{className:"space-y-1",children:[{label:"Excellent (>12)",color:"#22c55e"},{label:"Good (8-12)",color:"#4ade80"},{label:"Fair (5-8)",color:"#f59e0b"},{label:"Marginal (3-5)",color:"#f97316"},{label:"Poor (<3)",color:"#ef4444"}].map(m=>y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:m.color}}),y.jsx("span",{className:"text-xs text-slate-500",children:m.label})]},m.label))})]}),y.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[y.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),y.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-blue-500"}),y.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function Zie(e,t){const r=W.useRef(t);W.useEffect(function(){t!==r.current&&e.attributionControl!=null&&(r.current!=null&&e.attributionControl.removeAttribution(r.current),t!=null&&e.attributionControl.addAttribution(t)),r.current=t},[e,t])}function WJe(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const HJe=1;function UJe(e){return Object.freeze({__version:HJe,map:e})}function Yie(e,t){return Object.freeze({...e,...t})}const Xie=W.createContext(null),qie=Xie.Provider;function hC(){const e=W.useContext(Xie);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function ZJe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return W.useImperativeHandle(n,()=>i),r.children==null?null:Q.createElement(qie,{value:a},r.children)}return W.forwardRef(t)}function YJe(e){function t(r,n){const[i,a]=W.useState(!1),{instance:o}=e(r,a).current;W.useImperativeHandle(n,()=>o),W.useEffect(function(){i&&o.update()},[o,i,r.children]);const s=o._contentNode;return s?mZ.createPortal(r.children,s):null}return W.forwardRef(t)}function XJe(e){function t(r,n){const{instance:i}=e(r).current;return W.useImperativeHandle(n,()=>i),null}return W.forwardRef(t)}function XR(e,t){const r=W.useRef();W.useEffect(function(){return t!=null&&e.instance.on(t),r.current=t,function(){r.current!=null&&e.instance.off(r.current),r.current=null}},[e,t])}function dC(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function qJe(e,t){return function(n,i){const a=hC(),o=e(dC(n,a),a);return Zie(a.map,n.attribution),XR(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var iE={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */(function(e,t){(function(r,n){n(t)})(fg,function(r){var n="1.9.4";function i(p){var w,M,O,R;for(M=1,O=arguments.length;M"u"||!L||!L.Mixin)){p=b(p)?p:[p];for(var w=0;w0?Math.floor(p):Math.ceil(p)};j.prototype={clone:function(){return new j(this.x,this.y)},add:function(p){return this.clone()._add(G(p))},_add:function(p){return this.x+=p.x,this.y+=p.y,this},subtract:function(p){return this.clone()._subtract(G(p))},_subtract:function(p){return this.x-=p.x,this.y-=p.y,this},divideBy:function(p){return this.clone()._divideBy(p)},_divideBy:function(p){return this.x/=p,this.y/=p,this},multiplyBy:function(p){return this.clone()._multiplyBy(p)},_multiplyBy:function(p){return this.x*=p,this.y*=p,this},scaleBy:function(p){return new j(this.x*p.x,this.y*p.y)},unscaleBy:function(p){return new j(this.x/p.x,this.y/p.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=U(this.x),this.y=U(this.y),this},distanceTo:function(p){p=G(p);var w=p.x-this.x,M=p.y-this.y;return Math.sqrt(w*w+M*M)},equals:function(p){return p=G(p),p.x===this.x&&p.y===this.y},contains:function(p){return p=G(p),Math.abs(p.x)<=Math.abs(this.x)&&Math.abs(p.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}};function G(p,w,M){return p instanceof j?p:b(p)?new j(p[0],p[1]):p==null?p:typeof p=="object"&&"x"in p&&"y"in p?new j(p.x,p.y):new j(p,w,M)}function V(p,w){if(p)for(var M=w?[p,w]:p,O=0,R=M.length;O=this.min.x&&M.x<=this.max.x&&w.y>=this.min.y&&M.y<=this.max.y},intersects:function(p){p=Y(p);var w=this.min,M=this.max,O=p.min,R=p.max,H=R.x>=w.x&&O.x<=M.x,X=R.y>=w.y&&O.y<=M.y;return H&&X},overlaps:function(p){p=Y(p);var w=this.min,M=this.max,O=p.min,R=p.max,H=R.x>w.x&&O.xw.y&&O.y=w.lat&&R.lat<=M.lat&&O.lng>=w.lng&&R.lng<=M.lng},intersects:function(p){p=ee(p);var w=this._southWest,M=this._northEast,O=p.getSouthWest(),R=p.getNorthEast(),H=R.lat>=w.lat&&O.lat<=M.lat,X=R.lng>=w.lng&&O.lng<=M.lng;return H&&X},overlaps:function(p){p=ee(p);var w=this._southWest,M=this._northEast,O=p.getSouthWest(),R=p.getNorthEast(),H=R.lat>w.lat&&O.latw.lng&&O.lng1,cae=function(){var p=!1;try{var w=Object.defineProperty({},"passive",{get:function(){p=!0}});window.addEventListener("testPassiveEventSupport",f,w),window.removeEventListener("testPassiveEventSupport",f,w)}catch{}return p}(),fae=function(){return!!document.createElement("canvas").getContext}(),dC=!!(document.createElementNS&&Ge("svg").createSVGRect),hae=!!dC&&function(){var p=document.createElement("div");return p.innerHTML="",(p.firstChild&&p.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),dae=!dC&&function(){try{var p=document.createElement("div");p.innerHTML='';var w=p.firstChild;return w.style.behavior="url(#default#VML)",w&&typeof w.adj=="object"}catch{return!1}}(),vae=navigator.platform.indexOf("Mac")===0,pae=navigator.platform.indexOf("Linux")===0;function eo(p){return navigator.userAgent.toLowerCase().indexOf(p)>=0}var Ue={ie:Ft,ielt9:rr,edge:Nn,webkit:Xr,android:qn,android23:zf,androidStock:M0,opera:fC,chrome:XR,gecko:qR,safari:tae,phantom:KR,opera12:JR,win:rae,ie3d:QR,webkit3d:hC,gecko3d:e5,any3d:nae,mobile:rp,mobileWebkit:iae,mobileWebkit3d:aae,msPointer:t5,pointer:r5,touch:oae,touchNative:n5,mobileOpera:sae,mobileGecko:lae,retina:uae,passiveEvents:cae,canvas:fae,svg:dC,vml:dae,inlineSvg:hae,mac:vae,linux:pae},i5=Ue.msPointer?"MSPointerDown":"pointerdown",a5=Ue.msPointer?"MSPointerMove":"pointermove",o5=Ue.msPointer?"MSPointerUp":"pointerup",s5=Ue.msPointer?"MSPointerCancel":"pointercancel",vC={touchstart:i5,touchmove:a5,touchend:o5,touchcancel:s5},l5={touchstart:bae,touchmove:P0,touchend:P0,touchcancel:P0},$f={},u5=!1;function gae(p,w,M){return w==="touchstart"&&_ae(),l5[w]?(M=l5[w].bind(this,M),p.addEventListener(vC[w],M,!1),M):(console.warn("wrong event specified:",w),f)}function mae(p,w,M){if(!vC[w]){console.warn("wrong event specified:",w);return}p.removeEventListener(vC[w],M,!1)}function yae(p){$f[p.pointerId]=p}function xae(p){$f[p.pointerId]&&($f[p.pointerId]=p)}function c5(p){delete $f[p.pointerId]}function _ae(){u5||(document.addEventListener(i5,yae,!0),document.addEventListener(a5,xae,!0),document.addEventListener(o5,c5,!0),document.addEventListener(s5,c5,!0),u5=!0)}function P0(p,w){if(w.pointerType!==(w.MSPOINTER_TYPE_MOUSE||"mouse")){w.touches=[];for(var M in $f)w.touches.push($f[M]);w.changedTouches=[w],p(w)}}function bae(p,w){w.MSPOINTER_TYPE_TOUCH&&w.pointerType===w.MSPOINTER_TYPE_TOUCH&&ln(w),P0(p,w)}function wae(p){var w={},M,O;for(O in p)M=p[O],w[O]=M&&M.bind?M.bind(p):M;return p=w,w.type="dblclick",w.detail=2,w.isTrusted=!1,w._simulated=!0,w}var Sae=200;function Tae(p,w){p.addEventListener("dblclick",w);var M=0,O;function R(H){if(H.detail!==1){O=H.detail;return}if(!(H.pointerType==="mouse"||H.sourceCapabilities&&!H.sourceCapabilities.firesTouchEvents)){var X=p5(H);if(!(X.some(function(oe){return oe instanceof HTMLLabelElement&&oe.attributes.for})&&!X.some(function(oe){return oe instanceof HTMLInputElement||oe instanceof HTMLSelectElement}))){var re=Date.now();re-M<=Sae?(O++,O===2&&w(wae(H))):O=1,M=re}}}return p.addEventListener("click",R),{dblclick:w,simDblclick:R}}function Cae(p,w){p.removeEventListener("dblclick",w.dblclick),p.removeEventListener("click",w.simDblclick)}var pC=I0(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),np=I0(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),f5=np==="webkitTransition"||np==="OTransition"?np+"End":"transitionend";function h5(p){return typeof p=="string"?document.getElementById(p):p}function ip(p,w){var M=p.style[w]||p.currentStyle&&p.currentStyle[w];if((!M||M==="auto")&&document.defaultView){var O=document.defaultView.getComputedStyle(p,null);M=O?O[w]:null}return M==="auto"?null:M}function Ct(p,w,M){var O=document.createElement(p);return O.className=w||"",M&&M.appendChild(O),O}function nr(p){var w=p.parentNode;w&&w.removeChild(p)}function k0(p){for(;p.firstChild;)p.removeChild(p.firstChild)}function Ff(p){var w=p.parentNode;w&&w.lastChild!==p&&w.appendChild(p)}function Vf(p){var w=p.parentNode;w&&w.firstChild!==p&&w.insertBefore(p,w.firstChild)}function gC(p,w){if(p.classList!==void 0)return p.classList.contains(w);var M=L0(p);return M.length>0&&new RegExp("(^|\\s)"+w+"(\\s|$)").test(M)}function ut(p,w){if(p.classList!==void 0)for(var M=v(w),O=0,R=M.length;O0?2*window.devicePixelRatio:1;function m5(p){return Ue.edge?p.wheelDeltaY/2:p.deltaY&&p.deltaMode===0?-p.deltaY/Pae:p.deltaY&&p.deltaMode===1?-p.deltaY*20:p.deltaY&&p.deltaMode===2?-p.deltaY*60:p.deltaX||p.deltaZ?0:p.wheelDelta?(p.wheelDeltaY||p.wheelDelta)/2:p.detail&&Math.abs(p.detail)<32765?-p.detail*20:p.detail?p.detail/-32765*60:0}function PC(p,w){var M=w.relatedTarget;if(!M)return!0;try{for(;M&&M!==p;)M=M.parentNode}catch{return!1}return M!==p}var kae={__proto__:null,on:st,off:Wt,stopPropagation:Ou,disableScrollPropagation:MC,disableClickPropagation:lp,preventDefault:ln,stop:Eu,getPropagationPath:p5,getMousePosition:g5,getWheelDelta:m5,isExternalTarget:PC,addListener:st,removeListener:Wt},y5=Z.extend({run:function(p,w,M,O){this.stop(),this._el=p,this._inProgress=!0,this._duration=M||.25,this._easeOutPower=1/Math.max(O||.5,.2),this._startPos=Iu(p),this._offset=w.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=E(this._animate,this),this._step()},_step:function(p){var w=+new Date-this._startTime,M=this._duration*1e3;wthis.options.maxZoom)?this.setZoom(p):this},panInsideBounds:function(p,w){this._enforcingBounds=!0;var M=this.getCenter(),O=this._limitCenter(M,this._zoom,ee(p));return M.equals(O)||this.panTo(O,w),this._enforcingBounds=!1,this},panInside:function(p,w){w=w||{};var M=G(w.paddingTopLeft||w.padding||[0,0]),O=G(w.paddingBottomRight||w.padding||[0,0]),R=this.project(this.getCenter()),H=this.project(p),X=this.getPixelBounds(),re=Y([X.min.add(M),X.max.subtract(O)]),oe=re.getSize();if(!re.contains(H)){this._enforcingBounds=!0;var de=H.subtract(re.getCenter()),Ee=re.extend(H).getSize().subtract(oe);R.x+=de.x<0?-Ee.x:Ee.x,R.y+=de.y<0?-Ee.y:Ee.y,this.panTo(this.unproject(R),w),this._enforcingBounds=!1}return this},invalidateSize:function(p){if(!this._loaded)return this;p=i({animate:!1,pan:!0},p===!0?{animate:!0}:p);var w=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var M=this.getSize(),O=w.divideBy(2).round(),R=M.divideBy(2).round(),H=O.subtract(R);return!H.x&&!H.y?this:(p.animate&&p.pan?this.panBy(H):(p.pan&&this._rawPanBy(H),this.fire("move"),p.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:w,newSize:M}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(p){if(p=this._locateOptions=i({timeout:1e4,watch:!1},p),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var w=o(this._handleGeolocationResponse,this),M=o(this._handleGeolocationError,this);return p.watch?this._locationWatchId=navigator.geolocation.watchPosition(w,M,p):navigator.geolocation.getCurrentPosition(w,M,p),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(p){if(this._container._leaflet_id){var w=p.code,M=p.message||(w===1?"permission denied":w===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:w,message:"Geolocation error: "+M+"."})}},_handleGeolocationResponse:function(p){if(this._container._leaflet_id){var w=p.coords.latitude,M=p.coords.longitude,O=new le(w,M),R=O.toBounds(p.coords.accuracy*2),H=this._locateOptions;if(H.setView){var X=this.getBoundsZoom(R);this.setView(O,H.maxZoom?Math.min(X,H.maxZoom):X)}var re={latlng:O,bounds:R,timestamp:p.timestamp};for(var oe in p.coords)typeof p.coords[oe]=="number"&&(re[oe]=p.coords[oe]);this.fire("locationfound",re)}},addHandler:function(p,w){if(!w)return this;var M=this[p]=new w(this);return this._handlers.push(M),this.options[p]&&M.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),nr(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(D(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var p;for(p in this._layers)this._layers[p].remove();for(p in this._panes)nr(this._panes[p]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(p,w){var M="leaflet-pane"+(p?" leaflet-"+p.replace("Pane","")+"-pane":""),O=Ct("div",M,w||this._mapPane);return p&&(this._panes[p]=O),O},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var p=this.getPixelBounds(),w=this.unproject(p.getBottomLeft()),M=this.unproject(p.getTopRight());return new K(w,M)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(p,w,M){p=ee(p),M=G(M||[0,0]);var O=this.getZoom()||0,R=this.getMinZoom(),H=this.getMaxZoom(),X=p.getNorthWest(),re=p.getSouthEast(),oe=this.getSize().subtract(M),de=Y(this.project(re,O),this.project(X,O)).getSize(),Ee=Ue.any3d?this.options.zoomSnap:1,Qe=oe.x/de.x,pt=oe.y/de.y,jn=w?Math.max(Qe,pt):Math.min(Qe,pt);return O=this.getScaleZoom(jn,O),Ee&&(O=Math.round(O/(Ee/100))*(Ee/100),O=w?Math.ceil(O/Ee)*Ee:Math.floor(O/Ee)*Ee),Math.max(R,Math.min(H,O))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new j(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(p,w){var M=this._getTopLeftPoint(p,w);return new V(M,M.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(p){return this.options.crs.getProjectedBounds(p===void 0?this.getZoom():p)},getPane:function(p){return typeof p=="string"?this._panes[p]:p},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(p,w){var M=this.options.crs;return w=w===void 0?this._zoom:w,M.scale(p)/M.scale(w)},getScaleZoom:function(p,w){var M=this.options.crs;w=w===void 0?this._zoom:w;var O=M.zoom(p*M.scale(w));return isNaN(O)?1/0:O},project:function(p,w){return w=w===void 0?this._zoom:w,this.options.crs.latLngToPoint(he(p),w)},unproject:function(p,w){return w=w===void 0?this._zoom:w,this.options.crs.pointToLatLng(G(p),w)},layerPointToLatLng:function(p){var w=G(p).add(this.getPixelOrigin());return this.unproject(w)},latLngToLayerPoint:function(p){var w=this.project(he(p))._round();return w._subtract(this.getPixelOrigin())},wrapLatLng:function(p){return this.options.crs.wrapLatLng(he(p))},wrapLatLngBounds:function(p){return this.options.crs.wrapLatLngBounds(ee(p))},distance:function(p,w){return this.options.crs.distance(he(p),he(w))},containerPointToLayerPoint:function(p){return G(p).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(p){return G(p).add(this._getMapPanePos())},containerPointToLatLng:function(p){var w=this.containerPointToLayerPoint(G(p));return this.layerPointToLatLng(w)},latLngToContainerPoint:function(p){return this.layerPointToContainerPoint(this.latLngToLayerPoint(he(p)))},mouseEventToContainerPoint:function(p){return g5(p,this._container)},mouseEventToLayerPoint:function(p){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(p))},mouseEventToLatLng:function(p){return this.layerPointToLatLng(this.mouseEventToLayerPoint(p))},_initContainer:function(p){var w=this._container=h5(p);if(w){if(w._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");st(w,"scroll",this._onScroll,this),this._containerId=l(w)},_initLayout:function(){var p=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ue.any3d,ut(p,"leaflet-container"+(Ue.touch?" leaflet-touch":"")+(Ue.retina?" leaflet-retina":"")+(Ue.ielt9?" leaflet-oldie":"")+(Ue.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var w=ip(p,"position");w!=="absolute"&&w!=="relative"&&w!=="fixed"&&w!=="sticky"&&(p.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var p=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ar(this._mapPane,new j(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ut(p.markerPane,"leaflet-zoom-hide"),ut(p.shadowPane,"leaflet-zoom-hide"))},_resetView:function(p,w,M){Ar(this._mapPane,new j(0,0));var O=!this._loaded;this._loaded=!0,w=this._limitZoom(w),this.fire("viewprereset");var R=this._zoom!==w;this._moveStart(R,M)._move(p,w)._moveEnd(R),this.fire("viewreset"),O&&this.fire("load")},_moveStart:function(p,w){return p&&this.fire("zoomstart"),w||this.fire("movestart"),this},_move:function(p,w,M,O){w===void 0&&(w=this._zoom);var R=this._zoom!==w;return this._zoom=w,this._lastCenter=p,this._pixelOrigin=this._getNewPixelOrigin(p),O?M&&M.pinch&&this.fire("zoom",M):((R||M&&M.pinch)&&this.fire("zoom",M),this.fire("move",M)),this},_moveEnd:function(p){return p&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return D(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(p){Ar(this._mapPane,this._getMapPanePos().subtract(p))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(p){this._targets={},this._targets[l(this._container)]=this;var w=p?Wt:st;w(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&w(window,"resize",this._onResize,this),Ue.any3d&&this.options.transform3DLimit&&(p?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){D(this._resizeRequest),this._resizeRequest=E(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var p=this._getMapPanePos();Math.max(Math.abs(p.x),Math.abs(p.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(p,w){for(var M=[],O,R=w==="mouseout"||w==="mouseover",H=p.target||p.srcElement,X=!1;H;){if(O=this._targets[l(H)],O&&(w==="click"||w==="preclick")&&this._draggableMoved(O)){X=!0;break}if(O&&O.listens(w,!0)&&(R&&!PC(H,p)||(M.push(O),R))||H===this._container)break;H=H.parentNode}return!M.length&&!X&&!R&&this.listens(w,!0)&&(M=[this]),M},_isClickDisabled:function(p){for(;p&&p!==this._container;){if(p._leaflet_disable_click)return!0;p=p.parentNode}},_handleDOMEvent:function(p){var w=p.target||p.srcElement;if(!(!this._loaded||w._leaflet_disable_events||p.type==="click"&&this._isClickDisabled(w))){var M=p.type;M==="mousedown"&&wC(w),this._fireDOMEvent(p,M)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(p,w,M){if(p.type==="click"){var O=i({},p);O.type="preclick",this._fireDOMEvent(O,O.type,M)}var R=this._findEventTargets(p,w);if(M){for(var H=[],X=0;X0?Math.round(p-w)/2:Math.max(0,Math.ceil(p))-Math.max(0,Math.floor(w))},_limitZoom:function(p){var w=this.getMinZoom(),M=this.getMaxZoom(),O=Ue.any3d?this.options.zoomSnap:1;return O&&(p=Math.round(p/O)*O),Math.max(w,Math.min(M,p))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_r(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(p,w){var M=this._getCenterOffset(p)._trunc();return(w&&w.animate)!==!0&&!this.getSize().contains(M)?!1:(this.panBy(M,w),!0)},_createAnimProxy:function(){var p=this._proxy=Ct("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(p),this.on("zoomanim",function(w){var M=pC,O=this._proxy.style[M];Lu(this._proxy,this.project(w.center,w.zoom),this.getZoomScale(w.zoom,1)),O===this._proxy.style[M]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){nr(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var p=this.getCenter(),w=this.getZoom();Lu(this._proxy,this.project(p,w),this.getZoomScale(w,1))},_catchTransitionEnd:function(p){this._animatingZoom&&p.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(p,w,M){if(this._animatingZoom)return!0;if(M=M||{},!this._zoomAnimated||M.animate===!1||this._nothingToAnimate()||Math.abs(w-this._zoom)>this.options.zoomAnimationThreshold)return!1;var O=this.getZoomScale(w),R=this._getCenterOffset(p)._divideBy(1-1/O);return M.animate!==!0&&!this.getSize().contains(R)?!1:(E(function(){this._moveStart(!0,M.noMoveStart||!1)._animateZoom(p,w,!0)},this),!0)},_animateZoom:function(p,w,M,O){this._mapPane&&(M&&(this._animatingZoom=!0,this._animateToCenter=p,this._animateToZoom=w,ut(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:p,zoom:w,noUpdate:O}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_r(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Lae(p,w){return new wt(p,w)}var wa=z.extend({options:{position:"topright"},initialize:function(p){g(this,p)},getPosition:function(){return this.options.position},setPosition:function(p){var w=this._map;return w&&w.removeControl(this),this.options.position=p,w&&w.addControl(this),this},getContainer:function(){return this._container},addTo:function(p){this.remove(),this._map=p;var w=this._container=this.onAdd(p),M=this.getPosition(),O=p._controlCorners[M];return ut(w,"leaflet-control"),M.indexOf("bottom")!==-1?O.insertBefore(w,O.firstChild):O.appendChild(w),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(nr(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(p){this._map&&p&&p.screenX>0&&p.screenY>0&&this._map.getContainer().focus()}}),up=function(p){return new wa(p)};wt.include({addControl:function(p){return p.addTo(this),this},removeControl:function(p){return p.remove(),this},_initControlPos:function(){var p=this._controlCorners={},w="leaflet-",M=this._controlContainer=Ct("div",w+"control-container",this._container);function O(R,H){var X=w+R+" "+w+H;p[R+H]=Ct("div",X,M)}O("top","left"),O("top","right"),O("bottom","left"),O("bottom","right")},_clearControlPos:function(){for(var p in this._controlCorners)nr(this._controlCorners[p]);nr(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var x5=wa.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(p,w,M,O){return M1,this._baseLayersList.style.display=p?"":"none"),this._separator.style.display=w&&p?"":"none",this},_onLayerChange:function(p){this._handlingClick||this._update();var w=this._getLayer(l(p.target)),M=w.overlay?p.type==="add"?"overlayadd":"overlayremove":p.type==="add"?"baselayerchange":null;M&&this._map.fire(M,w)},_createRadioElement:function(p,w){var M='",O=document.createElement("div");return O.innerHTML=M,O.firstChild},_addItem:function(p){var w=document.createElement("label"),M=this._map.hasLayer(p.layer),O;p.overlay?(O=document.createElement("input"),O.type="checkbox",O.className="leaflet-control-layers-selector",O.defaultChecked=M):O=this._createRadioElement("leaflet-base-layers_"+l(this),M),this._layerControlInputs.push(O),O.layerId=l(p.layer),st(O,"click",this._onInputClick,this);var R=document.createElement("span");R.innerHTML=" "+p.name;var H=document.createElement("span");w.appendChild(H),H.appendChild(O),H.appendChild(R);var X=p.overlay?this._overlaysList:this._baseLayersList;return X.appendChild(w),this._checkDisabledLayers(),w},_onInputClick:function(){if(!this._preventClick){var p=this._layerControlInputs,w,M,O=[],R=[];this._handlingClick=!0;for(var H=p.length-1;H>=0;H--)w=p[H],M=this._getLayer(w.layerId).layer,w.checked?O.push(M):w.checked||R.push(M);for(H=0;H=0;R--)w=p[R],M=this._getLayer(w.layerId).layer,w.disabled=M.options.minZoom!==void 0&&OM.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var p=this._section;this._preventClick=!0,st(p,"click",ln),this.expand();var w=this;setTimeout(function(){Wt(p,"click",ln),w._preventClick=!1})}}),Iae=function(p,w,M){return new x5(p,w,M)},kC=wa.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(p){var w="leaflet-control-zoom",M=Ct("div",w+" leaflet-bar"),O=this.options;return this._zoomInButton=this._createButton(O.zoomInText,O.zoomInTitle,w+"-in",M,this._zoomIn),this._zoomOutButton=this._createButton(O.zoomOutText,O.zoomOutTitle,w+"-out",M,this._zoomOut),this._updateDisabled(),p.on("zoomend zoomlevelschange",this._updateDisabled,this),M},onRemove:function(p){p.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(p){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(p.shiftKey?3:1))},_createButton:function(p,w,M,O,R){var H=Ct("a",M,O);return H.innerHTML=p,H.href="#",H.title=w,H.setAttribute("role","button"),H.setAttribute("aria-label",w),lp(H),st(H,"click",Eu),st(H,"click",R,this),st(H,"click",this._refocusOnMap,this),H},_updateDisabled:function(){var p=this._map,w="leaflet-disabled";_r(this._zoomInButton,w),_r(this._zoomOutButton,w),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||p._zoom===p.getMinZoom())&&(ut(this._zoomOutButton,w),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||p._zoom===p.getMaxZoom())&&(ut(this._zoomInButton,w),this._zoomInButton.setAttribute("aria-disabled","true"))}});wt.mergeOptions({zoomControl:!0}),wt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new kC,this.addControl(this.zoomControl))});var Oae=function(p){return new kC(p)},_5=wa.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(p){var w="leaflet-control-scale",M=Ct("div",w),O=this.options;return this._addScales(O,w+"-line",M),p.on(O.updateWhenIdle?"moveend":"move",this._update,this),p.whenReady(this._update,this),M},onRemove:function(p){p.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(p,w,M){p.metric&&(this._mScale=Ct("div",w,M)),p.imperial&&(this._iScale=Ct("div",w,M))},_update:function(){var p=this._map,w=p.getSize().y/2,M=p.distance(p.containerPointToLatLng([0,w]),p.containerPointToLatLng([this.options.maxWidth,w]));this._updateScales(M)},_updateScales:function(p){this.options.metric&&p&&this._updateMetric(p),this.options.imperial&&p&&this._updateImperial(p)},_updateMetric:function(p){var w=this._getRoundNum(p),M=w<1e3?w+" m":w/1e3+" km";this._updateScale(this._mScale,M,w/p)},_updateImperial:function(p){var w=p*3.2808399,M,O,R;w>5280?(M=w/5280,O=this._getRoundNum(M),this._updateScale(this._iScale,O+" mi",O/M)):(R=this._getRoundNum(w),this._updateScale(this._iScale,R+" ft",R/w))},_updateScale:function(p,w,M){p.style.width=Math.round(this.options.maxWidth*M)+"px",p.innerHTML=w},_getRoundNum:function(p){var w=Math.pow(10,(Math.floor(p)+"").length-1),M=p/w;return M=M>=10?10:M>=5?5:M>=3?3:M>=2?2:1,w*M}}),Eae=function(p){return new _5(p)},Dae='',LC=wa.extend({options:{position:"bottomright",prefix:''+(Ue.inlineSvg?Dae+" ":"")+"Leaflet"},initialize:function(p){g(this,p),this._attributions={}},onAdd:function(p){p.attributionControl=this,this._container=Ct("div","leaflet-control-attribution"),lp(this._container);for(var w in p._layers)p._layers[w].getAttribution&&this.addAttribution(p._layers[w].getAttribution());return this._update(),p.on("layeradd",this._addAttribution,this),this._container},onRemove:function(p){p.off("layeradd",this._addAttribution,this)},_addAttribution:function(p){p.layer.getAttribution&&(this.addAttribution(p.layer.getAttribution()),p.layer.once("remove",function(){this.removeAttribution(p.layer.getAttribution())},this))},setPrefix:function(p){return this.options.prefix=p,this._update(),this},addAttribution:function(p){return p?(this._attributions[p]||(this._attributions[p]=0),this._attributions[p]++,this._update(),this):this},removeAttribution:function(p){return p?(this._attributions[p]&&(this._attributions[p]--,this._update()),this):this},_update:function(){if(this._map){var p=[];for(var w in this._attributions)this._attributions[w]&&p.push(w);var M=[];this.options.prefix&&M.push(this.options.prefix),p.length&&M.push(p.join(", ")),this._container.innerHTML=M.join(' ')}}});wt.mergeOptions({attributionControl:!0}),wt.addInitHook(function(){this.options.attributionControl&&new LC().addTo(this)});var Nae=function(p){return new LC(p)};wa.Layers=x5,wa.Zoom=kC,wa.Scale=_5,wa.Attribution=LC,up.layers=Iae,up.zoom=Oae,up.scale=Eae,up.attribution=Nae;var ro=z.extend({initialize:function(p){this._map=p},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});ro.addTo=function(p,w){return p.addHandler(w,this),this};var jae={Events:$},b5=Ue.touch?"touchstart mousedown":"mousedown",el=Z.extend({options:{clickTolerance:3},initialize:function(p,w,M,O){g(this,O),this._element=p,this._dragStartTarget=w||p,this._preventOutline=M},enable:function(){this._enabled||(st(this._dragStartTarget,b5,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(el._dragging===this&&this.finishDrag(!0),Wt(this._dragStartTarget,b5,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(p){if(this._enabled&&(this._moved=!1,!gC(this._element,"leaflet-zoom-anim"))){if(p.touches&&p.touches.length!==1){el._dragging===this&&this.finishDrag();return}if(!(el._dragging||p.shiftKey||p.which!==1&&p.button!==1&&!p.touches)&&(el._dragging=this,this._preventOutline&&wC(this._element),xC(),ap(),!this._moving)){this.fire("down");var w=p.touches?p.touches[0]:p,M=d5(this._element);this._startPoint=new j(w.clientX,w.clientY),this._startPos=Iu(this._element),this._parentScale=SC(M);var O=p.type==="mousedown";st(document,O?"mousemove":"touchmove",this._onMove,this),st(document,O?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(p){if(this._enabled){if(p.touches&&p.touches.length>1){this._moved=!0;return}var w=p.touches&&p.touches.length===1?p.touches[0]:p,M=new j(w.clientX,w.clientY)._subtract(this._startPoint);!M.x&&!M.y||Math.abs(M.x)+Math.abs(M.y)H&&(X=re,H=oe);H>M&&(w[X]=1,OC(p,w,M,O,X),OC(p,w,M,X,R))}function $ae(p,w){for(var M=[p[0]],O=1,R=0,H=p.length;Ow&&(M.push(p[O]),R=O);return Rw.max.x&&(M|=2),p.yw.max.y&&(M|=8),M}function Fae(p,w){var M=w.x-p.x,O=w.y-p.y;return M*M+O*O}function cp(p,w,M,O){var R=w.x,H=w.y,X=M.x-R,re=M.y-H,oe=X*X+re*re,de;return oe>0&&(de=((p.x-R)*X+(p.y-H)*re)/oe,de>1?(R=M.x,H=M.y):de>0&&(R+=X*de,H+=re*de)),X=p.x-R,re=p.y-H,O?X*X+re*re:new j(R,H)}function Bi(p){return!b(p[0])||typeof p[0][0]!="object"&&typeof p[0][0]<"u"}function P5(p){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Bi(p)}function k5(p,w){var M,O,R,H,X,re,oe,de;if(!p||p.length===0)throw new Error("latlngs not passed");Bi(p)||(console.warn("latlngs are not flat! Only the first ring will be used"),p=p[0]);var Ee=he([0,0]),Qe=ee(p),pt=Qe.getNorthWest().distanceTo(Qe.getSouthWest())*Qe.getNorthEast().distanceTo(Qe.getNorthWest());pt<1700&&(Ee=IC(p));var jn=p.length,qr=[];for(M=0;MO){oe=(H-O)/R,de=[re.x-oe*(re.x-X.x),re.y-oe*(re.y-X.y)];break}var Kn=w.unproject(G(de));return he([Kn.lat+Ee.lat,Kn.lng+Ee.lng])}var Vae={__proto__:null,simplify:T5,pointToSegmentDistance:C5,closestPointOnSegment:Bae,clipSegment:M5,_getEdgeIntersection:D0,_getBitCode:Du,_sqClosestPointOnSegment:cp,isFlat:Bi,_flat:P5,polylineCenter:k5},EC={project:function(p){return new j(p.lng,p.lat)},unproject:function(p){return new le(p.y,p.x)},bounds:new V([-180,-90],[180,90])},DC={R:6378137,R_MINOR:6356752314245179e-9,bounds:new V([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(p){var w=Math.PI/180,M=this.R,O=p.lat*w,R=this.R_MINOR/M,H=Math.sqrt(1-R*R),X=H*Math.sin(O),re=Math.tan(Math.PI/4-O/2)/Math.pow((1-X)/(1+X),H/2);return O=-M*Math.log(Math.max(re,1e-10)),new j(p.lng*w*M,O)},unproject:function(p){for(var w=180/Math.PI,M=this.R,O=this.R_MINOR/M,R=Math.sqrt(1-O*O),H=Math.exp(-p.y/M),X=Math.PI/2-2*Math.atan(H),re=0,oe=.1,de;re<15&&Math.abs(oe)>1e-7;re++)de=R*Math.sin(X),de=Math.pow((1-de)/(1+de),R/2),oe=Math.PI/2-2*Math.atan(H*de)-X,X+=oe;return new le(X*w,p.x*w/M)}},Gae={__proto__:null,LonLat:EC,Mercator:DC,SphericalMercator:fe},Wae=i({},ge,{code:"EPSG:3395",projection:DC,transformation:function(){var p=.5/(Math.PI*DC.R);return te(p,.5,-p,.5)}()}),L5=i({},ge,{code:"EPSG:4326",projection:EC,transformation:te(1/180,1,-1/180,.5)}),Hae=i({},Re,{projection:EC,transformation:te(1,0,-1,0),scale:function(p){return Math.pow(2,p)},zoom:function(p){return Math.log(p)/Math.LN2},distance:function(p,w){var M=w.lng-p.lng,O=w.lat-p.lat;return Math.sqrt(M*M+O*O)},infinite:!0});Re.Earth=ge,Re.EPSG3395=Wae,Re.EPSG3857=Ve,Re.EPSG900913=Se,Re.EPSG4326=L5,Re.Simple=Hae;var Sa=Z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(p){return p.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(p){return p&&p.removeLayer(this),this},getPane:function(p){return this._map.getPane(p?this.options[p]||p:this.options.pane)},addInteractiveTarget:function(p){return this._map._targets[l(p)]=this,this},removeInteractiveTarget:function(p){return delete this._map._targets[l(p)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(p){var w=p.target;if(w.hasLayer(this)){if(this._map=w,this._zoomAnimated=w._zoomAnimated,this.getEvents){var M=this.getEvents();w.on(M,this),this.once("remove",function(){w.off(M,this)},this)}this.onAdd(w),this.fire("add"),w.fire("layeradd",{layer:this})}}});wt.include({addLayer:function(p){if(!p._layerAdd)throw new Error("The provided object is not a Layer.");var w=l(p);return this._layers[w]?this:(this._layers[w]=p,p._mapToAdd=this,p.beforeAdd&&p.beforeAdd(this),this.whenReady(p._layerAdd,p),this)},removeLayer:function(p){var w=l(p);return this._layers[w]?(this._loaded&&p.onRemove(this),delete this._layers[w],this._loaded&&(this.fire("layerremove",{layer:p}),p.fire("remove")),p._map=p._mapToAdd=null,this):this},hasLayer:function(p){return l(p)in this._layers},eachLayer:function(p,w){for(var M in this._layers)p.call(w,this._layers[M]);return this},_addLayers:function(p){p=p?b(p)?p:[p]:[];for(var w=0,M=p.length;wthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&w[0]instanceof le&&w[0].equals(w[M-1])&&w.pop(),w},_setLatLngs:function(p){Ko.prototype._setLatLngs.call(this,p),Bi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Bi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var p=this._renderer._bounds,w=this.options.weight,M=new j(w,w);if(p=new V(p.min.subtract(M),p.max.add(M)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(p))){if(this.options.noClip){this._parts=this._rings;return}for(var O=0,R=this._rings.length,H;Op.y!=R.y>p.y&&p.x<(R.x-O.x)*(p.y-O.y)/(R.y-O.y)+O.x&&(w=!w);return w||Ko.prototype._containsPoint.call(this,p,!0)}});function Qae(p,w){return new Hf(p,w)}var Jo=qo.extend({initialize:function(p,w){g(this,w),this._layers={},p&&this.addData(p)},addData:function(p){var w=b(p)?p:p.features,M,O,R;if(w){for(M=0,O=w.length;M0&&R.push(R[0].slice()),R}function Uf(p,w){return p.feature?i({},p.feature,{geometry:w}):$0(w)}function $0(p){return p.type==="Feature"||p.type==="FeatureCollection"?p:{type:"Feature",properties:{},geometry:p}}var BC={toGeoJSON:function(p){return Uf(this,{type:"Point",coordinates:RC(this.getLatLng(),p)})}};N0.include(BC),NC.include(BC),j0.include(BC),Ko.include({toGeoJSON:function(p){var w=!Bi(this._latlngs),M=z0(this._latlngs,w?1:0,!1,p);return Uf(this,{type:(w?"Multi":"")+"LineString",coordinates:M})}}),Hf.include({toGeoJSON:function(p){var w=!Bi(this._latlngs),M=w&&!Bi(this._latlngs[0]),O=z0(this._latlngs,M?2:w?1:0,!0,p);return w||(O=[O]),Uf(this,{type:(M?"Multi":"")+"Polygon",coordinates:O})}}),Gf.include({toMultiPoint:function(p){var w=[];return this.eachLayer(function(M){w.push(M.toGeoJSON(p).geometry.coordinates)}),Uf(this,{type:"MultiPoint",coordinates:w})},toGeoJSON:function(p){var w=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(w==="MultiPoint")return this.toMultiPoint(p);var M=w==="GeometryCollection",O=[];return this.eachLayer(function(R){if(R.toGeoJSON){var H=R.toGeoJSON(p);if(M)O.push(H.geometry);else{var X=$0(H);X.type==="FeatureCollection"?O.push.apply(O,X.features):O.push(X)}}}),M?Uf(this,{geometries:O,type:"GeometryCollection"}):{type:"FeatureCollection",features:O}}});function E5(p,w){return new Jo(p,w)}var eoe=E5,F0=Sa.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(p,w,M){this._url=p,this._bounds=ee(w),g(this,M)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ut(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){nr(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(p){return this.options.opacity=p,this._image&&this._updateOpacity(),this},setStyle:function(p){return p.opacity&&this.setOpacity(p.opacity),this},bringToFront:function(){return this._map&&Ff(this._image),this},bringToBack:function(){return this._map&&Vf(this._image),this},setUrl:function(p){return this._url=p,this._image&&(this._image.src=p),this},setBounds:function(p){return this._bounds=ee(p),this._map&&this._reset(),this},getEvents:function(){var p={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(p.zoomanim=this._animateZoom),p},setZIndex:function(p){return this.options.zIndex=p,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var p=this._url.tagName==="IMG",w=this._image=p?this._url:Ct("img");if(ut(w,"leaflet-image-layer"),this._zoomAnimated&&ut(w,"leaflet-zoom-animated"),this.options.className&&ut(w,this.options.className),w.onselectstart=f,w.onmousemove=f,w.onload=o(this.fire,this,"load"),w.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(w.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),p){this._url=w.src;return}w.src=this._url,w.alt=this.options.alt},_animateZoom:function(p){var w=this._map.getZoomScale(p.zoom),M=this._map._latLngBoundsToNewLayerBounds(this._bounds,p.zoom,p.center).min;Lu(this._image,M,w)},_reset:function(){var p=this._image,w=new V(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),M=w.getSize();Ar(p,w.min),p.style.width=M.x+"px",p.style.height=M.y+"px"},_updateOpacity:function(){Ri(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var p=this.options.errorOverlayUrl;p&&this._url!==p&&(this._url=p,this._image.src=p)},getCenter:function(){return this._bounds.getCenter()}}),toe=function(p,w,M){return new F0(p,w,M)},D5=F0.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var p=this._url.tagName==="VIDEO",w=this._image=p?this._url:Ct("video");if(ut(w,"leaflet-image-layer"),this._zoomAnimated&&ut(w,"leaflet-zoom-animated"),this.options.className&&ut(w,this.options.className),w.onselectstart=f,w.onmousemove=f,w.onloadeddata=o(this.fire,this,"load"),p){for(var M=w.getElementsByTagName("source"),O=[],R=0;R0?O:[w.src];return}b(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(w.style,"objectFit")&&(w.style.objectFit="fill"),w.autoplay=!!this.options.autoplay,w.loop=!!this.options.loop,w.muted=!!this.options.muted,w.playsInline=!!this.options.playsInline;for(var H=0;HR?(w.height=R+"px",ut(p,H)):_r(p,H),this._containerWidth=this._container.offsetWidth},_animateZoom:function(p){var w=this._map._latLngToNewLayerPoint(this._latlng,p.zoom,p.center),M=this._getAnchor();Ar(this._container,w.add(M))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var p=this._map,w=parseInt(ip(this._container,"marginBottom"),10)||0,M=this._container.offsetHeight+w,O=this._containerWidth,R=new j(this._containerLeft,-M-this._containerBottom);R._add(Iu(this._container));var H=p.layerPointToContainerPoint(R),X=G(this.options.autoPanPadding),re=G(this.options.autoPanPaddingTopLeft||X),oe=G(this.options.autoPanPaddingBottomRight||X),de=p.getSize(),Ee=0,Qe=0;H.x+O+oe.x>de.x&&(Ee=H.x+O-de.x+oe.x),H.x-Ee-re.x<0&&(Ee=H.x-re.x),H.y+M+oe.y>de.y&&(Qe=H.y+M-de.y+oe.y),H.y-Qe-re.y<0&&(Qe=H.y-re.y),(Ee||Qe)&&(this.options.keepInView&&(this._autopanning=!0),p.fire("autopanstart").panBy([Ee,Qe]))}},_getAnchor:function(){return G(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),ioe=function(p,w){return new V0(p,w)};wt.mergeOptions({closePopupOnClick:!0}),wt.include({openPopup:function(p,w,M){return this._initOverlay(V0,p,w,M).openOn(this),this},closePopup:function(p){return p=arguments.length?p:this._popup,p&&p.close(),this}}),Sa.include({bindPopup:function(p,w){return this._popup=this._initOverlay(V0,this._popup,p,w),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(p){return this._popup&&(this instanceof qo||(this._popup._source=this),this._popup._prepareOpen(p||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(p){return this._popup&&this._popup.setContent(p),this},getPopup:function(){return this._popup},_openPopup:function(p){if(!(!this._popup||!this._map)){Eu(p);var w=p.layer||p.target;if(this._popup._source===w&&!(w instanceof tl)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(p.latlng);return}this._popup._source=w,this.openPopup(p.latlng)}},_movePopup:function(p){this._popup.setLatLng(p.latlng)},_onKeyPress:function(p){p.originalEvent.keyCode===13&&this._openPopup(p)}});var G0=no.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(p){no.prototype.onAdd.call(this,p),this.setOpacity(this.options.opacity),p.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(p){no.prototype.onRemove.call(this,p),p.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var p=no.prototype.getEvents.call(this);return this.options.permanent||(p.preclick=this.close),p},_initLayout:function(){var p="leaflet-tooltip",w=p+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Ct("div",w),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(p){var w,M,O=this._map,R=this._container,H=O.latLngToContainerPoint(O.getCenter()),X=O.layerPointToContainerPoint(p),re=this.options.direction,oe=R.offsetWidth,de=R.offsetHeight,Ee=G(this.options.offset),Qe=this._getAnchor();re==="top"?(w=oe/2,M=de):re==="bottom"?(w=oe/2,M=0):re==="center"?(w=oe/2,M=de/2):re==="right"?(w=0,M=de/2):re==="left"?(w=oe,M=de/2):X.xthis.options.maxZoom||MO?this._retainParent(R,H,X,O):!1)},_retainChildren:function(p,w,M,O){for(var R=2*p;R<2*p+2;R++)for(var H=2*w;H<2*w+2;H++){var X=new j(R,H);X.z=M+1;var re=this._tileCoordsToKey(X),oe=this._tiles[re];if(oe&&oe.active){oe.retain=!0;continue}else oe&&oe.loaded&&(oe.retain=!0);M+1this.options.maxZoom||this.options.minZoom!==void 0&&R1){this._setView(p,M);return}for(var Qe=R.min.y;Qe<=R.max.y;Qe++)for(var pt=R.min.x;pt<=R.max.x;pt++){var jn=new j(pt,Qe);if(jn.z=this._tileZoom,!!this._isValidTile(jn)){var qr=this._tiles[this._tileCoordsToKey(jn)];qr?qr.current=!0:X.push(jn)}}if(X.sort(function(Kn,Yf){return Kn.distanceTo(H)-Yf.distanceTo(H)}),X.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var zi=document.createDocumentFragment();for(pt=0;ptM.max.x)||!w.wrapLat&&(p.yM.max.y))return!1}if(!this.options.bounds)return!0;var O=this._tileCoordsToBounds(p);return ee(this.options.bounds).overlaps(O)},_keyToBounds:function(p){return this._tileCoordsToBounds(this._keyToTileCoords(p))},_tileCoordsToNwSe:function(p){var w=this._map,M=this.getTileSize(),O=p.scaleBy(M),R=O.add(M),H=w.unproject(O,p.z),X=w.unproject(R,p.z);return[H,X]},_tileCoordsToBounds:function(p){var w=this._tileCoordsToNwSe(p),M=new K(w[0],w[1]);return this.options.noWrap||(M=this._map.wrapLatLngBounds(M)),M},_tileCoordsToKey:function(p){return p.x+":"+p.y+":"+p.z},_keyToTileCoords:function(p){var w=p.split(":"),M=new j(+w[0],+w[1]);return M.z=+w[2],M},_removeTile:function(p){var w=this._tiles[p];w&&(nr(w.el),delete this._tiles[p],this.fire("tileunload",{tile:w.el,coords:this._keyToTileCoords(p)}))},_initTile:function(p){ut(p,"leaflet-tile");var w=this.getTileSize();p.style.width=w.x+"px",p.style.height=w.y+"px",p.onselectstart=f,p.onmousemove=f,Ue.ielt9&&this.options.opacity<1&&Ri(p,this.options.opacity)},_addTile:function(p,w){var M=this._getTilePos(p),O=this._tileCoordsToKey(p),R=this.createTile(this._wrapCoords(p),o(this._tileReady,this,p));this._initTile(R),this.createTile.length<2&&E(o(this._tileReady,this,p,null,R)),Ar(R,M),this._tiles[O]={el:R,coords:p,current:!0},w.appendChild(R),this.fire("tileloadstart",{tile:R,coords:p})},_tileReady:function(p,w,M){w&&this.fire("tileerror",{error:w,tile:M,coords:p});var O=this._tileCoordsToKey(p);M=this._tiles[O],M&&(M.loaded=+new Date,this._map._fadeAnimated?(Ri(M.el,0),D(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(M.active=!0,this._pruneTiles()),w||(ut(M.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:M.el,coords:p})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ue.ielt9||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(p){return p.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(p){var w=new j(this._wrapX?c(p.x,this._wrapX):p.x,this._wrapY?c(p.y,this._wrapY):p.y);return w.z=p.z,w},_pxBoundsToTileRange:function(p){var w=this.getTileSize();return new V(p.min.unscaleBy(w).floor(),p.max.unscaleBy(w).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var p in this._tiles)if(!this._tiles[p].loaded)return!1;return!0}});function soe(p){return new hp(p)}var Zf=hp.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(p,w){this._url=p,w=g(this,w),w.detectRetina&&Ue.retina&&w.maxZoom>0?(w.tileSize=Math.floor(w.tileSize/2),w.zoomReverse?(w.zoomOffset--,w.minZoom=Math.min(w.maxZoom,w.minZoom+1)):(w.zoomOffset++,w.maxZoom=Math.max(w.minZoom,w.maxZoom-1)),w.minZoom=Math.max(0,w.minZoom)):w.zoomReverse?w.minZoom=Math.min(w.maxZoom,w.minZoom):w.maxZoom=Math.max(w.minZoom,w.maxZoom),typeof w.subdomains=="string"&&(w.subdomains=w.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(p,w){return this._url===p&&w===void 0&&(w=!0),this._url=p,w||this.redraw(),this},createTile:function(p,w){var M=document.createElement("img");return st(M,"load",o(this._tileOnLoad,this,w,M)),st(M,"error",o(this._tileOnError,this,w,M)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(M.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(M.referrerPolicy=this.options.referrerPolicy),M.alt="",M.src=this.getTileUrl(p),M},getTileUrl:function(p){var w={r:Ue.retina?"@2x":"",s:this._getSubdomain(p),x:p.x,y:p.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var M=this._globalTileRange.max.y-p.y;this.options.tms&&(w.y=M),w["-y"]=M}return _(this._url,i(w,this.options))},_tileOnLoad:function(p,w){Ue.ielt9?setTimeout(o(p,this,null,w),0):p(null,w)},_tileOnError:function(p,w,M){var O=this.options.errorTileUrl;O&&w.getAttribute("src")!==O&&(w.src=O),p(M,w)},_onTileRemove:function(p){p.tile.onload=null},_getZoomForUrl:function(){var p=this._tileZoom,w=this.options.maxZoom,M=this.options.zoomReverse,O=this.options.zoomOffset;return M&&(p=w-p),p+O},_getSubdomain:function(p){var w=Math.abs(p.x+p.y)%this.options.subdomains.length;return this.options.subdomains[w]},_abortLoading:function(){var p,w;for(p in this._tiles)if(this._tiles[p].coords.z!==this._tileZoom&&(w=this._tiles[p].el,w.onload=f,w.onerror=f,!w.complete)){w.src=T;var M=this._tiles[p].coords;nr(w),delete this._tiles[p],this.fire("tileabort",{tile:w,coords:M})}},_removeTile:function(p){var w=this._tiles[p];if(w)return w.el.setAttribute("src",T),hp.prototype._removeTile.call(this,p)},_tileReady:function(p,w,M){if(!(!this._map||M&&M.getAttribute("src")===T))return hp.prototype._tileReady.call(this,p,w,M)}});function R5(p,w){return new Zf(p,w)}var B5=Zf.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(p,w){this._url=p;var M=i({},this.defaultWmsParams);for(var O in w)O in this.options||(M[O]=w[O]);w=g(this,w);var R=w.detectRetina&&Ue.retina?2:1,H=this.getTileSize();M.width=H.x*R,M.height=H.y*R,this.wmsParams=M},onAdd:function(p){this._crs=this.options.crs||p.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var w=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[w]=this._crs.code,Zf.prototype.onAdd.call(this,p)},getTileUrl:function(p){var w=this._tileCoordsToNwSe(p),M=this._crs,O=Y(M.project(w[0]),M.project(w[1])),R=O.min,H=O.max,X=(this._wmsVersion>=1.3&&this._crs===L5?[R.y,R.x,H.y,H.x]:[R.x,R.y,H.x,H.y]).join(","),re=Zf.prototype.getTileUrl.call(this,p);return re+m(this.wmsParams,re,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+X},setParams:function(p,w){return i(this.wmsParams,p),w||this.redraw(),this}});function loe(p,w){return new B5(p,w)}Zf.WMS=B5,R5.wms=loe;var Qo=Sa.extend({options:{padding:.1},initialize:function(p){g(this,p),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ut(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var p={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(p.zoomanim=this._onAnimZoom),p},_onAnimZoom:function(p){this._updateTransform(p.center,p.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(p,w){var M=this._map.getZoomScale(w,this._zoom),O=this._map.getSize().multiplyBy(.5+this.options.padding),R=this._map.project(this._center,w),H=O.multiplyBy(-M).add(R).subtract(this._map._getNewPixelOrigin(p,w));Ue.any3d?Lu(this._container,H,M):Ar(this._container,H)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var p in this._layers)this._layers[p]._reset()},_onZoomEnd:function(){for(var p in this._layers)this._layers[p]._project()},_updatePaths:function(){for(var p in this._layers)this._layers[p]._update()},_update:function(){var p=this.options.padding,w=this._map.getSize(),M=this._map.containerPointToLayerPoint(w.multiplyBy(-p)).round();this._bounds=new V(M,M.add(w.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),z5=Qo.extend({options:{tolerance:0},getEvents:function(){var p=Qo.prototype.getEvents.call(this);return p.viewprereset=this._onViewPreReset,p},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Qo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var p=this._container=document.createElement("canvas");st(p,"mousemove",this._onMouseMove,this),st(p,"click dblclick mousedown mouseup contextmenu",this._onClick,this),st(p,"mouseout",this._handleMouseOut,this),p._leaflet_disable_events=!0,this._ctx=p.getContext("2d")},_destroyContainer:function(){D(this._redrawRequest),delete this._ctx,nr(this._container),Wt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var p;this._redrawBounds=null;for(var w in this._layers)p=this._layers[w],p._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Qo.prototype._update.call(this);var p=this._bounds,w=this._container,M=p.getSize(),O=Ue.retina?2:1;Ar(w,p.min),w.width=O*M.x,w.height=O*M.y,w.style.width=M.x+"px",w.style.height=M.y+"px",Ue.retina&&this._ctx.scale(2,2),this._ctx.translate(-p.min.x,-p.min.y),this.fire("update")}},_reset:function(){Qo.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(p){this._updateDashArray(p),this._layers[l(p)]=p;var w=p._order={layer:p,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=w),this._drawLast=w,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(p){this._requestRedraw(p)},_removePath:function(p){var w=p._order,M=w.next,O=w.prev;M?M.prev=O:this._drawLast=O,O?O.next=M:this._drawFirst=M,delete p._order,delete this._layers[l(p)],this._requestRedraw(p)},_updatePath:function(p){this._extendRedrawBounds(p),p._project(),p._update(),this._requestRedraw(p)},_updateStyle:function(p){this._updateDashArray(p),this._requestRedraw(p)},_updateDashArray:function(p){if(typeof p.options.dashArray=="string"){var w=p.options.dashArray.split(/[, ]+/),M=[],O,R;for(R=0;R')}}catch{}return function(p){return document.createElement("<"+p+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),uoe={_initContainer:function(){this._container=Ct("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Qo.prototype._update.call(this),this.fire("update"))},_initPath:function(p){var w=p._container=dp("shape");ut(w,"leaflet-vml-shape "+(this.options.className||"")),w.coordsize="1 1",p._path=dp("path"),w.appendChild(p._path),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){var w=p._container;this._container.appendChild(w),p.options.interactive&&p.addInteractiveTarget(w)},_removePath:function(p){var w=p._container;nr(w),p.removeInteractiveTarget(w),delete this._layers[l(p)]},_updateStyle:function(p){var w=p._stroke,M=p._fill,O=p.options,R=p._container;R.stroked=!!O.stroke,R.filled=!!O.fill,O.stroke?(w||(w=p._stroke=dp("stroke")),R.appendChild(w),w.weight=O.weight+"px",w.color=O.color,w.opacity=O.opacity,O.dashArray?w.dashStyle=b(O.dashArray)?O.dashArray.join(" "):O.dashArray.replace(/( *, *)/g," "):w.dashStyle="",w.endcap=O.lineCap.replace("butt","flat"),w.joinstyle=O.lineJoin):w&&(R.removeChild(w),p._stroke=null),O.fill?(M||(M=p._fill=dp("fill")),R.appendChild(M),M.color=O.fillColor||O.color,M.opacity=O.fillOpacity):M&&(R.removeChild(M),p._fill=null)},_updateCircle:function(p){var w=p._point.round(),M=Math.round(p._radius),O=Math.round(p._radiusY||M);this._setPath(p,p._empty()?"M0 0":"AL "+w.x+","+w.y+" "+M+","+O+" 0,"+65535*360)},_setPath:function(p,w){p._path.v=w},_bringToFront:function(p){Ff(p._container)},_bringToBack:function(p){Vf(p._container)}},W0=Ue.vml?dp:Ge,vp=Qo.extend({_initContainer:function(){this._container=W0("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=W0("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){nr(this._container),Wt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Qo.prototype._update.call(this);var p=this._bounds,w=p.getSize(),M=this._container;(!this._svgSize||!this._svgSize.equals(w))&&(this._svgSize=w,M.setAttribute("width",w.x),M.setAttribute("height",w.y)),Ar(M,p.min),M.setAttribute("viewBox",[p.min.x,p.min.y,w.x,w.y].join(" ")),this.fire("update")}},_initPath:function(p){var w=p._path=W0("path");p.options.className&&ut(w,p.options.className),p.options.interactive&&ut(w,"leaflet-interactive"),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(p._path),p.addInteractiveTarget(p._path)},_removePath:function(p){nr(p._path),p.removeInteractiveTarget(p._path),delete this._layers[l(p)]},_updatePath:function(p){p._project(),p._update()},_updateStyle:function(p){var w=p._path,M=p.options;w&&(M.stroke?(w.setAttribute("stroke",M.color),w.setAttribute("stroke-opacity",M.opacity),w.setAttribute("stroke-width",M.weight),w.setAttribute("stroke-linecap",M.lineCap),w.setAttribute("stroke-linejoin",M.lineJoin),M.dashArray?w.setAttribute("stroke-dasharray",M.dashArray):w.removeAttribute("stroke-dasharray"),M.dashOffset?w.setAttribute("stroke-dashoffset",M.dashOffset):w.removeAttribute("stroke-dashoffset")):w.setAttribute("stroke","none"),M.fill?(w.setAttribute("fill",M.fillColor||M.color),w.setAttribute("fill-opacity",M.fillOpacity),w.setAttribute("fill-rule",M.fillRule||"evenodd")):w.setAttribute("fill","none"))},_updatePoly:function(p,w){this._setPath(p,Ye(p._parts,w))},_updateCircle:function(p){var w=p._point,M=Math.max(Math.round(p._radius),1),O=Math.max(Math.round(p._radiusY),1)||M,R="a"+M+","+O+" 0 1,0 ",H=p._empty()?"M0 0":"M"+(w.x-M)+","+w.y+R+M*2+",0 "+R+-M*2+",0 ";this._setPath(p,H)},_setPath:function(p,w){p._path.setAttribute("d",w)},_bringToFront:function(p){Ff(p._path)},_bringToBack:function(p){Vf(p._path)}});Ue.vml&&vp.include(uoe);function F5(p){return Ue.svg||Ue.vml?new vp(p):null}wt.include({getRenderer:function(p){var w=p.options.renderer||this._getPaneRenderer(p.options.pane)||this.options.renderer||this._renderer;return w||(w=this._renderer=this._createRenderer()),this.hasLayer(w)||this.addLayer(w),w},_getPaneRenderer:function(p){if(p==="overlayPane"||p===void 0)return!1;var w=this._paneRenderers[p];return w===void 0&&(w=this._createRenderer({pane:p}),this._paneRenderers[p]=w),w},_createRenderer:function(p){return this.options.preferCanvas&&$5(p)||F5(p)}});var V5=Hf.extend({initialize:function(p,w){Hf.prototype.initialize.call(this,this._boundsToLatLngs(p),w)},setBounds:function(p){return this.setLatLngs(this._boundsToLatLngs(p))},_boundsToLatLngs:function(p){return p=ee(p),[p.getSouthWest(),p.getNorthWest(),p.getNorthEast(),p.getSouthEast()]}});function coe(p,w){return new V5(p,w)}vp.create=W0,vp.pointsToPath=Ye,Jo.geometryToLayer=R0,Jo.coordsToLatLng=jC,Jo.coordsToLatLngs=B0,Jo.latLngToCoords=RC,Jo.latLngsToCoords=z0,Jo.getFeature=Uf,Jo.asFeature=$0,wt.mergeOptions({boxZoom:!0});var G5=ro.extend({initialize:function(p){this._map=p,this._container=p._container,this._pane=p._panes.overlayPane,this._resetStateTimeout=0,p.on("unload",this._destroy,this)},addHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Wt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){nr(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(p){if(!p.shiftKey||p.which!==1&&p.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ap(),xC(),this._startPoint=this._map.mouseEventToContainerPoint(p),st(document,{contextmenu:Eu,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(p){this._moved||(this._moved=!0,this._box=Ct("div","leaflet-zoom-box",this._container),ut(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(p);var w=new V(this._point,this._startPoint),M=w.getSize();Ar(this._box,w.min),this._box.style.width=M.x+"px",this._box.style.height=M.y+"px"},_finish:function(){this._moved&&(nr(this._box),_r(this._container,"leaflet-crosshair")),op(),_C(),Wt(document,{contextmenu:Eu,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(p){if(!(p.which!==1&&p.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var w=new K(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(w).fire("boxzoomend",{boxZoomBounds:w})}},_onKeyDown:function(p){p.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});wt.addInitHook("addHandler","boxZoom",G5),wt.mergeOptions({doubleClickZoom:!0});var W5=ro.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(p){var w=this._map,M=w.getZoom(),O=w.options.zoomDelta,R=p.originalEvent.shiftKey?M-O:M+O;w.options.doubleClickZoom==="center"?w.setZoom(R):w.setZoomAround(p.containerPoint,R)}});wt.addInitHook("addHandler","doubleClickZoom",W5),wt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var H5=ro.extend({addHooks:function(){if(!this._draggable){var p=this._map;this._draggable=new el(p._mapPane,p._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),p.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),p.on("zoomend",this._onZoomEnd,this),p.whenReady(this._onZoomEnd,this))}ut(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_r(this._map._container,"leaflet-grab"),_r(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var p=this._map;if(p._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var w=ee(this._map.options.maxBounds);this._offsetLimit=Y(this._map.latLngToContainerPoint(w.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(w.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;p.fire("movestart").fire("dragstart"),p.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(p){if(this._map.options.inertia){var w=this._lastTime=+new Date,M=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(M),this._times.push(w),this._prunePositions(w)}this._map.fire("move",p).fire("drag",p)},_prunePositions:function(p){for(;this._positions.length>1&&p-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var p=this._map.getSize().divideBy(2),w=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=w.subtract(p).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(p,w){return p-(p-w)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var p=this._draggable._newPos.subtract(this._draggable._startPos),w=this._offsetLimit;p.xw.max.x&&(p.x=this._viscousLimit(p.x,w.max.x)),p.y>w.max.y&&(p.y=this._viscousLimit(p.y,w.max.y)),this._draggable._newPos=this._draggable._startPos.add(p)}},_onPreDragWrap:function(){var p=this._worldWidth,w=Math.round(p/2),M=this._initialWorldOffset,O=this._draggable._newPos.x,R=(O-w+M)%p+w-M,H=(O+w+M)%p-w-M,X=Math.abs(R+M)0?H:-H))-w;this._delta=0,this._startTime=null,X&&(p.options.scrollWheelZoom==="center"?p.setZoom(w+X):p.setZoomAround(this._lastMousePos,w+X))}});wt.addInitHook("addHandler","scrollWheelZoom",Z5);var foe=600;wt.mergeOptions({tapHold:Ue.touchNative&&Ue.safari&&Ue.mobile,tapTolerance:15});var Y5=ro.extend({addHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Wt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(p){if(clearTimeout(this._holdTimeout),p.touches.length===1){var w=p.touches[0];this._startPos=this._newPos=new j(w.clientX,w.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(st(document,"touchend",ln),st(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",w))},this),foe),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function p(){Wt(document,"touchend",ln),Wt(document,"touchend touchcancel",p)},_cancel:function(){clearTimeout(this._holdTimeout),Wt(document,"touchend touchcancel contextmenu",this._cancel,this),Wt(document,"touchmove",this._onMove,this)},_onMove:function(p){var w=p.touches[0];this._newPos=new j(w.clientX,w.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(p,w){var M=new MouseEvent(p,{bubbles:!0,cancelable:!0,view:window,screenX:w.screenX,screenY:w.screenY,clientX:w.clientX,clientY:w.clientY});M._simulated=!0,w.target.dispatchEvent(M)}});wt.addInitHook("addHandler","tapHold",Y5),wt.mergeOptions({touchZoom:Ue.touch,bounceAtZoomLimits:!0});var X5=ro.extend({addHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){_r(this._map._container,"leaflet-touch-zoom"),Wt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(p){var w=this._map;if(!(!p.touches||p.touches.length!==2||w._animatingZoom||this._zooming)){var M=w.mouseEventToContainerPoint(p.touches[0]),O=w.mouseEventToContainerPoint(p.touches[1]);this._centerPoint=w.getSize()._divideBy(2),this._startLatLng=w.containerPointToLatLng(this._centerPoint),w.options.touchZoom!=="center"&&(this._pinchStartLatLng=w.containerPointToLatLng(M.add(O)._divideBy(2))),this._startDist=M.distanceTo(O),this._startZoom=w.getZoom(),this._moved=!1,this._zooming=!0,w._stop(),st(document,"touchmove",this._onTouchMove,this),st(document,"touchend touchcancel",this._onTouchEnd,this),ln(p)}},_onTouchMove:function(p){if(!(!p.touches||p.touches.length!==2||!this._zooming)){var w=this._map,M=w.mouseEventToContainerPoint(p.touches[0]),O=w.mouseEventToContainerPoint(p.touches[1]),R=M.distanceTo(O)/this._startDist;if(this._zoom=w.getScaleZoom(R,this._startZoom),!w.options.bounceAtZoomLimits&&(this._zoomw.getMaxZoom()&&R>1)&&(this._zoom=w._limitZoom(this._zoom)),w.options.touchZoom==="center"){if(this._center=this._startLatLng,R===1)return}else{var H=M._add(O)._divideBy(2)._subtract(this._centerPoint);if(R===1&&H.x===0&&H.y===0)return;this._center=w.unproject(w.project(this._pinchStartLatLng,this._zoom).subtract(H),this._zoom)}this._moved||(w._moveStart(!0,!1),this._moved=!0),D(this._animRequest);var X=o(w._move,w,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=E(X,this,!0),ln(p)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,D(this._animRequest),Wt(document,"touchmove",this._onTouchMove,this),Wt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});wt.addInitHook("addHandler","touchZoom",X5),wt.BoxZoom=G5,wt.DoubleClickZoom=W5,wt.Drag=H5,wt.Keyboard=U5,wt.ScrollWheelZoom=Z5,wt.TapHold=Y5,wt.TouchZoom=X5,r.Bounds=V,r.Browser=Ue,r.CRS=Re,r.Canvas=z5,r.Circle=NC,r.CircleMarker=j0,r.Class=z,r.Control=wa,r.DivIcon=j5,r.DivOverlay=no,r.DomEvent=kae,r.DomUtil=Mae,r.Draggable=el,r.Evented=Z,r.FeatureGroup=qo,r.GeoJSON=Jo,r.GridLayer=hp,r.Handler=ro,r.Icon=Wf,r.ImageOverlay=F0,r.LatLng=le,r.LatLngBounds=K,r.Layer=Sa,r.LayerGroup=Gf,r.LineUtil=Vae,r.Map=wt,r.Marker=N0,r.Mixin=jae,r.Path=tl,r.Point=j,r.PolyUtil=Rae,r.Polygon=Hf,r.Polyline=Ko,r.Popup=V0,r.PosAnimation=y5,r.Projection=Gae,r.Rectangle=V5,r.Renderer=Qo,r.SVG=vp,r.SVGOverlay=N5,r.TileLayer=Zf,r.Tooltip=G0,r.Transformation=ue,r.Util=N,r.VideoOverlay=D5,r.bind=o,r.bounds=Y,r.canvas=$5,r.circle=Kae,r.circleMarker=qae,r.control=up,r.divIcon=ooe,r.extend=i,r.featureGroup=Zae,r.geoJSON=E5,r.geoJson=eoe,r.gridLayer=soe,r.icon=Yae,r.imageOverlay=toe,r.latLng=he,r.latLngBounds=ee,r.layerGroup=Uae,r.map=Lae,r.marker=Xae,r.point=G,r.polygon=Qae,r.polyline=Jae,r.popup=ioe,r.rectangle=coe,r.setOptions=g,r.stamp=l,r.svg=F5,r.svgOverlay=noe,r.tileLayer=R5,r.tooltip=aoe,r.transformation=te,r.version=n,r.videoOverlay=roe;var hoe=window.L;r.noConflict=function(){return window.L=hoe,this},window.L=r})})(QO,QO.exports);var Bf=QO.exports;const Zie=$t(Bf);function C0(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function UR(e,t){return t==null?function(n,i){const a=W.useRef();return a.current||(a.current=e(n,i)),a}:function(n,i){const a=W.useRef();a.current||(a.current=e(n,i));const o=W.useRef(n),{instance:s}=a.current;return W.useEffect(function(){o.current!==n&&(t(s,n,o.current),o.current=n)},[s,n,i]),a}}function Yie(e,t){W.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var a;(a=t.layerContainer)==null||a.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function ZJe(e){return function(r){const n=uC(),i=e(cC(r,n),n);return Gie(n.map,r.attribution),HR(i.current,r.eventHandlers),Yie(i.current,n),i}}function YJe(e,t){const r=W.useRef();W.useEffect(function(){if(t.pathOptions!==r.current){const i=t.pathOptions??{};e.instance.setStyle(i),r.current=i}},[e,t])}function XJe(e){return function(r){const n=uC(),i=e(cC(r,n),n);return HR(i.current,r.eventHandlers),Yie(i.current,n),YJe(i.current,r),i}}function Xie(e,t){const r=UR(e),n=UJe(r,t);return WJe(n)}function qie(e,t){const r=UR(e,t),n=XJe(r);return GJe(n)}function qJe(e,t){const r=UR(e,t),n=ZJe(r);return HJe(n)}function KJe(e,t,r){const{opacity:n,zIndex:i}=t;n!=null&&n!==r.opacity&&e.setOpacity(n),i!=null&&i!==r.zIndex&&e.setZIndex(i)}function JJe(){return uC().map}const QJe=qie(function({center:t,children:r,...n},i){const a=new Bf.CircleMarker(t,n);return C0(a,Wie(i,{overlayContainer:a}))},$Je);function eE(){return eE=Object.assign||function(e){for(var t=1;t(d==null?void 0:d.map)??null,[d]);const g=W.useCallback(y=>{if(y!==null&&d===null){const _=new Bf.Map(y,c);r!=null&&u!=null?_.setView(r,u):e!=null&&_.fitBounds(e,t),l!=null&&_.whenReady(l),v(VJe(_))}},[]);W.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const m=d?Q.createElement(Uie,{value:d},n):o??null;return Q.createElement("div",eE({},h,{ref:g}),m)}const tQe=W.forwardRef(eQe),rQe=qie(function({positions:t,...r},n){const i=new Bf.Polyline(t,r);return C0(i,Wie(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),nQe=Xie(function(t,r){const n=new Bf.Popup(t,r.overlayContainer);return C0(n,r)},function(t,r,{position:n},i){W.useEffect(function(){const{instance:o}=t;function s(u){u.popup===o&&(o.update(),i(!0))}function l(u){u.popup===o&&i(!1)}return r.map.on({popupopen:s,popupclose:l}),r.overlayContainer==null?(n!=null&&o.setLatLng(n),o.openOn(r.map)):r.overlayContainer.bindPopup(o),function(){var c;r.map.off({popupopen:s,popupclose:l}),(c=r.overlayContainer)==null||c.unbindPopup(),r.map.removeLayer(o)}},[t,r,i,n])}),iQe=qJe(function({url:t,...r},n){const i=new Bf.TileLayer(t,cC(r,n));return C0(i,n)},function(t,r,n){KJe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),aQe=Xie(function(t,r){const n=new Bf.Tooltip(t,r.overlayContainer);return C0(n,r)},function(t,r,{position:n},i){W.useEffect(function(){const o=r.overlayContainer;if(o==null)return;const{instance:s}=t,l=c=>{c.tooltip===s&&(n!=null&&s.setLatLng(n),s.update(),i(!0))},u=c=>{c.tooltip===s&&i(!1)};return o.on({tooltipopen:l,tooltipclose:u}),o.bindTooltip(s),function(){o.off({tooltipopen:l,tooltipclose:u}),o._map!=null&&o.unbindTooltip()}},[t,r,i,n])}),oQe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",sQe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",lQe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete Zie.Icon.Default.prototype._getIconUrl;Zie.Icon.Default.mergeOptions({iconUrl:oQe,iconRetinaUrl:sQe,shadowUrl:lQe});const GU=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],uQe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function cQe(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function fQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function hQe(e){if(!e)return"Unknown";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function dQe({bounds:e}){const t=JJe();return W.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function vQe({node:e}){const t=e.latitude!==null&&e.longitude!==null,r=e.battery_level!==null?e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`:"Unknown";return x.jsxs("div",{className:"min-w-[200px]",children:[x.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),x.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),x.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[x.jsx("div",{className:"text-slate-500",children:"Role"}),x.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),x.jsx("div",{className:"text-slate-500",children:"Hardware"}),x.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),x.jsx("div",{className:"text-slate-500",children:"Battery"}),x.jsx("div",{className:"text-slate-700",children:r}),x.jsx("div",{className:"text-slate-500",children:"Last Heard"}),x.jsx("div",{className:"text-slate-700",children:hQe(e.last_heard)})]}),t&&x.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[x.jsxs("a",{href:`https://www.google.com/maps?q=${e.latitude},${e.longitude}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800",children:[x.jsx(Cd,{size:10}),"Google Maps"]}),x.jsxs("a",{href:`https://www.openstreetmap.org/?mlat=${e.latitude}&mlon=${e.longitude}&zoom=14`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800",children:[x.jsx(Cd,{size:10}),"OSM"]})]})]})}function pQe({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=W.useMemo(()=>e.filter(f=>f.latitude!==null&&f.longitude!==null),[e]),a=e.length-i.length,o=W.useMemo(()=>new Map(i.map(f=>[f.node_num,f])),[i]),s=W.useMemo(()=>t.filter(f=>o.has(f.from_node)&&o.has(f.to_node)),[t,o]),l=W.useMemo(()=>{if(i.length===0)return null;const f=i.map(d=>d.latitude),h=i.map(d=>d.longitude);return[[Math.min(...f),Math.min(...h)],[Math.max(...f),Math.max(...h)]]},[i]),u=[43.6,-114.4],c=W.useMemo(()=>{const f=new Set;return r!==null&&t.forEach(h=>{h.from_node===r&&f.add(h.to_node),h.to_node===r&&f.add(h.from_node)}),f},[r,t]);return x.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[x.jsxs(tQe,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[x.jsx(iQe,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© OpenStreetMap, © CARTO'}),x.jsx(dQe,{bounds:l}),s.map((f,h)=>{const d=o.get(f.from_node),v=o.get(f.to_node),g=r===null||f.from_node===r||f.to_node===r;return x.jsx(rQe,{positions:[[d.latitude,d.longitude],[v.latitude,v.longitude]],color:cQe(f.snr),weight:g&&r!==null?2.5:1.5,opacity:r===null?.3:g?.6:.08},h)}),i.map(f=>{const h=f.node_num===r,d=c.has(f.node_num),v=r===null||h||d,g=uQe.includes(f.role),m=fQe(f.latitude),y=GU[m%GU.length];return x.jsxs(QJe,{center:[f.latitude,f.longitude],radius:g?8:5,fillColor:g?y:"#111827",fillOpacity:v?.9:.2,stroke:!0,color:h?"#ffffff":y,weight:h?3:g?0:2,opacity:v?1:.3,eventHandlers:{click:()=>n(h?null:f.node_num)},children:[x.jsx(aQe,{direction:"top",offset:[0,-8],children:x.jsx("span",{className:"font-mono text-xs",children:f.short_name})}),x.jsx(nQe,{children:x.jsx(vQe,{node:f})})]},f.node_num)})]}),x.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded px-3 py-2 text-xs text-slate-400 flex items-center gap-2",children:[x.jsx(PS,{size:12}),x.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&x.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const WU=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],gQe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function HU(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function mQe(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function yQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function xQe(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function _Qe(e){if(!e)return"Unknown";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function bQe(e){if(!e)return"bg-slate-500";const t=new Date(e),n=(new Date().getTime()-t.getTime())/36e5;return n<1?"bg-green-500":n<24?"bg-amber-500":"bg-slate-500"}function wQe({node:e,edges:t,nodes:r,onSelectNode:n}){const i=W.useMemo(()=>{if(!e)return[];const f=new Map(r.map(d=>[d.node_num,d])),h=[];return t.forEach(d=>{if(d.from_node===e.node_num){const v=f.get(d.to_node);v&&h.push({node:v,snr:d.snr,quality:d.quality})}else if(d.to_node===e.node_num){const v=f.get(d.from_node);v&&h.push({node:v,snr:d.snr,quality:d.quality})}}),h.sort((d,v)=>v.snr-d.snr)},[e,t,r]);if(!e)return x.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border p-4 flex flex-col items-center justify-center h-[540px]",children:[x.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:x.jsx(Za,{size:24,className:"text-slate-500"})}),x.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=gQe.includes(e.role),o=yQe(e.latitude),s=WU[o%WU.length],l=e.latitude!==null&&e.longitude!==null,u=e.battery_level!==null?e.battery_level>100||e.voltage&&e.voltage>4.1?"USB":`${e.battery_level.toFixed(0)}%`:"—",c=e.battery_level!==null&&(e.battery_level>100||e.voltage&&e.voltage>4.1);return x.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[x.jsxs("div",{className:"p-4 border-b border-border",children:[x.jsx("div",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-mono mb-2",style:{backgroundColor:`${s}20`,color:s},children:e.node_id_hex}),x.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),x.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),x.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[x.jsxs("div",{children:[x.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),x.jsx("div",{className:`text-sm font-medium ${a?"text-cyan-400":"text-slate-300"}`,children:e.role})]}),x.jsxs("div",{children:[x.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),x.jsx("div",{className:"text-sm text-slate-300",children:xQe(o)})]}),x.jsxs("div",{children:[x.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),x.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&x.jsx(Pm,{size:12,className:"text-amber-400"}),u]})]}),x.jsxs("div",{children:[x.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("div",{className:`w-2 h-2 rounded-full ${bQe(e.last_heard)}`}),x.jsx("span",{className:"text-sm text-slate-300",children:_Qe(e.last_heard)})]})]}),x.jsxs("div",{className:"col-span-2",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),x.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&x.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[x.jsxs("a",{href:`https://www.google.com/maps?q=${e.latitude},${e.longitude}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300",children:[x.jsx(Cd,{size:10}),"Google Maps"]}),x.jsxs("a",{href:`https://www.openstreetmap.org/?mlat=${e.latitude}&mlon=${e.longitude}&zoom=14`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300",children:[x.jsx(Cd,{size:10}),"OSM"]})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto",children:[x.jsxs("div",{className:"px-4 py-2 text-xs text-slate-500 font-medium sticky top-0 bg-bg-card border-b border-border",children:["Neighbors (",i.length,")"]}),i.length>0?x.jsx("div",{className:"divide-y divide-border",children:i.map(f=>x.jsxs("button",{onClick:()=>n(f.node.node_num),className:"w-full px-4 py-2 text-left hover:bg-bg-hover transition-colors flex items-center gap-2",style:{borderLeftWidth:3,borderLeftColor:HU(f.snr)},children:[x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:f.node.short_name}),x.jsx("div",{className:"text-xs text-slate-500 truncate",children:f.node.long_name})]}),x.jsxs("div",{className:"text-right flex-shrink-0",children:[x.jsxs("div",{className:"text-xs font-mono",style:{color:HU(f.snr)},children:[f.snr.toFixed(1)," dB"]}),x.jsx("div",{className:"text-xs text-slate-500",children:mQe(f.snr)})]})]},f.node.node_num))}):x.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const UU=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function SQe(e){if(!e)return"bg-slate-500";const t=new Date(e),n=(new Date().getTime()-t.getTime())/36e5;return n<1?"bg-green-500":n<24?"bg-amber-500":"bg-slate-500"}function TQe(e){if(!e)return"—";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function CQe(e){return e.battery_level===null?"—":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`}function ZU(e){return e===null?"—":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function AQe({nodes:e,selectedNodeId:t,onSelectNode:r}){const[n,i]=W.useState(""),[a,o]=W.useState("short_name"),[s,l]=W.useState("asc"),[u,c]=W.useState("all"),f=W.useMemo(()=>{let v=[...e];if(u==="infra"?v=v.filter(g=>UU.includes(g.role)):u==="online"&&(v=v.filter(g=>{if(!g.last_heard)return!1;const m=new Date(g.last_heard);return(new Date().getTime()-m.getTime())/36e5<1})),n){const g=n.toLowerCase();v=v.filter(m=>m.short_name.toLowerCase().includes(g)||m.long_name.toLowerCase().includes(g)||m.role.toLowerCase().includes(g)||ZU(m.latitude).toLowerCase().includes(g))}return v.sort((g,m)=>{let y="",_="";switch(a){case"short_name":y=g.short_name.toLowerCase(),_=m.short_name.toLowerCase();break;case"role":y=g.role,_=m.role;break;case"battery_level":y=g.battery_level??-1,_=m.battery_level??-1;break;case"last_heard":y=g.last_heard?new Date(g.last_heard).getTime():0,_=m.last_heard?new Date(m.last_heard).getTime():0;break;case"hardware":y=g.hardware.toLowerCase(),_=m.hardware.toLowerCase();break}return y<_?s==="asc"?-1:1:y>_?s==="asc"?1:-1:0}),v},[e,n,a,s,u]),h=v=>{a===v?l(s==="asc"?"desc":"asc"):(o(v),l("asc"))},d=({field:v})=>a!==v?null:s==="asc"?x.jsx(ace,{size:14,className:"inline ml-1"}):x.jsx(yu,{size:14,className:"inline ml-1"});return x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg overflow-hidden",children:[x.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[x.jsxs("div",{className:"relative flex-1 max-w-xs",children:[x.jsx(rD,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),x.jsx("input",{type:"text",placeholder:"Search nodes...",value:n,onChange:v=>i(v.target.value),className:"w-full pl-9 pr-3 py-1.5 bg-bg-hover border border-border rounded text-sm text-slate-200 placeholder-slate-500 focus:outline-none focus:border-accent"})]}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(eD,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(v=>x.jsx("button",{onClick:()=>c(v),className:`px-2 py-1 text-xs rounded transition-colors ${u===v?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:v==="all"?"All":v==="infra"?"Infra":"Online"},v))]}),x.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[f.length," of ",e.length," nodes"]})]}),x.jsxs("div",{className:"overflow-x-auto",children:[x.jsxs("table",{className:"w-full text-sm",children:[x.jsx("thead",{children:x.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[x.jsx("th",{className:"w-8 px-3 py-2"}),x.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("short_name"),children:["Name ",x.jsx(d,{field:"short_name"})]}),x.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("role"),children:["Role ",x.jsx(d,{field:"role"})]}),x.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),x.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("battery_level"),children:["Battery ",x.jsx(d,{field:"battery_level"})]}),x.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("last_heard"),children:["Last Heard ",x.jsx(d,{field:"last_heard"})]}),x.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("hardware"),children:["Hardware ",x.jsx(d,{field:"hardware"})]})]})}),x.jsx("tbody",{className:"divide-y divide-border",children:f.slice(0,100).map(v=>{const g=UU.includes(v.role),m=v.node_num===t;return x.jsxs("tr",{onClick:()=>r(v.node_num),className:`cursor-pointer transition-colors ${m?"bg-accent/10":"hover:bg-bg-hover"}`,children:[x.jsx("td",{className:"px-3 py-2",children:x.jsx("div",{className:`w-2 h-2 rounded-full ${SQe(v.last_heard)}`})}),x.jsxs("td",{className:"px-3 py-2",children:[x.jsx("div",{className:"font-mono text-slate-200",children:v.short_name}),x.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:v.long_name})]}),x.jsx("td",{className:"px-3 py-2",children:x.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs font-medium ${g?"bg-cyan-500/20 text-cyan-400":"bg-slate-500/20 text-slate-400"}`,children:v.role})}),x.jsx("td",{className:"px-3 py-2 text-slate-400",children:ZU(v.latitude)}),x.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:CQe(v)}),x.jsx("td",{className:"px-3 py-2 text-slate-400",children:TQe(v.last_heard)}),x.jsx("td",{className:"px-3 py-2 font-mono text-xs text-slate-400 truncate max-w-[150px]",children:v.hardware||"—"})]},v.node_num)})})]}),f.length>100&&x.jsxs("div",{className:"px-3 py-2 text-xs text-slate-500 text-center border-t border-border",children:["Showing first 100 of ",f.length," nodes"]}),f.length===0&&x.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function MQe(){const[e,t]=W.useState([]),[r,n]=W.useState([]),[i,a]=W.useState([]),[o,s]=W.useState(null),[l,u]=W.useState("topo"),[c,f]=W.useState(!0),[h,d]=W.useState(null);W.useEffect(()=>{document.title="Mesh — MeshAI",Promise.all([yce(),xce(),Tce()]).then(([m,y,_])=>{t(m),n(y),a(_),f(!1)}).catch(m=>{d(m.message),f(!1)})},[]);const v=W.useMemo(()=>e.find(m=>m.node_num===o)||null,[e,o]),g=W.useCallback(m=>{s(m)},[]);return c?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):h?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsxs("div",{className:"text-red-400",children:["Error: ",h]})}):x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes • ",r.length," edges"]}),x.jsxs("div",{className:"flex items-center bg-bg-card border border-border rounded-lg p-1",children:[x.jsxs("button",{onClick:()=>u("topo"),className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${l==="topo"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:[x.jsx(vce,{size:14}),"Topology"]}),x.jsxs("button",{onClick:()=>u("geo"),className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${l==="geo"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:[x.jsx(hce,{size:14}),"Geographic"]})]})]}),x.jsxs("div",{className:"flex gap-0",children:[x.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?x.jsx(zJe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:g}):x.jsx(pQe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:g})}),x.jsx(wQe,{node:v,edges:r,nodes:e,onSelectNode:g})]}),x.jsx(AQe,{nodes:e,selectedNodeId:o,onSelectNode:g})]})}function ZR({label:e,value:t,onChange:r,helper:n,info:i,roleFilter:a,valueType:o="short_name"}){const[s,l]=W.useState([]),[u,c]=W.useState(!0),[f,h]=W.useState(""),[d,v]=W.useState(!1);W.useEffect(()=>{fetch("/api/nodes").then(S=>S.json()).then(S=>{l(S),c(!1)}).catch(()=>{l([]),c(!1)})},[]);const g=W.useMemo(()=>{let S=s;if(a&&(S=S.filter(T=>a==="ROUTER"||a==="infrastructure"?T.is_infrastructure||T.role==="ROUTER"||T.role==="ROUTER_CLIENT"||T.role==="REPEATER":T.role===a)),f.trim()){const T=f.toLowerCase();S=S.filter(C=>{var A,P,I,k;return((A=C.short_name)==null?void 0:A.toLowerCase().includes(T))||((P=C.long_name)==null?void 0:P.toLowerCase().includes(T))||((I=C.role)==null?void 0:I.toLowerCase().includes(T))||((k=C.node_id_hex)==null?void 0:k.toLowerCase().includes(T))})}return S.sort((T,C)=>(T.short_name||"").localeCompare(C.short_name||""))},[s,f,a]),m=S=>{switch(o){case"node_num":return String(S.node_num);case"node_id_hex":return S.node_id_hex;default:return S.short_name||String(S.node_num)}},y=S=>{const T=m(S);return t.includes(T)},_=S=>{const T=m(S);t.includes(T)?r(t.filter(C=>C!==T)):r([...t,T])},b=S=>{const T=[S.short_name];return S.long_name&&S.long_name!==S.short_name&&T.push(`— ${S.long_name}`),S.role&&T.push(`(${S.role})`),T.join(" ")};return!u&&s.length===0?x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),x.jsx("input",{type:"text",value:t.join(", "),onChange:S=>r(S.target.value.split(",").map(T=>T.trim()).filter(Boolean)),placeholder:"Enter node IDs separated by commas",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),n&&x.jsx("p",{className:"text-xs text-slate-600",children:n})]}):x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&x.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(C=>m(C)===S);return x.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-accent/20 text-accent rounded text-sm",children:[T?T.short_name:S,x.jsx("button",{type:"button",onClick:()=>r(t.filter(C=>C!==S)),className:"hover:text-white",children:x.jsx(lu,{size:14})})]},S)})}),x.jsxs("div",{className:"relative",children:[x.jsxs("div",{className:"relative",children:[x.jsx(rD,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),x.jsx("input",{type:"text",value:f,onChange:S=>h(S.target.value),onFocus:()=>v(!0),placeholder:u?"Loading nodes...":"Search nodes...",className:"w-full pl-9 pr-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent"})]}),d&&!u&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>v(!1)}),x.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 max-h-64 overflow-y-auto bg-[#0a0e17] border border-[#1e2a3a] rounded-lg shadow-xl",children:g.length===0?x.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):g.map(S=>x.jsxs("button",{type:"button",onClick:()=>_(S),className:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[#1e2a3a] ${y(S)?"bg-accent/10":""}`,children:[x.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${y(S)?"bg-accent border-accent":"border-slate-600"}`,children:y(S)&&x.jsx(nu,{size:12,className:"text-white"})}),x.jsx("span",{className:"text-slate-200",children:b(S)})]},S.node_num))})]})]}),n&&x.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function YR(e){const[t,r]=W.useState([]),[n,i]=W.useState(!0);W.useEffect(()=>{fetch("/api/channels").then(h=>h.json()).then(h=>{r(h),i(!1)}).catch(()=>{r([]),i(!1)})},[]);const a=h=>{const d=h.role==="PRIMARY"?"Primary":h.role==="SECONDARY"?"Secondary":"";return`${h.index}: ${h.name}${d?` (${d})`:""}`};if(!n&&t.length===0)return e.mode==="single"?x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),x.jsx("input",{type:"number",value:e.value,onChange:h=>e.onChange(Number(h.target.value)),min:e.includeDisabled?-1:0,max:7,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),e.helper&&x.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),x.jsx("input",{type:"text",value:e.value.join(", "),onChange:h=>{const d=h.target.value.split(",").map(v=>parseInt(v.trim())).filter(v=>!isNaN(v));e.onChange(d)},placeholder:"Enter channel numbers separated by commas",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),e.helper&&x.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]});if(e.mode==="single"){const{value:h,onChange:d,label:v,helper:g,includeDisabled:m}=e,y=t.filter(_=>_.enabled);return x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:v}),x.jsxs("select",{value:h,onChange:_=>d(Number(_.target.value)),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:[m&&x.jsx("option",{value:-1,children:"Disabled"}),y.map(_=>x.jsx("option",{value:_.index,children:a(_)},_.index))]}),g&&x.jsx("p",{className:"text-xs text-slate-600",children:g})]})}const{value:o,onChange:s,label:l,helper:u}=e,c=t.filter(h=>h.enabled),f=h=>{o.includes(h)?s(o.filter(d=>d!==h)):s([...o,h].sort((d,v)=>d-v))};return x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),x.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:[c.map(h=>x.jsxs("label",{onClick:()=>f(h.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[x.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${o.includes(h.index)?"bg-accent border-accent":"border-slate-600"}`,children:o.includes(h.index)&&x.jsx(nu,{size:12,className:"text-white"})}),x.jsx("span",{className:"text-sm text-slate-200",children:a(h)})]},h.index)),c.length===0&&x.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&x.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const YU=[{key:"bot",label:"Bot",icon:tce},{key:"connection",label:"Connection",icon:ES},{key:"response",label:"Response",icon:EZ},{key:"history",label:"History",icon:uce},{key:"memory",label:"Memory",icon:rce},{key:"context",label:"Context",icon:QE},{key:"commands",label:"Commands",icon:RZ},{key:"llm",label:"LLM",icon:MZ},{key:"weather",label:"Weather",icon:ou},{key:"meshmonitor",label:"MeshMonitor",icon:Za},{key:"knowledge",label:"Knowledge",icon:CZ},{key:"mesh_sources",label:"Mesh Sources",icon:LZ},{key:"mesh_intelligence",label:"Intelligence",icon:yv},{key:"dashboard",label:"Dashboard",icon:IZ}],fi={bot:"Identity and behavior settings for the bot on the mesh network.",connection:"How MeshAI connects to your Meshtastic radio.",response:"Controls how quickly and how much the bot responds on the mesh.",history:"Conversation history storage and cleanup.",memory:"Short-term conversation memory management. Controls how the bot maintains context within a conversation.",context:"Passive channel monitoring. The bot listens to mesh channels and uses recent messages as context when responding.",commands:"Mesh commands available via the configured prefix. Toggle individual commands on or off.",llm:"AI model configuration. MeshAI uses an LLM to understand questions and generate responses.",weather:"Weather data for the !weather command. This is separate from NWS environmental alerts.",meshmonitor:"AIDA MeshMonitor integration. An additional data source for mesh network monitoring.",knowledge:"Knowledge base for answering questions from stored documents. Connects to Qdrant vector database or local SQLite.",mesh_sources:"Data sources for mesh network information. MeshAI can pull data from multiple sources simultaneously and merge them into a unified view.",mesh_intelligence:"Advanced mesh analysis: health scoring, region management, and automated alerting. The intelligence engine monitors your mesh and detects problems automatically.",dashboard:"Web dashboard settings. You're looking at it right now."},PQe=[{name:"help",description:"Show available commands and usage"},{name:"health",description:"Mesh network health overview with status dots"},{name:"status",description:"Quick mesh status summary"},{name:"region",description:"List regions or get detailed region breakdown"},{name:"neighbors",description:"Show top infrastructure neighbors with signal quality"},{name:"ping",description:"Test bot responsiveness"},{name:"clear",description:"Clear your conversation history"},{name:"reset",description:"Reset conversation context"},{name:"sub",description:"Subscribe to scheduled reports or alerts"},{name:"unsub",description:"Remove a subscription"},{name:"mysubs",description:"List your active subscriptions"},{name:"alerts",description:"Active NWS weather alerts for mesh area"},{name:"solar",description:"Space weather and HF propagation conditions"},{name:"hf",description:"HF radio propagation (alias for !solar)"},{name:"fire",description:"Active wildfires near the mesh"},{name:"avy",description:"Avalanche advisories for configured zones"},{name:"hotspots",description:"NASA FIRMS satellite fire detections"},{name:"streams",description:"USGS stream gauge readings"},{name:"roads",description:"Road conditions and closures"},{name:"traffic",description:"Traffic flow on monitored corridors"}],kQe=[{value:"US-AL",label:"Alabama"},{value:"US-AK",label:"Alaska"},{value:"US-AZ",label:"Arizona"},{value:"US-AR",label:"Arkansas"},{value:"US-CA",label:"California"},{value:"US-CO",label:"Colorado"},{value:"US-CT",label:"Connecticut"},{value:"US-DE",label:"Delaware"},{value:"US-FL",label:"Florida"},{value:"US-GA",label:"Georgia"},{value:"US-HI",label:"Hawaii"},{value:"US-ID",label:"Idaho"},{value:"US-IL",label:"Illinois"},{value:"US-IN",label:"Indiana"},{value:"US-IA",label:"Iowa"},{value:"US-KS",label:"Kansas"},{value:"US-KY",label:"Kentucky"},{value:"US-LA",label:"Louisiana"},{value:"US-ME",label:"Maine"},{value:"US-MD",label:"Maryland"},{value:"US-MA",label:"Massachusetts"},{value:"US-MI",label:"Michigan"},{value:"US-MN",label:"Minnesota"},{value:"US-MS",label:"Mississippi"},{value:"US-MO",label:"Missouri"},{value:"US-MT",label:"Montana"},{value:"US-NE",label:"Nebraska"},{value:"US-NV",label:"Nevada"},{value:"US-NH",label:"New Hampshire"},{value:"US-NJ",label:"New Jersey"},{value:"US-NM",label:"New Mexico"},{value:"US-NY",label:"New York"},{value:"US-NC",label:"North Carolina"},{value:"US-ND",label:"North Dakota"},{value:"US-OH",label:"Ohio"},{value:"US-OK",label:"Oklahoma"},{value:"US-OR",label:"Oregon"},{value:"US-PA",label:"Pennsylvania"},{value:"US-RI",label:"Rhode Island"},{value:"US-SC",label:"South Carolina"},{value:"US-SD",label:"South Dakota"},{value:"US-TN",label:"Tennessee"},{value:"US-TX",label:"Texas"},{value:"US-UT",label:"Utah"},{value:"US-VT",label:"Vermont"},{value:"US-VA",label:"Virginia"},{value:"US-WA",label:"Washington"},{value:"US-WV",label:"West Virginia"},{value:"US-WI",label:"Wisconsin"},{value:"US-WY",label:"Wyoming"}];function Ho({info:e,link:t,linkText:r="Learn more"}){const[n,i]=W.useState(!1),a=W.useRef(null);return W.useEffect(()=>{if(!n)return;function o(l){a.current&&!a.current.contains(l.target)&&i(!1)}const s=setTimeout(()=>document.addEventListener("mousedown",o),0);return()=>{clearTimeout(s),document.removeEventListener("mousedown",o)}},[n]),x.jsxs("div",{className:"relative inline-block",ref:a,children:[x.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),i(!n)},className:"ml-1.5 w-4 h-4 rounded-full bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-slate-200 inline-flex items-center justify-center text-xs transition-colors",title:"More info",children:"?"}),n&&x.jsxs("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl text-xs text-slate-300 leading-relaxed",children:[x.jsx("button",{type:"button",onClick:()=>i(!1),className:"absolute top-1 right-1 w-5 h-5 rounded hover:bg-slate-700 text-slate-500 hover:text-slate-300 inline-flex items-center justify-center transition-colors","aria-label":"Close",children:x.jsx(lu,{size:12})}),x.jsx("div",{className:"pr-4",children:e}),t&&x.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"mt-2 flex items-center gap-1 text-accent hover:underline",onClick:o=>o.stopPropagation(),children:[r," ",x.jsx(Cd,{size:10})]})]})]})}function hi({text:e}){return x.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function xt({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o="",infoLink:s=""}){const[l,u]=W.useState(!1),c=n==="password";return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&x.jsx(Ho,{info:o,link:s})]}),x.jsxs("div",{className:"relative",children:[x.jsx("input",{type:c&&!l?"password":"text",value:t,onChange:f=>r(f.target.value),placeholder:i,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),c&&x.jsx("button",{type:"button",onClick:()=>u(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:l?x.jsx(kZ,{size:16}):x.jsx(QE,{size:16})})]}),a&&x.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function rt({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&x.jsx(Ho,{info:s,link:l})]}),x.jsx("input",{type:"number",value:t,onChange:u=>r(Number(u.target.value)),min:n,max:i,step:a,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),o&&x.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function yr({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return x.jsxs("div",{className:"flex items-center justify-between py-2",children:[x.jsxs("div",{children:[x.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&x.jsx(Ho,{info:i,link:a})]}),n&&x.jsx("p",{className:"text-xs text-slate-600",children:n})]}),x.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:x.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Po({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&x.jsx(Ho,{info:a,link:o})]}),x.jsx("select",{value:t,onChange:s=>r(s.target.value),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:n.map(s=>x.jsx("option",{value:s.value,children:s.label},s.value))}),i&&x.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function LQe({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&x.jsx(Ho,{info:a,link:o})]}),x.jsx("textarea",{value:t,onChange:s=>r(s.target.value),rows:n,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent resize-y"}),i&&x.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function Qh({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=W.useState(t.join(", "));W.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>c.trim()).filter(Boolean);r(u)};return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&x.jsx(Ho,{info:i,link:a})]}),x.jsx("input",{type:"text",value:o,onChange:u=>s(u.target.value),onBlur:l,placeholder:"item1, item2, item3",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),n&&x.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function IQe({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=W.useState(t.join(", "));W.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>parseInt(c.trim(),10)).filter(c=>!isNaN(c));r(u)};return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&x.jsx(Ho,{info:i,link:a})]}),x.jsx("input",{type:"text",value:o,onChange:u=>s(u.target.value),onBlur:l,placeholder:"0, 1, 2",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),n&&x.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function Cn({label:e,description:t,checked:r,onChange:n,threshold:i,onThresholdChange:a,thresholdLabel:o,thresholdMin:s,thresholdMax:l,thresholdStep:u=1,thresholdSuffix:c=""}){return x.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3 space-y-2",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex-1",children:[x.jsx("span",{className:"text-sm text-slate-300",children:e}),x.jsx("p",{className:"text-xs text-slate-600",children:t})]}),x.jsx("button",{type:"button",onClick:()=>n(!r),className:`relative w-11 h-6 rounded-full transition-colors flex-shrink-0 ml-3 ${r?"bg-accent":"bg-[#1e2a3a]"}`,children:x.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${r?"translate-x-5":""}`})})]}),r&&i!==void 0&&a&&x.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[x.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),x.jsx("input",{type:"number",value:i,onChange:f=>a(Number(f.target.value)),min:s,max:l,step:u,className:"w-20 px-2 py-1 bg-[#0a0e17] border border-[#1e2a3a] rounded text-xs text-slate-200 font-mono"}),c&&x.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function OQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.bot}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"Bot Name",value:e.name,onChange:r=>t({...e,name:r}),helper:"Name the bot responds to on the mesh",info:"When someone sends a message containing this name, the bot will respond. Also used as the sender name in broadcasts. Changing this requires a restart."}),x.jsx(xt,{label:"Owner",value:e.owner,onChange:r=>t({...e,owner:r}),helper:"Your callsign or identifier",info:"Identifies the bot operator. Shown in !help responses and used for admin-level commands."})]}),x.jsx(yr,{label:"Respond to DMs",checked:e.respond_to_dms,onChange:r=>t({...e,respond_to_dms:r}),helper:"Reply when someone sends a direct message",info:"When enabled, the bot responds to direct messages from any node. When disabled, the bot only responds to channel messages that mention its name."}),x.jsx(yr,{label:"Filter BBS Protocols",checked:e.filter_bbs_protocols,onChange:r=>t({...e,filter_bbs_protocols:r}),helper:"Ignore BBS bulletin board traffic",info:"Filters out automated BBS protocol messages (advBBS, MAIL*, BOARD*) so the bot doesn't try to respond to machine-to-machine traffic."})]})}function EQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.connection}),x.jsx(Po,{label:"Connection Type",value:e.type,onChange:r=>t({...e,type:r}),options:[{value:"serial",label:"Serial (USB)"},{value:"tcp",label:"TCP (Network)"}],helper:"Serial for USB-connected radios, TCP for network or meshtasticd",info:"Serial: direct USB connection to a Meshtastic radio. TCP: connect over the network to a radio's IP or to meshtasticd running on another machine."}),e.type==="serial"?x.jsx(xt,{label:"Serial Port",value:e.serial_port,onChange:r=>t({...e,serial_port:r}),placeholder:"/dev/ttyUSB0",helper:"Device path for your USB radio",info:"Usually /dev/ttyUSB0 on Linux or /dev/ttyACM0. Check with 'ls /dev/tty*' after plugging in your radio."}):x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"TCP Host",value:e.tcp_host,onChange:r=>t({...e,tcp_host:r}),placeholder:"192.168.1.100",helper:"IP address or hostname of the radio/meshtasticd"}),x.jsx(rt,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function DQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.response}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Delay Min (sec)",value:e.delay_min,onChange:r=>t({...e,delay_min:r}),min:0,step:.1,helper:"Minimum wait before responding",info:"Adds a random delay between min and max before the bot sends a response. Prevents the bot from appearing to respond instantly, which can feel unnatural on a radio network."}),x.jsx(rt,{label:"Delay Max (sec)",value:e.delay_max,onChange:r=>t({...e,delay_max:r}),min:0,step:.1,helper:"Maximum wait before responding",info:"Also prevents collisions with other traffic by staggering transmissions."})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Max Length",value:e.max_length,onChange:r=>t({...e,max_length:r}),min:50,max:500,helper:"Maximum characters per response message",info:"Meshtastic packets have limited size. This caps how long each message chunk can be. The bot will split longer responses into multiple messages up to Max Messages."}),x.jsx(rt,{label:"Max Messages",value:e.max_messages,onChange:r=>t({...e,max_messages:r}),min:1,max:10,helper:"Maximum chunks per response",info:"If a response is longer than Max Length, the bot splits it into this many chunks at most. Higher values = more complete answers but more airtime used."})]})]})}function NQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.history}),x.jsx(xt,{label:"Database Path",value:e.database,onChange:r=>t({...e,database:r}),helper:"SQLite file for storing conversation history",info:"Path to the SQLite database file. Created automatically if it doesn't exist. Stores all conversation history for context."}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Max Messages Per User",value:e.max_messages_per_user,onChange:r=>t({...e,max_messages_per_user:r}),min:0,helper:"History limit per user (0 = unlimited)",info:"Limits how many messages are stored per user. Older messages are pruned when the limit is reached. Set to 0 for no limit."}),x.jsx(rt,{label:"Conversation Timeout (sec)",value:e.conversation_timeout,onChange:r=>t({...e,conversation_timeout:r}),min:0,helper:"Seconds before context resets",info:"If a user doesn't message for this long, their next message starts a new conversation context. The bot won't remember the previous topic."})]}),x.jsx(yr,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),x.jsx(rt,{label:"Max Age (days)",value:e.max_age_days,onChange:r=>t({...e,max_age_days:r}),min:1,helper:"Delete conversations older than this"})]})]})}function jQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.memory}),x.jsx(yr,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Window Size",value:e.window_size,onChange:r=>t({...e,window_size:r}),min:1,helper:"Recent message pairs kept in full",info:"The bot keeps this many recent exchanges (user message + bot response pairs) as full text in context. Older messages are summarized to save token space."}),x.jsx(rt,{label:"Summarize Threshold",value:e.summarize_threshold,onChange:r=>t({...e,summarize_threshold:r}),min:1,helper:"Messages before older context is summarized",info:"When the conversation exceeds this many messages, older ones outside the window are compressed into a summary by the LLM."})]})]})}function RQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.context}),x.jsx(yr,{label:"Enable Passive Context",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Listen to channel traffic for context",info:"When enabled, the bot monitors mesh channels and includes recent messages in its context. This lets the bot reference things other people said on the channel."}),e.enabled&&x.jsxs(x.Fragment,{children:[x.jsx(YR,{label:"Observe Channels",value:e.observe_channels,onChange:r=>t({...e,observe_channels:r}),helper:"Channels to monitor (empty = all)",info:"Meshtastic channels to listen on. Leave empty to monitor all channels.",mode:"multi"}),x.jsx(ZR,{label:"Ignore Nodes",value:e.ignore_nodes,onChange:r=>t({...e,ignore_nodes:r}),helper:"Nodes to exclude from context",info:"Messages from these nodes won't be included in passive context. Useful for filtering out noisy automated nodes."}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),x.jsx(rt,{label:"Max Context Items",value:e.max_context_items,onChange:r=>t({...e,max_context_items:r}),min:1,helper:"Maximum recent messages to include"})]})]})]})}function BQe({data:e,onChange:t}){const r=new Set(e.disabled_commands.map(i=>i.toLowerCase())),n=i=>{const a=i.toLowerCase();r.has(a)?t({...e,disabled_commands:e.disabled_commands.filter(o=>o.toLowerCase()!==a)}):t({...e,disabled_commands:[...e.disabled_commands,i]})};return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.commands}),x.jsx(yr,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&x.jsxs(x.Fragment,{children:[x.jsx(xt,{label:"Command Prefix",value:e.prefix,onChange:i=>t({...e,prefix:i}),helper:"Character that triggers commands (e.g. ! for !help)",info:"Users type this character followed by the command name. Only single characters recommended."}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",x.jsx(Ho,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),x.jsx("div",{className:"grid gap-1",children:PQe.map(i=>{const a=!r.has(i.name.toLowerCase());return x.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),x.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),x.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:x.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${a?"translate-x-4":""}`})})]},i.name)})})]})]})]})}function zQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.llm}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(Po,{label:"Backend",value:e.backend,onChange:r=>t({...e,backend:r}),options:[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"google",label:"Google (Gemini)"}],helper:"LLM provider to use",info:"OpenAI: GPT models (gpt-4o, gpt-4o-mini). Anthropic: Claude models (claude-sonnet-4-20250514). Google: Gemini models. Can also point to compatible APIs like Ollama, LM Studio, or Open WebUI by changing the Base URL."}),x.jsx(xt,{label:"Model",value:e.model,onChange:r=>t({...e,model:r}),placeholder:"gpt-4o-mini",helper:"Specific model name",info:"The specific model to use. Common choices: gpt-4o-mini (fast, cheap), gpt-4o (better, costs more), claude-sonnet-4-20250514 (Anthropic equivalent). For local models via Ollama, use the model name you pulled (e.g. llama3.1)."})]}),x.jsx(xt,{label:"API Key",value:e.api_key,onChange:r=>t({...e,api_key:r}),type:"password",helper:"Supports ${ENV_VAR} syntax",info:"Your API key from the provider. You can also use ${ENV_VAR} syntax to read from an environment variable instead of storing the key in the config file."}),x.jsx(xt,{label:"Base URL",value:e.base_url,onChange:r=>t({...e,base_url:r}),placeholder:"https://api.openai.com/v1",helper:"API endpoint (change for local LLMs)",info:"Default API endpoint for the selected backend. Change this to point to a local LLM server (Ollama at http://localhost:11434/v1, Open WebUI, LM Studio, etc.) or a proxy."}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),x.jsx(rt,{label:"Max Response Tokens",value:e.max_response_tokens,onChange:r=>t({...e,max_response_tokens:r}),min:100,helper:"Token limit for LLM responses"})]}),x.jsx(yr,{label:"Use System Prompt",checked:e.use_system_prompt,onChange:r=>t({...e,use_system_prompt:r}),helper:"Enable custom system instructions"}),e.use_system_prompt&&x.jsx(LQe,{label:"System Prompt",value:e.system_prompt,onChange:r=>t({...e,system_prompt:r}),rows:6,helper:"Instructions that shape the bot's personality",info:"Instructions that shape the bot's personality and behavior. The bot always follows these instructions. MeshAI adds mesh health data and environmental context automatically — you don't need to include those here."}),x.jsx(yr,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),x.jsx(yr,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function $Qe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.weather}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(Po,{label:"Primary Provider",value:e.primary,onChange:r=>t({...e,primary:r}),options:[{value:"openmeteo",label:"Open-Meteo"},{value:"wttr",label:"wttr.in"},{value:"llm",label:"LLM"}],helper:"Main weather data source"}),x.jsx(Po,{label:"Fallback Provider",value:e.fallback,onChange:r=>t({...e,fallback:r}),options:[{value:"openmeteo",label:"Open-Meteo"},{value:"wttr",label:"wttr.in"},{value:"llm",label:"LLM"},{value:"none",label:"None"}],helper:"Backup if primary fails"})]}),x.jsx(xt,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function FQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.meshmonitor}),x.jsx(yr,{label:"Enable MeshMonitor",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Connect to AIDA MeshMonitor instance",info:"MeshMonitor by Yeraze provides node data, battery info, telemetry, and auto-responder patterns. MeshAI uses this as a data source and avoids duplicate responses."}),e.enabled&&x.jsxs(x.Fragment,{children:[x.jsx(xt,{label:"URL",value:e.url,onChange:r=>t({...e,url:r}),placeholder:"http://192.168.1.100:8080",helper:"MeshMonitor API endpoint",info:"Full URL to your MeshMonitor instance. Usually runs on port 8080."}),x.jsx(yr,{label:"Inject Into Prompt",checked:e.inject_into_prompt,onChange:r=>t({...e,inject_into_prompt:r}),helper:"Tell LLM about MeshMonitor commands",info:"Adds MeshMonitor's auto-responder patterns to the LLM context so it knows what commands MeshMonitor handles."}),x.jsx(rt,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),x.jsx(yr,{label:"Polite Mode",checked:e.polite_mode,onChange:r=>t({...e,polite_mode:r}),helper:"Reduce polling frequency",info:"Reduces polling frequency for shared instances to be a good neighbor."})]})]})}function VQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.knowledge}),x.jsx(yr,{label:"Enable Knowledge Base",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Answer questions from stored documents",info:"Uses RAG (Retrieval-Augmented Generation) to answer questions from a knowledge base. Supports Qdrant vector database or local SQLite with FTS5."}),e.enabled&&x.jsxs(x.Fragment,{children:[x.jsx(Po,{label:"Backend",value:e.backend,onChange:r=>t({...e,backend:r}),options:[{value:"auto",label:"Auto (Qdrant -> SQLite)"},{value:"qdrant",label:"Qdrant"},{value:"sqlite",label:"SQLite"}],helper:"Knowledge storage backend",info:"Auto tries Qdrant first, falls back to SQLite. Qdrant provides hybrid search with dense+sparse embeddings. SQLite uses FTS5 keyword search."}),(e.backend==="qdrant"||e.backend==="auto")&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"Qdrant Host",value:e.qdrant_host,onChange:r=>t({...e,qdrant_host:r}),helper:"Qdrant server hostname",info:"IP or hostname of your Qdrant vector database server."}),x.jsx(rt,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),x.jsx(xt,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"TEI Host",value:e.tei_host,onChange:r=>t({...e,tei_host:r}),helper:"Text Embeddings Inference host",info:"TEI service for generating dense embeddings. Uses BAAI/bge-m3 model."}),x.jsx(rt,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),x.jsx(yr,{label:"Use Sparse Embeddings",checked:e.use_sparse,onChange:r=>t({...e,use_sparse:r}),helper:"Enable hybrid search with sparse vectors",info:"Combines dense embeddings with sparse (keyword-based) embeddings using Reciprocal Rank Fusion for better search results."})]}),x.jsx(xt,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),x.jsx(rt,{label:"Top K Results",value:e.top_k,onChange:r=>t({...e,top_k:r}),min:1,max:20,helper:"Number of documents to retrieve"})]})]})}function GQe({source:e,onChange:t,onDelete:r}){const[n,i]=W.useState(!1),a={meshview:"Web-based mesh monitoring tool. Enter the full URL of a MeshView instance. No API key typically required.",meshmonitor:"AIDA MeshMonitor API. Provides node data and network statistics. Requires API token.",mqtt:"Subscribe directly to a Meshtastic MQTT broker for real-time packet data. This is push-based (instant) vs the polling approach of MeshView/MeshMonitor."};return x.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[x.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[x.jsxs("div",{className:"flex items-center gap-3",children:[n?x.jsx(yu,{size:16}):x.jsx(iu,{size:16}),x.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),x.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),x.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),x.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:x.jsx(nD,{size:14})})]}),n&&x.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),x.jsx(Po,{label:"Type",value:e.type,onChange:o=>t({...e,type:o}),options:[{value:"meshview",label:"MeshView"},{value:"meshmonitor",label:"MeshMonitor"},{value:"mqtt",label:"MQTT Broker"}],info:a[e.type]||""})]}),e.type!=="mqtt"&&x.jsx(xt,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&x.jsx(xt,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),x.jsx(rt,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),x.jsx(xt,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),x.jsx(xt,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),x.jsx(yr,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),x.jsx(rt,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),x.jsx(yr,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),x.jsx(yr,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function WQe({data:e,onChange:t}){const r=()=>{t([...e,{name:"New Source",type:"meshview",url:"",api_token:"",refresh_interval:30,polite_mode:!1,enabled:!0,host:"",port:1883,username:"",password:"",topic_root:"msh/US",use_tls:!1}])};return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.mesh_sources}),e.map((n,i)=>x.jsx(GQe,{source:n,onChange:a=>{const o=[...e];o[i]=a,t(o)},onDelete:()=>{confirm(`Delete source "${n.name}"?`)&&t(e.filter((a,o)=>o!==i))}},i)),x.jsxs("button",{onClick:r,className:"w-full py-2 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[x.jsx(LS,{size:16})," Add Source"]})]})}function HQe({data:e,onChange:t}){const[r,n]=W.useState(null);return x.jsxs("div",{className:"space-y-6",children:[x.jsx(hi,{text:fi.mesh_intelligence}),x.jsx(yr,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Locality Radius (miles)",value:e.locality_radius_miles,onChange:i=>t({...e,locality_radius_miles:i}),min:1,step:.5,helper:"Region assignment radius",info:"Nodes within this distance of a region anchor point are assigned to that region."}),x.jsx(rt,{label:"Offline Threshold (hours)",value:e.offline_threshold_hours,onChange:i=>t({...e,offline_threshold_hours:i}),min:1,helper:"Time until node marked offline",info:"A node is considered offline after not being heard for this many hours."})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Packet Threshold",value:e.packet_threshold,onChange:i=>t({...e,packet_threshold:i}),min:0,helper:"Min packets per 24h to flag",info:"Minimum packets per 24 hours. Nodes below this are flagged as low activity."}),x.jsx(rt,{label:"Battery Warning %",value:e.battery_warning_percent,onChange:i=>t({...e,battery_warning_percent:i}),min:1,max:100,helper:"Global battery warning level"})]}),x.jsx(ZR,{label:"Critical Nodes",value:e.critical_nodes,onChange:i=>t({...e,critical_nodes:i}),helper:"Critical infrastructure nodes",info:"Nodes that get priority alerting when they go offline.",roleFilter:"infrastructure"}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(YR,{label:"Alert Channel",value:e.alert_channel,onChange:i=>t({...e,alert_channel:i}),helper:"Channel for broadcast alerts",info:"Meshtastic channel for broadcast alerts. Select Disabled to turn off channel broadcasting.",mode:"single",includeDisabled:!0}),x.jsx(rt,{label:"Alert Cooldown (min)",value:e.alert_cooldown_minutes,onChange:i=>t({...e,alert_cooldown_minutes:i}),min:1,helper:"Min time between repeat alerts",info:"Minimum minutes between repeated alerts for the same condition. Uses scaling cooldown (12h, 24h, 48h)."})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",x.jsx(Ho,{info:"Regions group mesh nodes by geographic area. Each region has an anchor point (lat/lon) and nodes within the region radius are automatically assigned. Regions enable localized reports, alerts, and health scoring."})]}),e.regions.map((i,a)=>x.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[x.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[x.jsxs("div",{className:"flex items-center gap-3",children:[r===a?x.jsx(yu,{size:16}):x.jsx(iu,{size:16}),x.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),x.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),x.jsx("button",{onClick:o=>{if(o.stopPropagation(),confirm(`Delete region "${i.name||"Unnamed Region"}"?`)){const s=e.regions.filter((l,u)=>u!==a);t({...e,regions:s})}},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:x.jsx(nD,{size:14})})]}),r===a&&x.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),x.jsx(xt,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),x.jsx(rt,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),x.jsx(xt,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),x.jsx(Qh,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),x.jsx(Qh,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),x.jsxs("button",{onClick:()=>{const i={name:"",local_name:"",lat:0,lon:0,description:"",aliases:[],cities:[]};t({...e,regions:[...e.regions,i]}),n(e.regions.length)},className:"w-full py-2 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[x.jsx(LS,{size:16})," Add Region"]})]}),x.jsxs("div",{className:"space-y-3",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",x.jsx(Ho,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),x.jsx(Cn,{label:"Infra Offline",description:"Alert when an infrastructure node (router/repeater) goes offline",checked:e.alert_rules.infra_offline,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_offline:i}})}),x.jsx(Cn,{label:"Infra Recovery",description:"Alert when an offline infrastructure node comes back online",checked:e.alert_rules.infra_recovery,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_recovery:i}})}),x.jsx(Cn,{label:"New Router",description:"Alert when a new router/repeater appears on the mesh",checked:e.alert_rules.new_router,onChange:i=>t({...e,alert_rules:{...e.alert_rules,new_router:i}})}),x.jsx(Cn,{label:"Feeder Offline",description:"Alert when a data source (MeshView/MeshMonitor) stops responding",checked:e.alert_rules.feeder_offline,onChange:i=>t({...e,alert_rules:{...e.alert_rules,feeder_offline:i}})}),x.jsx(Cn,{label:"Single Gateway",description:"Alert when an infrastructure node has only one connection path",checked:e.alert_rules.infra_single_gateway,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_single_gateway:i}})}),x.jsx(Cn,{label:"Region Blackout",description:"Alert when all infrastructure in a region goes offline",checked:e.alert_rules.region_total_blackout,onChange:i=>t({...e,alert_rules:{...e.alert_rules,region_total_blackout:i}})})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),x.jsx(Cn,{label:"Battery Warning",description:"Alert when infra node battery drops below warning threshold",checked:e.alert_rules.battery_warning,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_warning:i}}),threshold:e.alert_rules.battery_warning_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_warning_threshold:i}}),thresholdLabel:"Below",thresholdMin:10,thresholdMax:90,thresholdSuffix:"%"}),x.jsx(Cn,{label:"Battery Critical",description:"Alert at critical battery level",checked:e.alert_rules.battery_critical,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_critical:i}}),threshold:e.alert_rules.battery_critical_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_critical_threshold:i}}),thresholdLabel:"Below",thresholdMin:5,thresholdMax:50,thresholdSuffix:"%"}),x.jsx(Cn,{label:"Battery Emergency",description:"Alert at emergency battery level",checked:e.alert_rules.battery_emergency,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_emergency:i}}),threshold:e.alert_rules.battery_emergency_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_emergency_threshold:i}}),thresholdLabel:"Below",thresholdMin:1,thresholdMax:25,thresholdSuffix:"%"}),x.jsx(Cn,{label:"Battery Trend Declining",description:"Alert when battery shows a declining trend over 7 days",checked:e.alert_rules.battery_trend_declining,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_trend_declining:i}})}),x.jsx(Cn,{label:"Power Source Change",description:"Alert when a node switches between battery and USB power",checked:e.alert_rules.power_source_change,onChange:i=>t({...e,alert_rules:{...e.alert_rules,power_source_change:i}})}),x.jsx(Cn,{label:"Solar Not Charging",description:"Alert when a solar-powered node isn't charging during daylight",checked:e.alert_rules.solar_not_charging,onChange:i=>t({...e,alert_rules:{...e.alert_rules,solar_not_charging:i}})})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),x.jsx(Cn,{label:"High Utilization",description:"Alert when channel utilization stays high for extended periods",checked:e.alert_rules.sustained_high_util,onChange:i=>t({...e,alert_rules:{...e.alert_rules,sustained_high_util:i}}),threshold:e.alert_rules.high_util_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,high_util_threshold:i}}),thresholdLabel:"Above",thresholdMin:5,thresholdMax:50,thresholdSuffix:`% for ${e.alert_rules.high_util_hours}h`}),x.jsx(Cn,{label:"Packet Flood",description:"Alert when a single node sends excessive packets",checked:e.alert_rules.packet_flood,onChange:i=>t({...e,alert_rules:{...e.alert_rules,packet_flood:i}}),threshold:e.alert_rules.packet_flood_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,packet_flood_threshold:i}}),thresholdLabel:"Over",thresholdMin:100,thresholdMax:2e3,thresholdSuffix:"pkts/24h"})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),x.jsx(Cn,{label:"Mesh Score Alert",description:"Alert when overall mesh health score drops below threshold",checked:e.alert_rules.mesh_score_alert,onChange:i=>t({...e,alert_rules:{...e.alert_rules,mesh_score_alert:i}}),threshold:e.alert_rules.mesh_score_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,mesh_score_threshold:i}}),thresholdLabel:"Below",thresholdMin:30,thresholdMax:90,thresholdSuffix:"/100"}),x.jsx(Cn,{label:"Region Score Alert",description:"Alert when a region's health score drops below threshold",checked:e.alert_rules.region_score_alert,onChange:i=>t({...e,alert_rules:{...e.alert_rules,region_score_alert:i}}),threshold:e.alert_rules.region_score_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,region_score_threshold:i}}),thresholdLabel:"Below",thresholdMin:30,thresholdMax:90,thresholdSuffix:"/100"})]})]})]})]})}function UQe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(hi,{text:fi.dashboard}),x.jsx(yr,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(xt,{label:"Host",value:e.host,onChange:r=>t({...e,host:r}),placeholder:"0.0.0.0",helper:"Network bind address",info:"0.0.0.0 = accessible from any device on the network. 127.0.0.1 = only accessible from this machine."}),x.jsx(rt,{label:"Port",value:e.port,onChange:r=>t({...e,port:r}),min:1,max:65535,helper:"Dashboard URL port",info:"Port number for the web dashboard URL. You access the dashboard at http://your-ip:port"})]})]})}function ZQe(){var I;const[e,t]=W.useState(null),[r,n]=W.useState(null),[i,a]=W.useState("bot"),[o,s]=W.useState(!0),[l,u]=W.useState(!1),[c,f]=W.useState(null),[h,d]=W.useState(null),[v,g]=W.useState(!1),[m,y]=W.useState(!1),_=W.useCallback(async()=>{try{const k=await fetch("/api/config");if(!k.ok)throw new Error("Failed to fetch config");const E=await k.json();t(E),n(JSON.parse(JSON.stringify(E))),y(!1),f(null)}catch(k){f(k instanceof Error?k.message:"Unknown error")}finally{s(!1)}},[]);W.useEffect(()=>{document.title="Config — MeshAI",_()},[_]),W.useEffect(()=>{e&&r&&y(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const b=async()=>{if(e){u(!0),f(null),d(null);try{const k=e[i],E=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),D=await E.json();if(!E.ok)throw new Error(D.detail||"Save failed");d(`${i} saved successfully`),n(JSON.parse(JSON.stringify(e))),y(!1),D.restart_required&&g(!0),setTimeout(()=>d(null),3e3)}catch(k){f(k instanceof Error?k.message:"Save failed")}finally{u(!1)}}},S=()=>{r&&(t(JSON.parse(JSON.stringify(r))),y(!1))},T=async()=>{try{await fetch("/api/restart",{method:"POST"}),g(!1),d("Restart initiated")}catch{f("Restart failed")}},C=(k,E)=>{e&&t({...e,[k]:E})};if(o)return x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const A=()=>{switch(i){case"bot":return x.jsx(OQe,{data:e.bot,onChange:k=>C("bot",k)});case"connection":return x.jsx(EQe,{data:e.connection,onChange:k=>C("connection",k)});case"response":return x.jsx(DQe,{data:e.response,onChange:k=>C("response",k)});case"history":return x.jsx(NQe,{data:e.history,onChange:k=>C("history",k)});case"memory":return x.jsx(jQe,{data:e.memory,onChange:k=>C("memory",k)});case"context":return x.jsx(RQe,{data:e.context,onChange:k=>C("context",k)});case"commands":return x.jsx(BQe,{data:e.commands,onChange:k=>C("commands",k)});case"llm":return x.jsx(zQe,{data:e.llm,onChange:k=>C("llm",k)});case"weather":return x.jsx($Qe,{data:e.weather,onChange:k=>C("weather",k)});case"meshmonitor":return x.jsx(FQe,{data:e.meshmonitor,onChange:k=>C("meshmonitor",k)});case"knowledge":return x.jsx(VQe,{data:e.knowledge,onChange:k=>C("knowledge",k)});case"mesh_sources":return x.jsx(WQe,{data:e.mesh_sources,onChange:k=>C("mesh_sources",k)});case"mesh_intelligence":return x.jsx(HQe,{data:e.mesh_intelligence,onChange:k=>C("mesh_intelligence",k)});case"dashboard":return x.jsx(UQe,{data:e.dashboard,onChange:k=>C("dashboard",k)});default:return null}},P=((I=YU.find(k=>k.key===i))==null?void 0:I.label)||i;return x.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[x.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:YU.map(({key:k,label:E,icon:D})=>x.jsxs("button",{onClick:()=>a(k),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===k?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[x.jsx(D,{size:16}),x.jsx("span",{children:E}),m&&i===k&&x.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},k))}),x.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[x.jsxs("div",{className:"flex items-center justify-between mb-6",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx(DZ,{size:20,className:"text-slate-500"}),x.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:P})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[m&&x.jsxs("button",{onClick:S,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 bg-bg-hover rounded transition-colors",children:[x.jsx(IS,{size:14}),"Discard"]}),x.jsxs("button",{onClick:b,disabled:l||!m,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm bg-accent text-white rounded hover:bg-accent/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[l?x.jsx(Mm,{size:14,className:"animate-spin"}):x.jsx(tD,{size:14}),"Save"]})]})]}),v&&x.jsxs("div",{className:"flex items-center justify-between p-3 mb-4 bg-amber-500/10 border border-amber-500/30 rounded-lg",children:[x.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[x.jsx(su,{size:16}),x.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),x.jsx("button",{onClick:T,className:"px-3 py-1 text-sm bg-amber-500 text-white rounded hover:bg-amber-600 transition-colors",children:"Restart Now"})]}),c&&x.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400",children:[x.jsx(lu,{size:16}),x.jsx("span",{className:"text-sm",children:c})]}),h&&x.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-green-500/10 border border-green-500/30 rounded-lg text-green-400",children:[x.jsx(nu,{size:16}),x.jsx("span",{className:"text-sm",children:h})]}),x.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:x.jsx("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:A()})})]})]})}function YQe({feed:e}){const t=e.is_loaded?e.consecutive_errors>0?"bg-amber-500":"bg-green-500":"bg-red-500",r=e.is_loaded?e.consecutive_errors>0?`${e.consecutive_errors} errors`:"Healthy":"Not loaded",n=e.last_fetch?new Date(e.last_fetch*1e3).toLocaleTimeString():"Never";return x.jsxs("div",{className:"bg-bg-hover rounded-lg p-4",children:[x.jsxs("div",{className:"flex items-center justify-between mb-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("div",{className:`w-2 h-2 rounded-full ${t}`}),x.jsx("span",{className:"text-sm font-medium text-slate-200 uppercase",children:e.source})]}),x.jsx("span",{className:"text-xs text-slate-400",children:r})]}),x.jsxs("div",{className:"text-xs text-slate-500 space-y-1",children:[x.jsxs("div",{children:["Events: ",e.event_count]}),x.jsxs("div",{children:["Last fetch: ",n]}),e.last_error&&x.jsx("div",{className:"text-amber-500 truncate",children:e.last_error})]})]})}function XQe({event:e}){const t=e.severity.toLowerCase(),r=t==="extreme"||t==="severe"||t==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",Icon:au,color:"text-red-500"}:t==="moderate"||t==="warning"||t==="priority"?{bg:"bg-amber-500/10",border:"border-amber-500",Icon:su,color:"text-amber-500"}:{bg:"bg-blue-500/10",border:"border-blue-500",Icon:MS,color:"text-blue-500"},n=r.Icon;return x.jsx("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border}`,children:x.jsxs("div",{className:"flex items-start gap-3",children:[x.jsx(n,{size:16,className:r.color}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[x.jsx("span",{className:"text-sm font-medium text-slate-200",children:e.event_type}),x.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${r.bg} ${r.color}`,children:e.severity})]}),x.jsx("div",{className:"text-sm text-slate-300",children:e.headline})]})]})})}function Kie({value:e,onChange:t,disabled:r,centralDisabled:n}){const i="px-2 py-1 text-xs transition-colors";return x.jsxs("div",{className:`flex rounded border border-[#1e2a3a] overflow-hidden ${r?"opacity-40":""}`,children:[x.jsx("button",{type:"button",disabled:r,onClick:()=>t("native"),className:`${i} ${e==="native"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"native"}),x.jsx("button",{type:"button",disabled:r||n,title:n?"Central not available for this adapter":"",onClick:()=>{n||t("central")},className:`${i} ${n?"text-slate-600 cursor-not-allowed":e==="central"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"central"})]})}function qQe({title:e,subtitle:t,enabled:r,onEnabled:n,feedSource:i,onFeedSource:a,hasCentral:o,nativeOnly:s,hasKey:l,health:u,events:c,children:f}){const h=s||!o;return x.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{children:[x.jsx("span",{className:"text-sm font-medium text-slate-300",children:e}),t&&x.jsx("p",{className:"text-xs text-slate-600",children:t})]}),x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),x.jsx(Kie,{value:i,onChange:a,disabled:!r,centralDisabled:h})]}),x.jsx(yr,{label:"",checked:r,onChange:n})]})]}),!l&&x.jsx("div",{className:"text-xs text-amber-400 bg-amber-500/10 rounded p-2",children:"API key not configured — contact admin"}),s&&x.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available for this adapter — native only"}),x.jsx("div",{className:r?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:f}),(u||c&&c.length>0)&&x.jsxs("div",{className:"pt-2 border-t border-[#1e2a3a] space-y-3",children:[x.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"Live status"}),u?x.jsx(YQe,{feed:u}):x.jsx("div",{className:"text-xs text-slate-600",children:"No status reported."}),c&&c.length>0&&x.jsx("div",{className:"space-y-2",children:c.slice(0,5).map((d,v)=>x.jsx(XQe,{event:d},v))})]})]})}const fl={nws:{label:"NWS Weather Alerts",subtitle:"National Weather Service alerts",health:"nws",hasCentral:!0,nativeOnly:!1,hasKey:!0},fires:{label:"NIFC Fire Perimeters",subtitle:"Active wildfires (National Interagency Fire Center)",health:"nifc",hasCentral:!0,nativeOnly:!1,hasKey:!0},firms:{label:"NASA FIRMS Hotspots",subtitle:"Satellite thermal-anomaly detections",health:"firms",hasCentral:!0,nativeOnly:!1,hasKey:!1},swpc:{label:"NOAA Space Weather (SWPC)",subtitle:"Solar indices, geomagnetic storms",health:"swpc",hasCentral:!0,nativeOnly:!1,hasKey:!0},ducting:{label:"Tropospheric Ducting",subtitle:"VHF/UHF extended-range conditions",health:"ducting",hasCentral:!1,nativeOnly:!0,hasKey:!0},traffic:{label:"TomTom Traffic",subtitle:"Traffic flow on monitored corridors",health:"traffic",hasCentral:!0,nativeOnly:!1,hasKey:!0},roads511:{label:"511 Road Conditions",subtitle:"State DOT road events and closures",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!1},usgs_quake:{label:"USGS Earthquakes",subtitle:"Seismic events from the USGS feed",health:"usgs_quake",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs:{label:"USGS Stream Gauges",subtitle:"River and stream water levels",health:"usgs",hasCentral:!0,nativeOnly:!1,hasKey:!0},avalanche:{label:"Avalanche Advisories",subtitle:"Backcountry avalanche danger ratings",health:"avalanche",hasCentral:!1,nativeOnly:!0,hasKey:!0}},mP=[{key:"weather",label:"Weather",icon:ou,adapters:["nws"]},{key:"fire",label:"Fire",icon:AS,adapters:["fires","firms"]},{key:"rf",label:"RF Propagation",icon:Za,adapters:["swpc","ducting"]},{key:"roads",label:"Roads",icon:CS,adapters:["traffic","roads511"]},{key:"geohazards",label:"Geohazards",icon:kS,adapters:["usgs_quake","usgs","avalanche"]},{key:"tracking",label:"Tracking",icon:OS,adapters:[]},{key:"mesh",label:"Mesh Health",icon:yv,adapters:[]}];function KQe(){var j,U;const[e,t]=W.useState(null),[r,n]=W.useState(""),[i,a]=W.useState(null),[o,s]=W.useState([]),[l,u]=W.useState(!0),[c,f]=W.useState(!1),[h,d]=W.useState(null),[v,g]=W.useState(null),[m,y]=W.useState(!1),[_,b]=W.useState("weather"),[S,T]=W.useState("nws");W.useEffect(()=>{document.title="Environment — MeshAI",(async()=>{try{const V=await(await fetch("/api/config/environmental")).json();t(V),n(JSON.stringify(V))}catch(G){d(G instanceof Error?G.message:"Failed to load config")}finally{u(!1)}})()},[]),W.useEffect(()=>{const G=async()=>{try{a(await $Z()),s(await FZ())}catch{}};G();const V=setInterval(G,3e4);return()=>clearInterval(V)},[]);const C=e!==null&&JSON.stringify(e)!==r,A=async()=>{if(e){f(!0),d(null),g(null);try{const G=await fetch("/api/config/environmental",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V=await G.json();if(!G.ok)throw new Error(V.detail||"Save failed");n(JSON.stringify(e)),g("Environmental config saved"),V.restart_required&&y(!0),setTimeout(()=>g(null),3e3)}catch(G){d(G instanceof Error?G.message:"Save failed")}finally{f(!1)}}},P=()=>{e&&t(JSON.parse(r))},I=async()=>{try{await fetch("/api/restart",{method:"POST"}),y(!1),g("Restart initiated")}catch{d("Restart failed")}},k=G=>e&&t({...e,...G});if(l)return x.jsx("div",{className:"flex items-center justify-center h-64 text-slate-400",children:"Loading environmental config…"});if(!e)return x.jsx("div",{className:"flex items-center justify-center h-64 text-red-400",children:h||"No config"});const E=G=>i==null?void 0:i.feeds.find(V=>V.source===fl[G].health),D=G=>o.filter(V=>V.source===fl[G].health),N=mP.find(G=>G.key===_),z=N.adapters.length===0?null:S&&N.adapters.includes(S)?S:N.adapters[0],F=G=>{switch(G){case"nws":return x.jsxs(x.Fragment,{children:[x.jsx(Qh,{label:"NWS Zones",value:e.nws_zones,onChange:V=>k({nws_zones:V}),helper:"Zone IDs like IDZ016, IDZ030",infoLink:"https://www.weather.gov/pimar/PubZone"}),x.jsx(xt,{label:"User Agent",value:e.nws.user_agent,onChange:V=>k({nws:{...e.nws,user_agent:V}}),placeholder:"(MeshAI, you@email.com)",helper:"Format: (app_name, contact_email)"}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:V=>k({nws:{...e.nws,tick_seconds:V}}),min:30}),x.jsx(Po,{label:"Min Severity",value:e.nws.severity_min,onChange:V=>k({nws:{...e.nws,severity_min:V}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}]})]})]});case"swpc":return x.jsx("div",{className:"text-xs text-slate-500",children:"No additional settings."});case"ducting":return x.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[x.jsx(rt,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:V=>k({ducting:{...e.ducting,tick_seconds:V}}),min:60}),x.jsx(rt,{label:"Latitude",value:e.ducting.latitude,onChange:V=>k({ducting:{...e.ducting,latitude:V}}),step:.01}),x.jsx(rt,{label:"Longitude",value:e.ducting.longitude,onChange:V=>k({ducting:{...e.ducting,longitude:V}}),step:.01})]});case"fires":return x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(rt,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:V=>k({fires:{...e.fires,tick_seconds:V}}),min:60}),x.jsx(Po,{label:"State",value:e.fires.state,onChange:V=>k({fires:{...e.fires,state:V}}),options:kQe})]});case"avalanche":return x.jsxs(x.Fragment,{children:[x.jsx(rt,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:V=>k({avalanche:{...e.avalanche,tick_seconds:V}}),min:60}),x.jsx(Qh,{label:"Center IDs",value:e.avalanche.center_ids,onChange:V=>k({avalanche:{...e.avalanche,center_ids:V}}),helper:"e.g., SNFAC",infoLink:"https://avalanche.org/avalanche-centers/"}),x.jsx(IQe,{label:"Season Months",value:e.avalanche.season_months,onChange:V=>k({avalanche:{...e.avalanche,season_months:V}}),helper:"e.g., 12, 1, 2, 3, 4"})]});case"usgs":return x.jsxs(x.Fragment,{children:[x.jsx(rt,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:V=>k({usgs:{...e.usgs,tick_seconds:V}}),min:900,helper:"Minimum 15 min (900s)"}),x.jsx(Qh,{label:"Site IDs",value:e.usgs.sites,onChange:V=>k({usgs:{...e.usgs,sites:V}}),helper:"USGS gauge site numbers",infoLink:"https://waterdata.usgs.gov/nwis"})]});case"usgs_quake":return x.jsxs(x.Fragment,{children:[x.jsx(rt,{label:"Tick Seconds",value:e.usgs_quake.tick_seconds,onChange:V=>k({usgs_quake:{...e.usgs_quake,tick_seconds:V}}),min:60}),x.jsx(rt,{label:"Min Magnitude",value:e.usgs_quake.min_magnitude,onChange:V=>k({usgs_quake:{...e.usgs_quake,min_magnitude:V}}),step:.1,min:0}),x.jsx(xt,{label:"Region Tag",value:e.usgs_quake.region,onChange:V=>k({usgs_quake:{...e.usgs_quake,region:V}})}),x.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((V,Y)=>{var K;return x.jsx(rt,{label:V,value:((K=e.usgs_quake.bbox)==null?void 0:K[Y])??0,onChange:ee=>{const le=[...e.usgs_quake.bbox||[0,0,0,0]];le[Y]=ee,k({usgs_quake:{...e.usgs_quake,bbox:le}})},step:.01},V)})}),x.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box [W,S,E,N] geographic filter"})]});case"traffic":return x.jsxs(x.Fragment,{children:[x.jsx(xt,{label:"API Key",value:e.traffic.api_key,onChange:V=>k({traffic:{...e.traffic,api_key:V}}),type:"password",helper:"developer.tomtom.com"}),x.jsx(rt,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:V=>k({traffic:{...e.traffic,tick_seconds:V}}),min:60}),x.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Corridors:"}),(e.traffic.corridors||[]).map((V,Y)=>x.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[x.jsx(xt,{label:"Name",value:V.name,onChange:K=>{const ee=[...e.traffic.corridors];ee[Y]={...V,name:K},k({traffic:{...e.traffic,corridors:ee}})}}),x.jsx(rt,{label:"Lat",value:V.lat,onChange:K=>{const ee=[...e.traffic.corridors];ee[Y]={...V,lat:K},k({traffic:{...e.traffic,corridors:ee}})},step:.01}),x.jsx(rt,{label:"Lon",value:V.lon,onChange:K=>{const ee=[...e.traffic.corridors];ee[Y]={...V,lon:K},k({traffic:{...e.traffic,corridors:ee}})},step:.01}),x.jsx("button",{onClick:()=>k({traffic:{...e.traffic,corridors:e.traffic.corridors.filter((K,ee)=>ee!==Y)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30 rounded",children:"Remove"})]},Y)),x.jsx("button",{onClick:()=>k({traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"})]});case"roads511":return x.jsxs(x.Fragment,{children:[x.jsx(xt,{label:"Base URL",value:e.roads511.base_url,onChange:V=>k({roads511:{...e.roads511,base_url:V}}),placeholder:"https://511.yourstate.gov/api/v2"}),x.jsx(xt,{label:"API Key",value:e.roads511.api_key,onChange:V=>k({roads511:{...e.roads511,api_key:V}}),type:"password",helper:"Leave empty if not required"}),x.jsx(rt,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:V=>k({roads511:{...e.roads511,tick_seconds:V}}),min:60}),x.jsx(Qh,{label:"Endpoints",value:e.roads511.endpoints,onChange:V=>k({roads511:{...e.roads511,endpoints:V}}),helper:"e.g., /get/event"}),x.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((V,Y)=>{var K;return x.jsx(rt,{label:V,value:((K=e.roads511.bbox)==null?void 0:K[Y])??0,onChange:ee=>{const le=[...e.roads511.bbox||[0,0,0,0]];le[Y]=ee,k({roads511:{...e.roads511,bbox:le}})},step:.01},V)})})]});case"firms":return x.jsxs(x.Fragment,{children:[x.jsx(xt,{label:"MAP Key",value:e.firms.map_key,onChange:V=>k({firms:{...e.firms,map_key:V}}),type:"password",helper:"firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),x.jsx(rt,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:V=>k({firms:{...e.firms,tick_seconds:V}}),min:300}),x.jsx(Po,{label:"Satellite Source",value:e.firms.source,onChange:V=>k({firms:{...e.firms,source:V}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (NRT)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (NRT)"},{value:"MODIS_NRT",label:"MODIS (NRT)"}]}),x.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[x.jsx(rt,{label:"Day Range",value:e.firms.day_range,onChange:V=>k({firms:{...e.firms,day_range:V}}),min:1,max:10}),x.jsx(Po,{label:"Min Confidence",value:e.firms.confidence_min,onChange:V=>k({firms:{...e.firms,confidence_min:V}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),x.jsx(rt,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:V=>k({firms:{...e.firms,proximity_km:V}}),step:.5})]}),x.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((V,Y)=>{var K;return x.jsx(rt,{label:V,value:((K=e.firms.bbox)==null?void 0:K[Y])??0,onChange:ee=>{const le=[...e.firms.bbox||[0,0,0,0]];le[Y]=ee,k({firms:{...e.firms,bbox:le}})},step:.01},V)})})]})}},$=e,Z=(G,V)=>{const Y=e[G]||{};k({[G]:{...Y,...V}})};return x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h1",{className:"text-xl font-semibold text-slate-200",children:"Environment"}),x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx(yr,{label:"Feeds Enabled",checked:e.enabled,onChange:G=>k({enabled:G})}),C&&x.jsxs(x.Fragment,{children:[x.jsxs("button",{onClick:P,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 border border-border rounded",children:[x.jsx(IS,{size:14})," Discard"]}),x.jsxs("button",{onClick:A,disabled:c,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-accent text-white rounded disabled:opacity-50",children:[x.jsx(tD,{size:14})," ",c?"Saving…":"Save"]})]})]})]}),h&&x.jsx("div",{className:"text-sm text-red-400 bg-red-500/10 rounded p-3",children:h}),v&&x.jsx("div",{className:"text-sm text-green-400 bg-green-500/10 rounded p-3",children:v}),m&&x.jsxs("div",{className:"flex items-center justify-between text-sm text-amber-400 bg-amber-500/10 border border-amber-500/30 rounded p-3",children:[x.jsxs("span",{className:"flex items-center gap-2",children:[x.jsx(Mm,{size:14})," A restart is required for some changes to take effect."]}),x.jsx("button",{onClick:I,className:"px-3 py-1 bg-amber-500/20 hover:bg-amber-500/30 rounded",children:"Restart now"})]}),e.central&&x.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{children:[x.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Central Connection"}),x.jsx("p",{className:"text-xs text-slate-600",children:'NATS JetStream source for any adapter set to "central"'})]}),x.jsx(yr,{label:"",checked:!!e.central.enabled,onChange:G=>k({central:{...e.central,enabled:G}})})]}),x.jsxs("div",{className:e.central.enabled?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:[x.jsx(xt,{label:"URL",value:e.central.url||"",onChange:G=>k({central:{...e.central,url:G}}),placeholder:"nats://central.echo6.mesh:4222"}),x.jsx(xt,{label:"Durable",value:e.central.durable||"",onChange:G=>k({central:{...e.central,durable:G}}),placeholder:"meshai-v04"}),x.jsx(xt,{label:"Region",value:e.central.region||"",onChange:G=>k({central:{...e.central,region:G}}),placeholder:"us.id",helper:"Central v0.9.20 region token (dotted, e.g. 'us.id'). Empty = bare wildcards (all-US firehose)."})]})]}),x.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:mP.map(({key:G,label:V,icon:Y})=>x.jsxs("button",{onClick:()=>{b(G);const K=mP.find(ee=>ee.key===G);T(K.adapters[0]??null)},className:`flex items-center gap-2 px-4 py-2 text-sm whitespace-nowrap border-b-2 -mb-px transition-colors ${_===G?"border-accent text-accent":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[x.jsx(Y,{size:15})," ",V]},G))}),_==="tracking"&&x.jsxs("div",{className:"flex flex-col items-center justify-center h-[40vh] text-center",children:[x.jsx(OS,{size:32,className:"text-slate-600 mb-4"}),x.jsx("p",{className:"text-slate-500 max-w-md",children:"No adapters yet. ADS-B / AIS / satellite passes are planned for v0.5."})]}),_==="mesh"&&x.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{children:[x.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Mesh Health"}),x.jsx("p",{className:"text-xs text-slate-600",children:"Node/infra telemetry — sourced from the mesh, not an environmental feed."})]}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),x.jsx(Kie,{value:"native",onChange:()=>{},disabled:!1,centralDisabled:!0})]})]}),x.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available — reserved for a future migration."})]}),N.adapters.length>0&&z&&x.jsxs(x.Fragment,{children:[N.adapters.length>1&&x.jsx("div",{className:"flex gap-1",children:N.adapters.map(G=>x.jsx("button",{onClick:()=>T(G),className:`px-3 py-1.5 text-sm rounded ${z===G?"bg-bg-hover text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:fl[G].label},G))}),x.jsx(qQe,{title:fl[z].label,subtitle:fl[z].subtitle,enabled:((j=$[z])==null?void 0:j.enabled)??!1,onEnabled:G=>Z(z,{enabled:G}),feedSource:((U=$[z])==null?void 0:U.feed_source)??"native",onFeedSource:G=>Z(z,{feed_source:G}),hasCentral:fl[z].hasCentral,nativeOnly:fl[z].nativeOnly,hasKey:fl[z].hasKey,health:E(z),events:D(z),children:F(z)})]})]})}const XU={infra_offline:BZ,infra_recovery:ES,battery_warning:dA,battery_critical:dA,battery_emergency:dA,hf_blackout:Pm,uhf_ducting:Za,weather_warning:ou,weather_watch:ou,new_router:Za,packet_flood:su,sustained_high_util:su,region_blackout:au,default:Am};function JQe(e){return XU[e]||XU.default}function Jie(e){switch(e==null?void 0:e.toLowerCase()){case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",badge:"bg-red-500/20 text-red-400",iconColor:"text-red-500"};case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",badge:"bg-amber-500/20 text-amber-400",iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",badge:"bg-blue-500/20 text-blue-400",iconColor:"text-blue-500"}}}function QQe(e){const t=typeof e=="number"?new Date(e*1e3):new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/1e3),a=Math.floor(i/60),o=Math.floor(a/60),s=Math.floor(o/24);return i<60?"Just now":a<60?`${a}m ago`:o<24?`${o}h ago`:`${s}d ago`}function eet(e){return(typeof e=="number"?new Date(e*1e3):new Date(e)).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function tet(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`${Math.floor(e/86400)}d`}function ret({alert:e,onAcknowledge:t}){var i;const r=Jie(e.severity),n=JQe(e.type);return x.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-4 ${r.border}`,children:x.jsxs("div",{className:"flex items-start gap-3",children:[x.jsx(n,{size:20,className:r.iconColor}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[x.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),x.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),x.jsx("div",{className:"text-sm text-slate-200",children:e.message}),x.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[x.jsxs("span",{className:"flex items-center gap-1",children:[x.jsx(Td,{size:12}),e.timestamp?QQe(e.timestamp):"Just now"]}),e.scope_value&&x.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),x.jsx("button",{onClick:()=>t(e),className:"px-3 py-1 text-xs text-slate-400 hover:text-slate-200 border border-border rounded hover:bg-bg-hover transition-colors",children:"Acknowledge"})]})})}function net({history:e,typeFilter:t,severityFilter:r,onTypeFilterChange:n,onSeverityFilterChange:i,page:a,totalPages:o,onPageChange:s}){const l=["all","infra_offline","infra_recovery","battery_warning","battery_critical","hf_blackout","uhf_ducting","weather_warning","new_router","packet_flood"],u=["all","immediate","priority","routine"];return x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg",children:[x.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(eD,{size:14,className:"text-slate-400"}),x.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),x.jsx("select",{value:t,onChange:c=>n(c.target.value),className:"bg-bg border border-border rounded px-3 py-1.5 text-sm text-slate-200 focus:outline-none focus:border-blue-500",children:l.map(c=>x.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),x.jsx("select",{value:r,onChange:c=>i(c.target.value),className:"bg-bg border border-border rounded px-3 py-1.5 text-sm text-slate-200 focus:outline-none focus:border-blue-500",children:u.map(c=>x.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),x.jsx("div",{className:"overflow-x-auto",children:x.jsxs("table",{className:"w-full",children:[x.jsx("thead",{children:x.jsxs("tr",{className:"border-b border-border",children:[x.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),x.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),x.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),x.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),x.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),x.jsx("tbody",{children:e.length>0?e.map((c,f)=>{const h=Jie(c.severity);return x.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[x.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:eet(c.timestamp)}),x.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),x.jsx("td",{className:"p-4",children:x.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${h.badge}`,children:c.severity})}),x.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),x.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?tet(c.duration):"-"})]},c.id||f)}):x.jsx("tr",{children:x.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&x.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[x.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("button",{onClick:()=>s(a-1),disabled:a<=1,className:"p-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",children:x.jsx(ice,{size:16})}),x.jsx("button",{onClick:()=>s(a+1),disabled:a>=o,className:"p-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",children:x.jsx(iu,{size:16})})]})]})]})}function iet({subscription:e,nodes:t}){const r=o=>{const s=t.find(l=>l.node_id_hex===o||String(l.node_num)===o||l.short_name===o);return s?s.long_name&&s.long_name!==s.short_name?`${s.short_name} (${s.long_name})`:s.short_name:o},n=()=>{if(e.sub_type==="alerts")return"Real-time";const o=e.schedule_time||"0000",s=parseInt(o.slice(0,2)),l=o.slice(2),u=s>=12?"PM":"AM";let f=`${s%12||12}:${l} ${u}`;return e.sub_type==="weekly"&&e.schedule_day&&(f+=` ${e.schedule_day.charAt(0).toUpperCase()}${e.schedule_day.slice(1)}`),f},a=(()=>{switch(e.sub_type){case"alerts":return Am;case"daily":return Td;case"weekly":return Td;default:return Am}})();return x.jsx("div",{className:"p-4 rounded-lg bg-bg-hover border border-border",children:x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:x.jsx(a,{size:18,className:"text-blue-400"})}),x.jsxs("div",{className:"flex-1",children:[x.jsxs("div",{className:"text-sm text-slate-200 font-medium",children:[e.sub_type.charAt(0).toUpperCase()+e.sub_type.slice(1),e.scope_type!=="mesh"&&e.scope_value&&x.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),x.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," • ",r(e.user_id)]})]}),x.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function aet(){const[e,t]=W.useState([]),[r,n]=W.useState([]),[i,a]=W.useState([]),[o,s]=W.useState([]),[l,u]=W.useState(!0),[c,f]=W.useState(null),[h,d]=W.useState("all"),[v,g]=W.useState("all"),[m,y]=W.useState(1),[_,b]=W.useState(1),S=20,[T,C]=W.useState(new Set),{lastAlert:A}=iD();W.useEffect(()=>{document.title="Alerts — MeshAI"},[]),W.useEffect(()=>{Promise.all([zZ().catch(()=>[]),x3(S,0).catch(()=>({items:[],total:0})),bce().catch(()=>[]),fetch("/api/nodes").then(k=>k.json()).catch(()=>[])]).then(([k,E,D,N])=>{t(k),Array.isArray(E)?(n(E),b(1)):(n(E.items||[]),b(Math.ceil((E.total||0)/S))),a(D),s(N),u(!1)}).catch(k=>{f(k.message),u(!1)})},[]),W.useEffect(()=>{A&&t(k=>k.some(D=>D.type===A.type&&D.message===A.message)?k:[A,...k])},[A]),W.useEffect(()=>{const k=(m-1)*S;x3(S,k,h,v).then(E=>{Array.isArray(E)?(n(E),b(1)):(n(E.items||[]),b(Math.ceil((E.total||0)/S)))}).catch(()=>{})},[m,h,v]);const P=W.useCallback(k=>{const E=`${k.type}-${k.message}-${k.timestamp}`;C(D=>new Set([...D,E]))},[]),I=e.filter(k=>{const E=`${k.type}-${k.message}-${k.timestamp}`;return!T.has(E)});return l?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[x.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[x.jsx(su,{size:14}),"Active Alerts (",I.length,")"]}),I.length>0?x.jsx("div",{className:"space-y-3",children:I.map((k,E)=>x.jsx(ret,{alert:k,onAcknowledge:P},`${k.type}-${k.timestamp}-${E}`))}):x.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[x.jsx(JE,{size:20,className:"text-green-500"}),x.jsx("span",{children:"No active alerts — all systems nominal"})]})]}),x.jsxs("div",{children:[x.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[x.jsx(Td,{size:14}),"Alert History"]}),x.jsx(net,{history:r,typeFilter:h,severityFilter:v,onTypeFilterChange:k=>{d(k),y(1)},onSeverityFilterChange:k=>{g(k),y(1)},page:m,totalPages:_,onPageChange:y})]}),x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[x.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[x.jsx(gce,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?x.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(k=>x.jsx(iet,{subscription:k,nodes:o},k.id))}):x.jsxs("div",{className:"text-slate-500 py-4",children:[x.jsx("p",{children:"No active subscriptions."}),x.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",x.jsx("code",{className:"text-blue-400",children:"!subscribe"})," on mesh"]})]})]})]})}const bb=[{value:"routine",label:"Routine",description:"Informational, no time pressure (ducting, new node, weather advisory, battery declining)"},{value:"priority",label:"Priority",description:"Needs attention soon (severe weather, fire nearby, node offline, HF blackout)"},{value:"immediate",label:"Immediate",description:"Act now, drop everything (fire at infrastructure, extreme weather, region blackout)"}],qU=[{id:"mesh_health",name:"Mesh Health Monitoring",description:"Infrastructure problems - offline nodes, low battery, channel congestion",rule:{name:"Mesh Health Monitoring",enabled:!0,trigger_type:"condition",categories:["infra_offline","critical_node_down","infra_recovery","battery_warning","battery_critical","battery_emergency","high_utilization","packet_flood","mesh_score_low"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,override_quiet:!1,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"weather_fire",name:"Weather & Fire Alerts",description:"Environmental threats - severe weather, nearby wildfires, new ignitions, flooding",rule:{name:"Weather & Fire Alerts",enabled:!0,trigger_type:"condition",categories:["weather_warning","fire_proximity","new_ignition","stream_flood_warning"],min_severity:"priority",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:15,override_quiet:!1,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"rf_conditions",name:"RF Conditions",description:"Propagation changes - solar events, HF blackouts, tropospheric ducting",rule:{name:"RF Conditions",enabled:!0,trigger_type:"condition",categories:["hf_blackout","tropospheric_ducting","geomagnetic_storm"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:60,override_quiet:!1,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"road_traffic",name:"Road & Traffic",description:"Road closures and severe congestion",rule:{name:"Road & Traffic",enabled:!0,trigger_type:"condition",categories:["road_closure","traffic_congestion"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,override_quiet:!1,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"everything_critical",name:"Everything Critical",description:"All emergency-level events regardless of type",rule:{name:"Everything Critical",enabled:!0,trigger_type:"condition",categories:[],min_severity:"immediate",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:5,override_quiet:!0,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"morning_briefing",name:"Morning Briefing",description:"Daily health and conditions summary at 7am",rule:{name:"Morning Briefing",enabled:!0,trigger_type:"schedule",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"mesh_health_summary",custom_message:"",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:0,override_quiet:!1,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}}];function $_(e){if(!e)return"Never";const r=Date.now()/1e3-e;return r<60?"Just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function ia({info:e}){const[t,r]=W.useState(!1);return x.jsxs("div",{className:"relative inline-block",children:[x.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),r(!t)},className:"ml-1.5 w-4 h-4 rounded-full bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-slate-200 inline-flex items-center justify-center text-xs transition-colors",title:"More info",children:"?"}),t&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),x.jsx("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl text-xs text-slate-300 leading-relaxed",children:e})]})]})}function bl({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o=""}){const[s,l]=W.useState(!1),u=n==="password";return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&x.jsx(ia,{info:o})]}),x.jsxs("div",{className:"relative",children:[x.jsx("input",{type:u&&!s?"password":"text",value:t,onChange:c=>r(c.target.value),placeholder:i,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),u&&x.jsx("button",{type:"button",onClick:()=>l(!s),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:s?x.jsx(kZ,{size:16}):x.jsx(QE,{size:16})})]}),a&&x.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function Gy({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&x.jsx(ia,{info:s})]}),x.jsx("input",{type:"number",value:t,onChange:l=>r(Number(l.target.value)),min:n,max:i,step:a,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),o&&x.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function Jc({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return x.jsxs("div",{className:"flex items-center justify-between py-2",children:[x.jsxs("div",{children:[x.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&x.jsx(ia,{info:i})]}),n&&x.jsx("p",{className:"text-xs text-slate-600",children:n})]}),x.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:x.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Sc({label:e,value:t,onChange:r,helper:n="",info:i=""}){return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&x.jsx(ia,{info:i})]}),x.jsx("input",{type:"time",value:t,onChange:a=>r(a.target.value),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent"}),n&&x.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function wb({label:e,value:t,onChange:r,placeholder:n="Add item...",helper:i="",info:a=""}){const[o,s]=W.useState(""),l=()=>{o.trim()&&!t.includes(o.trim())&&(r([...t,o.trim()]),s(""))},u=c=>{r(t.filter((f,h)=>h!==c))};return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&x.jsx(ia,{info:a})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("input",{type:"text",value:o,onChange:c=>s(c.target.value),onKeyDown:c=>c.key==="Enter"&&(c.preventDefault(),l()),className:"flex-1 px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent",placeholder:n}),x.jsx("button",{type:"button",onClick:l,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm text-white transition-colors",children:x.jsx(LS,{size:16})})]}),t.length>0&&x.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,f)=>x.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,x.jsx("button",{type:"button",onClick:()=>u(f),className:"text-slate-500 hover:text-red-400",children:x.jsx(lu,{size:14})})]},f))}),i&&x.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function Qie({value:e,onChange:t}){const[r,n]=W.useState(!1),i=bb.find(a=>a.value===e)||bb[0];return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",x.jsx(ia,{info:"Only alerts at or above this severity trigger this rule. ROUTINE = informational, PRIORITY = needs attention, IMMEDIATE = act now."})]}),x.jsxs("div",{className:"relative",children:[x.jsxs("button",{type:"button",onClick:()=>n(!r),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-left flex items-center justify-between hover:border-accent transition-colors",children:[x.jsxs("div",{children:[x.jsx("span",{className:"text-slate-200",children:i.label}),x.jsxs("span",{className:"text-slate-500 ml-2",children:["- ",i.description]})]}),x.jsx(yu,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),x.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-[#0a0e17] border border-[#1e2a3a] rounded-lg shadow-xl overflow-hidden",children:bb.map(a=>x.jsxs("button",{type:"button",onClick:()=>{t(a.value),n(!1)},className:`w-full px-3 py-2.5 text-left text-sm hover:bg-[#1e2a3a] transition-colors ${e===a.value?"bg-accent/10":""}`,children:[x.jsx("div",{className:"font-medium text-slate-200",children:a.label}),x.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),x.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function F_({rule:e}){const[t,r]=W.useState(!1),[n,i]=W.useState(null),a=async()=>{r(!0),i(null);try{let s={type:e.delivery_type};e.delivery_type==="mesh_broadcast"?s.channel_index=e.broadcast_channel:e.delivery_type==="mesh_dm"?s.node_ids=e.node_ids:e.delivery_type==="email"?s={type:"email",smtp_host:e.smtp_host,smtp_port:e.smtp_port,smtp_user:e.smtp_user,smtp_password:e.smtp_password,smtp_tls:e.smtp_tls,from_address:e.from_address,recipients:e.recipients}:e.delivery_type==="webhook"&&(s={type:"webhook",url:e.webhook_url,headers:e.webhook_headers});const u=await(await fetch("/api/notifications/channels/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();i(u)}catch(s){i({success:!1,message:"Test failed",error:s instanceof Error?s.message:"Unknown error",details:{}})}finally{r(!1)}};if(!e.delivery_type)return null;const o={mesh_broadcast:x.jsx(Za,{size:14}),mesh_dm:x.jsx(EZ,{size:14}),email:x.jsx(fce,{size:14}),webhook:x.jsx(cce,{size:14})}[e.delivery_type]||x.jsx(ES,{size:14});return x.jsxs("div",{className:"space-y-2",children:[x.jsx("button",{type:"button",onClick:a,disabled:t,className:"flex items-center gap-2 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",children:t?x.jsxs(x.Fragment,{children:[x.jsx(Mm,{size:14,className:"animate-spin"}),"Testing..."]}):x.jsxs(x.Fragment,{children:[o,"Test Channel"]})}),n&&x.jsx("div",{className:`p-2 rounded text-xs ${n.success?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:x.jsxs("div",{className:"flex items-start gap-2",children:[n.success?x.jsx(nu,{size:14,className:"mt-0.5 flex-shrink-0"}):x.jsx(lu,{size:14,className:"mt-0.5 flex-shrink-0"}),x.jsxs("div",{children:[x.jsx("div",{className:"font-medium",children:n.message}),n.error&&x.jsx("div",{className:"mt-1 text-red-300",children:n.error})]})]})})]})}function oet({rule:e,ruleIndex:t,categories:r,regions:n,quietHoursEnabled:i,onChange:a,onDelete:o,onDuplicate:s,onTest:l}){var N,z,F,$,Z;const[u,c]=W.useState(!e.name),[f,h]=W.useState(!1),[d,v]=W.useState(null),[g,m]=W.useState(null);W.useEffect(()=>{var j;e.name&&t>=0&&(fetch(`/api/notifications/rules/${t}/stats`).then(U=>U.json()).then(U=>v(U)).catch(()=>{}),(j=e.categories)!=null&&j.length&&fetch("/api/notifications/rules/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:e.categories})}).then(U=>U.json()).then(U=>m(U)).catch(()=>{}))},[e.name,t,e.categories]);const y=[{value:"",label:"(None)",description:"Rule matches but does not deliver"},{value:"mesh_broadcast",label:"Mesh Broadcast",description:"Send to a mesh radio channel"},{value:"mesh_dm",label:"Mesh DM",description:"Direct message to specific nodes"},{value:"email",label:"Email",description:"Send via SMTP"},{value:"webhook",label:"Webhook",description:"POST to any URL"}],_=[{value:"daily",label:"Daily"},{value:"twice_daily",label:"Twice Daily"},{value:"weekly",label:"Weekly"}],b=[{value:"mesh_health_summary",label:"Mesh Health Summary",description:"Current health score, pillar breakdown, problem nodes"},{value:"rf_propagation_report",label:"RF Propagation Report",description:"Solar indices, Kp, ducting conditions"},{value:"alerts_digest",label:"Active Alerts Digest",description:"Summary of all active environmental alerts"},{value:"environmental_conditions",label:"Environmental Conditions",description:"Full conditions: weather, fire, streams, roads"},{value:"custom",label:"Custom Message",description:"Write your own with template tokens"}],S=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],T=j=>{const U=e.categories||[];U.includes(j)?a({...e,categories:U.filter(G=>G!==j)}):a({...e,categories:[...U,j]})},C=(j,U)=>{const G=e.categories||[];if(U==="add"){const V=Array.from(new Set([...G,...j]));a({...e,categories:V})}else{const V=new Set(j);a({...e,categories:G.filter(Y=>!V.has(Y))})}},A=j=>{const U=e.region_scope||[];U.includes(j)?a({...e,region_scope:U.filter(G=>G!==j)}):a({...e,region_scope:[...U,j]})},P=j=>{const U=e.schedule_days||[];U.includes(j)?a({...e,schedule_days:U.filter(G=>G!==j)}):a({...e,schedule_days:[...U,j]})},I=async()=>{h(!0),await l(),h(!1)},k=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const j=e.categories||[];if(j.length===0&&r.length>0)return r[0].example_message||"Alert notification";const U=r.find(G=>j.includes(G.id));return(U==null?void 0:U.example_message)||"Alert notification"},E=()=>{var U,G,V,Y,K,ee,le,he;const j=[];if(e.trigger_type==="schedule"){const Re=((U=_.find(ne=>ne.value===e.schedule_frequency))==null?void 0:U.label)||e.schedule_frequency,ge=((G=b.find(ne=>ne.value===e.message_type))==null?void 0:G.label)||e.message_type;j.push(`${Re} at ${e.schedule_time||"??:??"}`),j.push(ge)}else{const Re=((V=e.categories)==null?void 0:V.length)||0,ge=Re===0?"All":r.filter(fe=>{var ue;return(ue=e.categories)==null?void 0:ue.includes(fe.id)}).map(fe=>fe.name).slice(0,2).join(", ")+(Re>2?` +${Re-2}`:""),ne=((Y=bb.find(fe=>fe.value===e.min_severity))==null?void 0:Y.label)||e.min_severity;j.push(`${ge} at ${ne}+`)}if(!e.delivery_type)j.push("No delivery");else{const Re=((K=y.find(ne=>ne.value===e.delivery_type))==null?void 0:K.label)||e.delivery_type;let ge="";if(e.delivery_type==="mesh_broadcast")ge=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")ge=`${((ee=e.node_ids)==null?void 0:ee.length)||0} nodes`;else if(e.delivery_type==="email")ge=(le=e.recipients)!=null&&le.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{ge=new URL(e.webhook_url).hostname}catch{ge=((he=e.webhook_url)==null?void 0:he.slice(0,20))||"no URL"}j.push(`${Re}${ge?` (${ge})`:""}`)}return j.join(" -> ")},D=()=>{var U;if(!g||!((U=e.categories)!=null&&U.length))return null;const j=new Map;for(const[,G]of Object.entries(g)){const V=j.get(G.source);V?(V.events+=G.active_events,V.enabled=V.enabled&&G.enabled):j.set(G.source,{enabled:G.enabled,events:G.active_events})}return Array.from(j.entries()).map(([G,{enabled:V,events:Y}])=>x.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs ${V?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,title:V?`${Y} active`:"Not enabled",children:[V?x.jsx(ES,{size:10}):x.jsx(BZ,{size:10}),G.toUpperCase(),V&&Y>0&&` (${Y})`]},G))};return x.jsxs("div",{className:`border rounded-lg overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[x.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>c(!u),children:[x.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[u?x.jsx(yu,{size:16,className:"text-slate-500 flex-shrink-0"}):x.jsx(iu,{size:16,className:"text-slate-500 flex-shrink-0"}),x.jsx("button",{onClick:j=>{j.stopPropagation(),a({...e,enabled:!e.enabled})},className:`w-2 h-2 rounded-full flex-shrink-0 ${e.enabled?"bg-green-500":"bg-slate-500"}`,title:e.enabled?"Enabled":"Disabled"}),e.trigger_type==="schedule"?x.jsx(Td,{size:14,className:"text-blue-400 flex-shrink-0"}):x.jsx(Pm,{size:14,className:"text-yellow-400 flex-shrink-0"}),x.jsx("span",{className:"font-medium text-slate-200 truncate",title:e.name||void 0,children:e.name||"New Rule"}),!u&&x.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:E()})]}),x.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!u&&(()=>{const j="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs mr-2";if(!e.enabled)return x.jsx("span",{className:`${j} bg-slate-800 text-slate-500`,children:"Disabled"});if(!d)return null;const U=d.fire_count||0,G=d.last_fired,V=Date.now()/1e3-7*86400;return U>0&&G&&G>=V?x.jsx("span",{className:`${j} bg-green-500/10 text-green-400`,title:`Last fired ${$_(G)}`,children:"Active"}):U>0&&G?x.jsx("span",{className:`${j} bg-yellow-500/10 text-yellow-400`,title:`Last fired ${$_(G)}`,children:"Idle (no recent activity)"}):x.jsx("span",{className:`${j} bg-slate-800 text-slate-400`,children:"No activity yet"})})(),!u&&x.jsx("div",{className:"hidden md:flex items-center gap-1 mr-2",children:D()}),x.jsx("button",{onClick:j=>{j.stopPropagation(),I()},disabled:f||!e.name,className:"p-1.5 text-blue-400 hover:text-blue-300 hover:bg-blue-500/10 rounded disabled:opacity-50",title:"Test rule",children:x.jsx(m3,{size:14})}),x.jsx("button",{onClick:j=>{j.stopPropagation(),s()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:x.jsx(lce,{size:14})}),x.jsx("button",{onClick:j=>{j.stopPropagation(),o()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:x.jsx(nD,{size:14})})]})]}),!u&&e.name&&x.jsxs("div",{className:"px-3 pb-2 pt-0 bg-[#0a0e17] flex items-center gap-2 flex-wrap text-xs",children:[!e.delivery_type&&x.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-500/10 text-amber-400 rounded",children:[x.jsx(au,{size:10}),"No delivery method"]}),(d==null?void 0:d.fire_count)!==void 0&&d.fire_count>0&&x.jsxs("span",{className:"text-slate-500",children:["Fired ",d.fire_count,"x"]})]}),u&&x.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[x.jsx(bl,{label:"Rule Name",value:e.name,onChange:j=>a({...e,name:j}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),x.jsxs("div",{className:"flex gap-2",children:[x.jsxs("button",{type:"button",onClick:()=>a({...e,trigger_type:"condition"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors ${e.trigger_type!=="schedule"?"bg-accent/10 border-accent text-accent":"bg-[#0a0e17] border-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:[x.jsx(Pm,{size:16}),x.jsx("span",{children:"Condition"})]}),x.jsxs("button",{type:"button",onClick:()=>a({...e,trigger_type:"schedule"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors ${e.trigger_type==="schedule"?"bg-accent/10 border-accent text-accent":"bg-[#0a0e17] border-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:[x.jsx(Td,{size:16}),x.jsx("span",{children:"Schedule"})]})]}),x.jsx("p",{className:"text-xs text-slate-600",children:e.trigger_type==="schedule"?"Send reports on a schedule (daily briefings, weekly digests)":"React to alert conditions (fires, outages, weather warnings)"})]}),e.trigger_type!=="schedule"&&x.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[x.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[x.jsx(su,{size:14}),"WHEN (Condition)"]}),x.jsx(Qie,{value:e.min_severity,onChange:j=>a({...e,min_severity:j})}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",x.jsx(ia,{info:"Select which types of alerts trigger this rule. Leave all unchecked to match ALL categories. Categories are grouped by family — use the 'All' / 'Clear' buttons in each header to bulk-toggle."})]}),x.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((N=e.categories)==null?void 0:N.length)||0)===0?"All categories (none selected)":`${(z=e.categories)==null?void 0:z.length} selected`}),x.jsx(set,{categories:r,selected:e.categories||[],onToggle:T,onSelectMany:C})]}),g&&Object.keys(g).length>0&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Data Sources"}),x.jsx("div",{className:"flex flex-wrap gap-2",children:D()})]})]}),e.trigger_type==="schedule"&&x.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[x.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[x.jsx(nce,{size:14}),"WHEN (Schedule)"]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),x.jsx("select",{value:e.schedule_frequency||"daily",onChange:j=>a({...e,schedule_frequency:j.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:_.map(j=>x.jsx("option",{value:j.value,children:j.label},j.value))})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(Sc,{label:"Time",value:e.schedule_time||"07:00",onChange:j=>a({...e,schedule_time:j})}),e.schedule_frequency==="twice_daily"&&x.jsx(Sc,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:j=>a({...e,schedule_time_2:j})})]}),e.schedule_frequency==="weekly"&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),x.jsx("div",{className:"flex flex-wrap gap-2",children:S.map(j=>{var U;return x.jsx("button",{type:"button",onClick:()=>P(j),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(U=e.schedule_days)!=null&&U.includes(j)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:j.slice(0,3)},j)})})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),x.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:j=>a({...e,message_type:j.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:b.map(j=>x.jsx("option",{value:j.value,children:j.label},j.value))}),x.jsx("p",{className:"text-xs text-slate-600",children:(F=b.find(j=>j.value===e.message_type))==null?void 0:F.description})]}),e.message_type==="custom"&&x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",x.jsx(ia,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),x.jsx("textarea",{value:e.custom_message||"",onChange:j=>a({...e,custom_message:j.target.value}),rows:4,placeholder:"Good morning! Mesh health: {MESH_SCORE}/100 with {NODE_COUNT} nodes online.",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"})]})]}),x.jsxs("div",{className:"space-y-2 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[x.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[x.jsx(PS,{size:14}),"REGIONS",x.jsx(ia,{info:"Limit this rule to alerts from specific regions. Empty selection = all regions (backward compatible). Region names come from /api/regions."})]}),x.jsx("div",{className:"text-xs text-slate-500",children:((($=e.region_scope)==null?void 0:$.length)||0)===0?"All regions (none selected)":`${e.region_scope.length} of ${n.length} selected`}),n.length===0?x.jsx("div",{className:"text-xs text-slate-600 italic",children:"No regions configured."}):x.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(j=>{const U=(e.region_scope||[]).includes(j.name);return x.jsx("button",{type:"button",onClick:()=>A(j.name),className:`px-3 py-1.5 rounded text-sm transition-colors ${U?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,title:j.local_name||j.name,children:j.local_name||j.name},j.name)})})]}),x.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[x.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[x.jsx(m3,{size:14}),"SEND VIA"]}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",x.jsx(ia,{info:"Where this notification gets delivered. Select (None) to save the rule without delivery - it will match conditions but won't send until you configure a delivery method."})]}),x.jsx("select",{value:e.delivery_type||"",onChange:j=>a({...e,delivery_type:j.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:y.map(j=>x.jsx("option",{value:j.value,children:j.label},j.value))}),x.jsx("p",{className:"text-xs text-slate-600",children:(Z=y.find(j=>j.value===(e.delivery_type||"")))==null?void 0:Z.description})]}),!e.delivery_type&&x.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[x.jsx(au,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),x.jsx("div",{className:"text-sm text-amber-300",children:"Rule will log matches but not deliver until a delivery method is configured."})]}),e.delivery_type==="mesh_broadcast"&&x.jsxs(x.Fragment,{children:[x.jsx(YR,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:j=>a({...e,broadcast_channel:j}),helper:"Select the mesh radio channel",mode:"single"}),x.jsx(F_,{rule:e})]}),e.delivery_type==="mesh_dm"&&x.jsxs(x.Fragment,{children:[x.jsx(ZR,{label:"Recipient Nodes",value:e.node_ids||[],onChange:j=>a({...e,node_ids:j}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),x.jsx(F_,{rule:e})]}),e.delivery_type==="email"&&x.jsxs("div",{className:"space-y-4",children:[x.jsx(wb,{label:"Recipients",value:e.recipients||[],onChange:j=>a({...e,recipients:j}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),x.jsxs("details",{className:"group",children:[x.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[x.jsx(iu,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),x.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(bl,{label:"SMTP Host",value:e.smtp_host||"",onChange:j=>a({...e,smtp_host:j}),placeholder:"smtp.gmail.com"}),x.jsx(Gy,{label:"SMTP Port",value:e.smtp_port??587,onChange:j=>a({...e,smtp_port:j}),min:1,max:65535})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(bl,{label:"Username",value:e.smtp_user||"",onChange:j=>a({...e,smtp_user:j})}),x.jsx(bl,{label:"Password",value:e.smtp_password||"",onChange:j=>a({...e,smtp_password:j}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),x.jsx(Jc,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:j=>a({...e,smtp_tls:j})}),x.jsx(bl,{label:"From Address",value:e.from_address||"",onChange:j=>a({...e,from_address:j}),placeholder:"alerts@yourdomain.com"})]})]}),x.jsx(F_,{rule:e})]}),e.delivery_type==="webhook"&&x.jsxs(x.Fragment,{children:[x.jsx(bl,{label:"Webhook URL",value:e.webhook_url||"",onChange:j=>a({...e,webhook_url:j}),placeholder:"https://discord.com/api/webhooks/...",helper:"POST alert as JSON",info:"Works with Discord webhooks, ntfy.sh, Slack, Home Assistant, Pushover, or any HTTP POST endpoint."}),x.jsx(F_,{rule:e})]})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(Gy,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:j=>a({...e,cooldown_minutes:j}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."}),i&&x.jsx("div",{className:"flex items-end pb-1",children:x.jsx(Jc,{label:"Override Quiet Hours",checked:e.override_quiet??!1,onChange:j=>a({...e,override_quiet:j}),helper:"Deliver during quiet hours"})})]}),d&&x.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[x.jsxs("span",{children:["Last fired: ",$_(d.last_fired)]}),x.jsxs("span",{children:["Last tested: ",$_(d.last_test)]}),x.jsxs("span",{children:["Total fires: ",d.fire_count]})]}),e.trigger_type!=="schedule"&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),x.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 rounded-lg border border-[#1e2a3a]",children:x.jsx("p",{className:"text-sm text-slate-300 font-mono",children:k()})}),x.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}const Sb=[{key:"mesh_health",label:"Mesh Health",Icon:yv},{key:"weather",label:"Weather",Icon:ou},{key:"fire",label:"Fire",Icon:AS},{key:"rf_propagation",label:"RF Propagation",Icon:Za},{key:"roads",label:"Roads",Icon:CS},{key:"avalanche",label:"Avalanche",Icon:pce},{key:"seismic",label:"Seismic",Icon:kS},{key:"tracking",label:"Tracking",Icon:PS}];function set({categories:e,selected:t,onToggle:r,onSelectMany:n}){const i=new Set(Sb.map(h=>h.key)),a=new Map;Sb.forEach(h=>a.set(h.key,[]));const o=[];for(const h of e){const d=h.toggle;d&&i.has(d)?a.get(d).push(h):o.push(h)}const s=new Set;for(const[h,d]of a)d.some(v=>t.includes(v.id))&&s.add(h);o.some(h=>t.includes(h.id))&&s.add("other");const[l,u]=W.useState(s),c=h=>{u(d=>{const v=new Set(d);return v.has(h)?v.delete(h):v.add(h),v})},f=(h,d,v,g)=>{if(!g.length)return null;const m=l.has(h),y=g.map(b=>b.id),_=y.filter(b=>t.includes(b)).length;return x.jsxs("div",{className:"border border-[#1e2a3a] rounded",children:[x.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-[#0d1420]",children:[x.jsxs("button",{type:"button",onClick:()=>c(h),className:"flex items-center gap-2 text-sm text-slate-200 flex-1 min-w-0",children:[m?x.jsx(yu,{size:14,className:"text-slate-500 flex-shrink-0"}):x.jsx(iu,{size:14,className:"text-slate-500 flex-shrink-0"}),v&&x.jsx(v,{size:14,className:"text-slate-400 flex-shrink-0"}),x.jsxs("span",{className:"truncate",children:[d," (",g.length,")"]}),_>0&&x.jsxs("span",{className:"ml-1 text-xs text-accent",children:[_," selected"]})]}),x.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[x.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),n(y,"add")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-accent hover:bg-accent/10",title:"Select all in family",children:"All"}),x.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),n(y,"remove")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-red-400 hover:bg-red-500/10",title:"Clear family",children:"Clear"})]})]}),m&&x.jsx("div",{className:"p-1 space-y-1",children:g.map(b=>x.jsxs("label",{onClick:()=>r(b.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[x.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${t.includes(b.id)?"bg-accent border-accent":"border-slate-600"}`,children:t.includes(b.id)&&x.jsx(nu,{size:12,className:"text-white"})}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:"text-sm text-slate-200",children:b.name}),x.jsx("div",{className:"text-xs text-slate-500",children:b.description})]})]},b.id))})]},h)};return x.jsxs("div",{className:"max-h-96 overflow-y-auto border border-[#1e2a3a] rounded-lg p-2 space-y-2",children:[Sb.map(h=>f(h.key,h.label,h.Icon,a.get(h.key)||[])),f("other","Other",null,o)]})}const KU=["digest","mesh_broadcast","mesh_dm","email","webhook"],uet=["routine","priority","immediate"];function cet({toggles:e,onChange:t}){const[r,n]=W.useState(null),i=(a,o)=>t({...e,[a]:{...e[a]||{},name:a,...o}});return x.jsxs("div",{className:"space-y-3 mb-8",children:[x.jsxs("div",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Master Toggles",x.jsx(ia,{info:"Per-family notification policy: enable a family, set its severity threshold, choose which channels fire at each severity, and scope to regions (PagerDuty/Grafana-style)."})]}),x.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Sb.map(({key:a,label:o,Icon:s})=>{const l=e[a]||{},u=r===a,c=Object.values(l.severity_channels||{}).reduce((h,d)=>h+((d==null?void 0:d.length)||0),0),f=(l.regions||[]).length;return x.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("button",{type:"button",onClick:()=>n(u?null:a),className:"flex items-center gap-2 text-sm text-slate-200",children:[x.jsx(s,{size:15})," ",o,u?x.jsx(yu,{size:14}):x.jsx(iu,{size:14})]}),x.jsx(Jc,{label:"",checked:!!l.enabled,onChange:h=>i(a,{enabled:h})})]}),!u&&x.jsx("div",{className:"text-xs text-slate-600 mt-1",children:l.enabled?`${f||"all"} region${f===1?"":"s"}, ${c} channel${c===1?"":"s"} at ${l.min_severity||"priority"}+`:"OFF"}),u&&x.jsxs("div",{className:`mt-3 space-y-3 ${l.enabled?"":"opacity-40 pointer-events-none select-none"}`,children:[x.jsx(Qie,{value:l.min_severity||"priority",onChange:h=>i(a,{min_severity:h})}),x.jsx("div",{className:"text-xs text-slate-500",children:"Severity → channels"}),x.jsxs("table",{className:"text-xs w-full",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx("th",{}),KU.map(h=>x.jsx("th",{className:"text-slate-500 font-normal px-1",children:h.replace("_"," ")},h))]})}),x.jsx("tbody",{children:uet.map(h=>x.jsxs("tr",{children:[x.jsx("td",{className:"text-slate-400 pr-2",children:h}),KU.map(d=>{var g;const v=(((g=l.severity_channels)==null?void 0:g[h])||[]).includes(d);return x.jsx("td",{className:"text-center",children:x.jsx("input",{type:"checkbox",checked:v,onChange:m=>{const y={...l.severity_channels||{}},_=new Set(y[h]||[]);m.target.checked?_.add(d):_.delete(d),y[h]=Array.from(_),i(a,{severity_channels:y})}})},d)})]},h))})]}),x.jsx(wb,{label:"Regions (empty = all)",value:l.regions||[],onChange:h=>i(a,{regions:h}),placeholder:"Add region..."}),x.jsx(Jc,{label:"Quiet-hours override (immediate only)",checked:!!l.quiet_hours_override,onChange:h=>i(a,{quiet_hours_override:h})}),x.jsx("div",{className:"text-xs text-slate-500 pt-1",children:"Channel config"}),x.jsx(Gy,{label:"Broadcast channel",value:l.broadcast_channel??0,onChange:h=>i(a,{broadcast_channel:h})}),x.jsx(wb,{label:"DM node IDs",value:l.node_ids||[],onChange:h=>i(a,{node_ids:h}),placeholder:"!nodeid"}),x.jsx(wb,{label:"Email recipients",value:l.recipients||[],onChange:h=>i(a,{recipients:h}),placeholder:"ops@example.com"}),x.jsx(bl,{label:"SMTP host",value:l.smtp_host||"",onChange:h=>i(a,{smtp_host:h}),placeholder:"smtp.example.com"}),x.jsx(Gy,{label:"SMTP port",value:l.smtp_port??587,onChange:h=>i(a,{smtp_port:h})}),x.jsx(bl,{label:"Webhook URL",value:l.webhook_url||"",onChange:h=>i(a,{webhook_url:h}),placeholder:"https://..."})]})]},a)})})]})}function fet(){var j,U,G;const[e,t]=W.useState(null),[r,n]=W.useState(null),[i,a]=W.useState([]),[o,s]=W.useState([]),[l,u]=W.useState(!0),[c,f]=W.useState(!1),[h,d]=W.useState(null),[v,g]=W.useState(null),[m,y]=W.useState(null),[_,b]=W.useState({open:!1,ruleIndex:-1,loading:!1,action:""}),[S,T]=W.useState(!1),[C,A]=W.useState(!1),P=W.useCallback(async()=>{try{const[V,Y,K]=await Promise.all([fetch("/api/config/notifications"),fetch("/api/notifications/categories"),fetch("/api/regions")]);if(!V.ok)throw new Error("Failed to fetch notifications config");const ee=await V.json(),le=await Y.json(),he=K.ok?await K.json():[];t(ee),n(JSON.parse(JSON.stringify(ee))),a(le),s(Array.isArray(he)?he:[]),A(!1),d(null)}catch(V){d(V instanceof Error?V.message:"Unknown error")}finally{u(!1)}},[]);W.useEffect(()=>{document.title="Notifications - MeshAI",P()},[P]),W.useEffect(()=>{e&&r&&A(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const I=async()=>{if(e){f(!0),d(null),g(null);try{const V=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Y=await V.json();if(!V.ok)throw new Error(Y.detail||"Save failed");g("Notifications config saved successfully"),n(JSON.parse(JSON.stringify(e))),A(!1),setTimeout(()=>g(null),3e3)}catch(V){d(V instanceof Error?V.message:"Save failed")}finally{f(!1)}}},k=()=>{r&&(t(JSON.parse(JSON.stringify(r))),A(!1))},E=()=>({name:"",enabled:!0,trigger_type:"condition",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"19:00",schedule_days:["monday"],message_type:"mesh_health_summary",custom_message:"",delivery_type:"",broadcast_channel:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{},cooldown_minutes:10,override_quiet:!1,region_scope:[]}),D=()=>{e&&t({...e,rules:[...e.rules||[],E()]})},N=V=>{if(!e)return;const Y=qU.find(K=>K.id===V);Y&&(t({...e,rules:[...e.rules||[],{...E(),...Y.rule}]}),T(!1))},z=V=>{if(!e)return;const Y=e.rules[V],K={...JSON.parse(JSON.stringify(Y)),name:`${Y.name} (copy)`},ee=[...e.rules];ee.splice(V+1,0,K),t({...e,rules:ee})},F=async V=>{b({open:!0,ruleIndex:V,loading:!0,action:""});try{const K=await(await fetch(`/api/notifications/rules/${V}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview"})})).json();y(K),b(ee=>({...ee,loading:!1}))}catch{y({success:!1,message:"Failed to get preview"}),b(Y=>({...Y,loading:!1}))}},$=async V=>{const Y=_.ruleIndex;b(K=>({...K,loading:!0,action:V}));try{const ee=await(await fetch(`/api/notifications/rules/${Y}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:V})})).json();y(ee),b(le=>({...le,loading:!1}))}catch{y({success:!1,message:`Failed to ${V}`}),b(K=>({...K,loading:!1}))}},Z=()=>{b({open:!1,ruleIndex:-1,loading:!1,action:""}),y(null)};return l?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?x.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[_.open&&x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:x.jsxs("div",{className:"bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[85vh] overflow-auto",children:[x.jsxs("div",{className:"p-4 border-b border-[#2a3a4a] flex items-center justify-between sticky top-0 bg-[#1a2332]",children:[x.jsx("h3",{className:"text-lg font-semibold",children:"Test Notification Rule"}),x.jsx("button",{onClick:Z,className:"text-slate-500 hover:text-slate-300",children:x.jsx(lu,{size:20})})]}),x.jsx("div",{className:"p-4 space-y-4",children:_.loading?x.jsxs("div",{className:"flex items-center justify-center py-8",children:[x.jsx(Mm,{size:20,className:"animate-spin text-slate-400 mr-2"}),x.jsx("div",{className:"text-slate-400",children:_.action?`${_.action.replace("_"," ").replace("send ","Sending ")}...`:"Loading current data..."})]}):m?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Current Data"}),m.live_data_summary&&m.live_data_summary.length>0?x.jsx("div",{className:"p-3 bg-slate-800/50 rounded space-y-1",children:m.live_data_summary.map((V,Y)=>x.jsx("div",{className:`text-sm font-mono ${V.startsWith("[!]")?"text-amber-400":""}`,children:V},Y))}):x.jsx("div",{className:"p-3 bg-slate-800/50 rounded text-sm text-slate-500",children:"No live data available for this rule's categories"})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Rule Matching"}),x.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[m.conditions_matched&&m.conditions_matched>0?x.jsxs("span",{className:"px-2 py-1 bg-green-500/20 text-green-400 rounded text-sm",children:[m.conditions_matched," condition",m.conditions_matched!==1?"s":""," match - this rule WOULD fire"]}):x.jsx("span",{className:"px-2 py-1 bg-slate-700 text-slate-400 rounded text-sm",children:"No conditions trigger this rule right now"}),m.conditions_below_threshold&&m.conditions_below_threshold>0&&x.jsxs("span",{className:"px-2 py-1 bg-yellow-500/20 text-yellow-400 rounded text-sm",children:[m.conditions_below_threshold," below threshold"]})]}),m.conditions_below_threshold&&m.conditions_below_threshold>0&&x.jsxs("div",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm space-y-2",children:[x.jsx("div",{className:"text-yellow-300",children:m.below_threshold_summary}),m.below_threshold_events&&m.below_threshold_events.length>0&&x.jsx("div",{className:"space-y-1 text-yellow-200/80",children:m.below_threshold_events.slice(0,3).map((V,Y)=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-500/20 rounded",children:V.severity}),x.jsx("span",{children:V.headline})]},Y))}),m.suggestion&&x.jsxs("div",{className:"text-yellow-400 text-xs mt-2",children:["Tip: ",m.suggestion]})]})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:m.is_example?"Example Messages":"Messages That Would Fire"}),(j=m.preview_messages)==null?void 0:j.map((V,Y)=>x.jsx("div",{className:"p-3 bg-slate-800 rounded text-sm font-mono break-words",children:V},Y))]}),m.delivered!==void 0&&m.delivery_result&&x.jsx("div",{className:`p-3 rounded text-sm ${m.delivered?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:x.jsxs("div",{className:"flex items-start gap-2",children:[m.delivered?x.jsx(nu,{size:16,className:"mt-0.5"}):x.jsx(lu,{size:16,className:"mt-0.5"}),x.jsxs("div",{children:[x.jsx("div",{children:m.delivery_result}),m.delivery_error&&x.jsx("div",{className:"mt-1 text-red-300",children:m.delivery_error})]})]})}),m.message&&!m.preview_messages&&x.jsx("div",{className:`p-3 rounded text-sm ${m.success?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:m.message})]}):null}),x.jsxs("div",{className:"p-4 border-t border-[#2a3a4a] flex justify-between sticky bottom-0 bg-[#1a2332]",children:[x.jsx("button",{onClick:Z,className:"px-4 py-2 text-slate-400 hover:text-slate-200",children:"Close"}),m&&!m.delivered&&x.jsx("div",{className:"flex gap-2",children:m.delivery_method?x.jsxs(x.Fragment,{children:[m.live_data_summary&&m.live_data_summary.length>0&&x.jsx("button",{onClick:()=>$("send_status"),disabled:_.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send current conditions summary",children:"Send Current Conditions"}),x.jsx("button",{onClick:()=>$("send_test"),disabled:_.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send example alert message",children:"Send Example Alert"}),m.can_send_live&&x.jsx("button",{onClick:()=>$("send_live"),disabled:_.loading,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm disabled:opacity-50",title:"Send actual live alert",children:"Send Live Alert"})]}):x.jsx("span",{className:"px-3 py-2 text-amber-400 text-sm",children:"Configure a delivery method to send test messages"})})]})]})}),x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("div",{children:x.jsx("p",{className:"text-sm text-slate-500",children:"Alert delivery and scheduled reports. Rules define what triggers a notification and where it gets sent."})}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("button",{onClick:P,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:x.jsx(Mm,{size:18})}),x.jsxs("button",{onClick:k,disabled:!C,className:"flex items-center gap-2 px-3 py-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[x.jsx(IS,{size:16}),"Discard"]}),x.jsxs("button",{onClick:I,disabled:c||!C,className:"flex items-center gap-2 px-4 py-2 bg-accent hover:bg-accent/80 disabled:bg-slate-700 disabled:cursor-not-allowed rounded text-white transition-colors",children:[x.jsx(tD,{size:16}),c?"Saving...":"Save"]})]})]}),h&&x.jsx("div",{className:"p-3 rounded-lg text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:h}),v&&x.jsxs("div",{className:"p-3 rounded-lg text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[x.jsx(nu,{size:14,className:"inline mr-2"}),v]}),x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6 space-y-6",children:[x.jsx(Jc,{label:"Enable Notifications",checked:e.enabled,onChange:V=>t({...e,enabled:V}),helper:"Master switch for all notification delivery",info:"When disabled, no alerts or scheduled messages will be delivered. Alerts still get recorded to history."}),e.enabled&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(dce,{size:14,className:"text-slate-400"}),x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Quiet Hours"})]}),x.jsx(Jc,{label:"Enable Quiet Hours",checked:e.quiet_hours_enabled??!0,onChange:V=>t({...e,quiet_hours_enabled:V}),helper:"Suppress non-emergency alerts during sleeping hours",info:"When enabled, ROUTINE alerts are suppressed during quiet hours. PRIORITY and IMMEDIATE always deliver."}),e.quiet_hours_enabled&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(Sc,{label:"Start Time",value:e.quiet_hours_start||"22:00",onChange:V=>t({...e,quiet_hours_start:V}),helper:"When quiet hours begin"}),x.jsx(Sc,{label:"End Time",value:e.quiet_hours_end||"06:00",onChange:V=>t({...e,quiet_hours_end:V}),helper:"When quiet hours end"})]}),x.jsx("p",{className:"text-xs text-slate-600",children:'Emergency alerts and rules with "Override Quiet Hours" enabled always deliver.'})]})]}),x.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[x.jsx("div",{className:"flex items-center gap-2",children:x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cold-start grace"})}),x.jsx(Gy,{label:"Grace period (seconds)",value:e.cold_start_grace_seconds??60,onChange:V=>t({...e,cold_start_grace_seconds:V}),min:0,max:600,helper:"Suppress broadcasts for this many seconds after the first event arrives",info:"When meshai starts seeing events for the first time, suppress mesh broadcasts for this many seconds to absorb any JetStream backlog. Persistence rows still get written; only broadcasts are suppressed."})]}),x.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[x.jsx("div",{className:"flex items-center gap-2",children:x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Band Conditions (HF propagation)"})}),x.jsx(Jc,{label:"Enable scheduled band-conditions broadcasts",checked:e.band_conditions_enabled??!0,onChange:V=>t({...e,band_conditions_enabled:V}),helper:"3x/day HF propagation summary (Day/Night ratings per band group)",info:"Source priority: (1) recent SWPC readings persisted locally; (2) HamQSL.com fallback; (3) silent skip if both fail. Persistence rows are written either way for an audit trail."}),(e.band_conditions_enabled??!0)&&x.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[x.jsx(Sc,{label:"Slot 1",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[0]||"06:00",onChange:V=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[0]=V,t({...e,band_conditions_schedule:Y})},helper:"Morning (default 06:00 MT)"}),x.jsx(Sc,{label:"Slot 2",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[1]||"14:00",onChange:V=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[1]=V,t({...e,band_conditions_schedule:Y})},helper:"Afternoon (default 14:00 MT)"}),x.jsx(Sc,{label:"Slot 3",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[2]||"22:00",onChange:V=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[2]=V,t({...e,band_conditions_schedule:Y})},helper:"Night (default 22:00 MT)"})]}),x.jsx("p",{className:"text-xs text-slate-600",children:"All times are Mountain Time (America/Boise). DST handled automatically."})]}),e.toggles&&x.jsx(cet,{toggles:e.toggles,onChange:V=>t({...e,toggles:V})}),x.jsxs("div",{className:"space-y-3",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",x.jsx(ia,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),x.jsxs("span",{className:"text-xs text-slate-500",children:[((U=e.rules)==null?void 0:U.length)||0," rule",(((G=e.rules)==null?void 0:G.length)||0)!==1?"s":""]})]}),(e.rules||[]).map((V,Y)=>x.jsx(oet,{rule:V,ruleIndex:Y,categories:i,regions:o,quietHoursEnabled:e.quiet_hours_enabled??!0,onChange:K=>{const ee=[...e.rules||[]];ee[Y]=K,t({...e,rules:ee})},onDelete:()=>{confirm(`Delete rule "${V.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((K,ee)=>ee!==Y)})},onDuplicate:()=>z(Y),onTest:()=>F(Y)},Y)),x.jsxs("div",{className:"flex gap-2",children:[x.jsxs("button",{onClick:D,className:"flex-1 py-3 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[x.jsx(LS,{size:16})," Add Rule"]}),x.jsxs("div",{className:"relative",children:[x.jsxs("button",{onClick:()=>T(!S),className:"py-3 px-4 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center gap-2 transition-colors",children:[x.jsx(LZ,{size:16})," Add from Template"]}),S&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(!1)}),x.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 w-80 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl overflow-hidden",children:[x.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),qU.map(V=>x.jsxs("button",{onClick:()=>N(V.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[x.jsx("div",{className:"font-medium text-slate-200",children:V.name}),x.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:V.description})]},V.id))]})]})]})]})]})]})]})]}):x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const JU=[{id:"stream-gauges",label:"Stream Gauges",icon:PZ},{id:"wildfire",label:"Wildfire",icon:AS},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:OS},{id:"weather-alerts",label:"Weather Alerts",icon:oce},{id:"solar",label:"Solar & Geomagnetic",icon:jZ},{id:"ducting",label:"Tropospheric Ducting",icon:Za},{id:"avalanche",label:"Avalanche Danger",icon:kS},{id:"traffic",label:"Traffic Flow",icon:CS},{id:"roads-511",label:"Road Conditions (511)",icon:AZ},{id:"mesh-health",label:"Mesh Health",icon:yv},{id:"notifications",label:"Notifications",icon:Am},{id:"commands",label:"Commands",icon:RZ},{id:"api",label:"API Reference",icon:sce}];function ir({color:e}){const t={green:"bg-green-500",yellow:"bg-yellow-500",orange:"bg-orange-500",red:"bg-red-500",black:"bg-slate-800 border border-slate-600"};return x.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function jt({headers:e,rows:t}){return x.jsx("div",{className:"overflow-x-auto my-4",children:x.jsxs("table",{className:"w-full text-sm",children:[x.jsx("thead",{children:x.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>x.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),x.jsx("tbody",{children:t.map((r,n)=>x.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>x.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function Rt({href:e,children:t}){return x.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",x.jsx(Cd,{size:12})]})}function Te({children:e}){return x.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function hl({children:e}){return x.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function $e({children:e}){return x.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function vi({id:e,title:t,children:r}){return x.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[x.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),x.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function het(){const e=mv(),[t,r]=W.useState(""),[n,i]=W.useState("stream-gauges"),a=W.useRef(null);W.useEffect(()=>{const l=e.hash.replace("#","");if(l&&JU.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=JU.filter(l=>l.label.toLowerCase().includes(t.toLowerCase())),s=l=>{i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"}),window.history.replaceState(null,"",`#${l}`)};return x.jsxs("div",{className:"flex h-full -m-6",children:[x.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[x.jsx("div",{className:"p-4 border-b border-border",children:x.jsxs("div",{className:"relative",children:[x.jsx(rD,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),x.jsx("input",{type:"text",value:t,onChange:l=>r(l.target.value),placeholder:"Search topics...",className:"w-full pl-9 pr-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent placeholder-slate-600"})]})}),x.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return x.jsxs("button",{onClick:()=>s(l.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm text-left transition-colors ${c?"text-accent bg-accent/10 border-l-2 border-accent":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover border-l-2 border-transparent"}`,children:[x.jsx(u,{size:16}),l.label]},l.id)})})]}),x.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:x.jsxs("div",{className:"max-w-4xl",children:[x.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),x.jsxs(vi,{id:"stream-gauges",title:"Stream Gauges",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),x.jsxs("p",{children:[x.jsx("strong",{children:"Water Level (Gage Height)"}),` — how high the water is, measured in feet. Important: this is NOT the depth of the river. It's the height above a fixed measuring point that's different at every gauge. A reading of "10 feet" at one gauge means something completely different than "10 feet" at another. You can only compare readings from the SAME gauge over time.`]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Flow (Discharge)"}),` — how much water is moving past the gauge, in cubic feet per second (CFS). Think of it as the river's "throughput." For scale:`]}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsx("li",{children:"A small creek: 50-200 CFS"}),x.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),x.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),x.jsx(Te,{children:"When Does It Flood?"}),x.jsxs("p",{children:["Flood levels are set by the ",x.jsx("strong",{children:"National Weather Service"}),', not USGS. NWS looks at each specific gauge location and decides "at what water level does the road flood? At what level do buildings get water?" Those levels are different everywhere.']}),x.jsxs("p",{children:[x.jsx("strong",{children:"Action Stage"})," — water is rising, time to start paying attention. Usually still inside the riverbanks."]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Minor Flood"})," — low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Moderate Flood"})," — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Major Flood"})," — widespread flooding. Many people evacuating. Serious property damage."]}),x.jsx("p",{children:"MeshAI automatically looks up the flood levels for your gauge from NWS when you add a site. Some remote gauges don't have flood levels assigned — for those, you set them manually if you know what water levels cause problems in your area."}),x.jsx(Te,{children:"Low Water / Drought"}),x.jsx("p",{children:`There's no official "drought stage" for most gauges. If you need to monitor low water (irrigation, fish habitat), set a manual low-water threshold based on what you know about your local river.`}),x.jsx(Te,{children:"Setting It Up"}),x.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:["Find your gauge at ",x.jsx(Rt,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),x.jsxs("li",{children:["Copy the site number (like ",x.jsx($e,{children:"13090500"}),")"]}),x.jsx("li",{children:"Add it in Config → Environmental → USGS"}),x.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),x.jsx("p",{children:"If NWS flood levels don't populate, your gauge may not have them. Set manual thresholds if you know your local conditions."}),x.jsx(Te,{children:"Learn More"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx(Rt,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," — find gauges near you"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," — flood forecasts and thresholds"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," — USGS explainer"]})]})]}),x.jsxs(vi,{id:"wildfire",title:"Wildfire",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:"MeshAI tracks active wildfire perimeters from the National Interagency Fire Center (NIFC). For each fire, you see the name, size, how much is contained, and how far it is from your mesh nodes."}),x.jsx(Te,{children:"Fire Size — How Big Is It?"}),x.jsx(jt,{headers:["Size","What That Means"],rows:[["10 acres","Small fire. Usually handled quickly by initial crews."],["100 acres","Notable fire. Active firefighting effort."],["1,000 acres","Large fire. Major resources being deployed."],["10,000+ acres","Very large fire. Multiple teams, aircraft, heavy equipment."],["100,000+ acres","Mega-fire. These make the national news."]]}),x.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),x.jsx(Te,{children:"Containment — Is It Under Control?"}),x.jsx("p",{children:"Containment means the percentage of the fire's edge where firefighters have built a control line (a cleared strip to stop the fire from spreading further). It does NOT mean the fire is out inside that line."}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx("strong",{children:"0-30%"})," — Essentially uncontrolled. The fire goes where it wants."]}),x.jsxs("li",{children:[x.jsx("strong",{children:"50%"})," — Good progress, but half the edge can still grow."]}),x.jsxs("li",{children:[x.jsx("strong",{children:"80%+"})," — Well controlled. Major growth unlikely."]}),x.jsxs("li",{children:[x.jsx("strong",{children:"100%"}),' — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),x.jsx(Te,{children:"How Far Away Should I Worry?"}),x.jsx(jt,{headers:["Distance","What To Do"],rows:[[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"red"})," Under 5 km (3 miles)"]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"orange"})," 5-15 km (3-10 miles)"]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"yellow"})," 15-30 km (10-20 miles)"]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"green"})," Over 30 km (20 miles)"]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),x.jsx("p",{children:"How fast can a fire travel? In grass with wind: up to 14 mph. In heavy timber: 1-6 mph. A fire 10 miles away could theoretically reach you in 1-2 hours under worst-case conditions, but typical spread is much slower."}),x.jsx(Te,{children:"Which Matters More — Size or Distance?"}),x.jsxs("p",{children:[x.jsx("strong",{children:"Distance is the immediate concern."})," A small uncontained fire 10 km away is more dangerous right now than a huge fire 50 km away. But big fires have more energy and can grow fast under wind shifts — keep watching them."]}),x.jsx(Te,{children:"Setting It Up"}),x.jsxs("p",{children:["Just configure your state code (like ",x.jsx($e,{children:"US-ID"})," for Idaho) in Config → Environmental → Fires. MeshAI polls NIFC every 10 minutes for active fires in that state and computes the distance to your mesh nodes automatically."]}),x.jsx(Te,{children:"Learn More"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx(Rt,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," — detailed incident information"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," — raw perimeter data"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," — preparedness guide"]})]})]}),x.jsxs(vi,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:`NASA's VIIRS satellites orbit the Earth and look for heat signatures on the ground. When they see something hot — a fire, a factory, a sunlit building — they flag it as a "hotspot." MeshAI checks these detections for your area.`}),x.jsxs("p",{children:[x.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",x.jsx("strong",{children:"hours before"})," official fire perimeters are mapped. If a new fire starts near your mesh, the satellite might see it before anyone on the ground reports it."]}),x.jsx(Te,{children:"Confidence — Is It Really a Fire?"}),x.jsx("p",{children:"Each detection gets a confidence rating:"}),x.jsx(jt,{headers:["Confidence","What It Means"],rows:[["High","Almost certainly a real fire. Strong heat signature."],["Nominal","Probably a real fire. Most actual fires get this rating."],["Low","Maybe a fire, maybe not. Could be a hot roof, sun reflecting off water, a factory, or a gas flare. Lots of false alarms."]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Recommendation"}),`: Set the filter to "Nominal + High." If you include "Low" you'll get alerts for every hot parking lot on a summer day.`]}),x.jsx(Te,{children:"FRP — How Intense Is It?"}),x.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),x.jsx(jt,{headers:["FRP","What It Probably Is"],rows:[["Under 5 MW","Hot surface, small agricultural burn, gas flare, or warm ground"],["5-50 MW","An actual fire — brush fire, grass fire, typical wildfire"],["50-300 MW","Intense fire — trees fully burning, active fire front"],["Over 300 MW","Extreme fire — major wildfire in full force"]]}),x.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),x.jsx(Te,{children:"New Ignition Detection"}),x.jsxs("p",{children:["MeshAI cross-references satellite hotspots against known NIFC fire perimeters. If a hotspot is NOT near any known fire, it gets flagged as a ",x.jsx("strong",{children:"potential new ignition"})," — maybe a new fire just started. These get elevated priority regardless of confidence level."]}),x.jsx(Te,{children:"Timing"}),x.jsxs("p",{children:["Satellite data arrives ",x.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",x.jsx("strong",{children:"6 times per day"}),` across all satellites, so there are multi-hour gaps. This is not real-time — it's "pretty recent."`]}),x.jsx(Te,{children:"Getting an API Key"}),x.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:["Go to ",x.jsx(Rt,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),x.jsx("li",{children:'Click "Get MAP_KEY"'}),x.jsx("li",{children:"Register for a free Earthdata account"}),x.jsx("li",{children:"Your key arrives by email"}),x.jsx("li",{children:"Enter it in Config → Environmental → FIRMS"})]}),x.jsx(Te,{children:"Learn More"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx(Rt,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," — see hotspots on a map"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," — how it works"]})]})]}),x.jsxs(vi,{id:"weather-alerts",title:"Weather Alerts",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories."}),x.jsx(Te,{children:"Alert Severity — How Serious Is It?"}),x.jsx(jt,{headers:["Severity","What It Means","Example"],rows:[["Extreme","Life-threatening. The most serious events.","Tornado Emergency, Hurricane Warning, Tsunami Warning"],["Severe","Dangerous. Take protective action.","Tornado Warning, Flash Flood Warning, Blizzard Warning, Red Flag Warning"],["Moderate","Be prepared. Could become dangerous.","Winter Weather Advisory, Wind Advisory, Flood Watch, Heat Advisory"],["Minor","Good to know. Probably won't hurt anyone.","Special Weather Statement, Air Quality Alert"]]}),x.jsx(Te,{children:"When Should I Act? (Urgency)"}),x.jsx(jt,{headers:["Urgency","What It Means"],rows:[["Immediate","Do something NOW"],["Expected","Do something within the hour"],["Future","Coming in the next several hours"],["Past","It's over — NWS is clearing the alert"]]}),x.jsx(Te,{children:"How Sure Are They? (Certainty)"}),x.jsx(jt,{headers:["Certainty","What It Means"],rows:[["Observed","It's happening right now. Verified."],["Likely","More than 50% chance"],["Possible","Could happen, but less than 50%"],["Unlikely","Probably won't, but mentioned for awareness"]]}),x.jsx(Te,{children:"These Are Separate Scales"}),x.jsx("p",{children:'A single alert has all three. A hurricane warning for next week is "Severe + Future + Likely." A tornado spotted on the ground is "Extreme + Immediate + Observed." An air quality advisory is "Minor + Expected + Possible."'}),x.jsx(Te,{children:"What Minimum Severity Should I Set?"}),x.jsx(jt,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything — high volume","Nothing"],[x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Moderate"})," ✓"]}),"Watches, Advisories, and Warnings","Special Weather Statements"],["Severe","Only Warnings — things happening NOW","Watches (which give you hours of advance warning)"],["Extreme","Only the rarest events","Most Tornado and Severe Thunderstorm Warnings"]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Moderate is recommended."})," It catches Watches (advance warning that conditions may worsen) and Advisories (conditions exist but aren't severe) while filtering out the informational stuff."]}),x.jsx(Te,{children:"Finding Your NWS Zone"}),x.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:["Go to ",x.jsx(Rt,{href:"https://www.weather.gov",children:"weather.gov"})]}),x.jsx("li",{children:"Enter your location"}),x.jsxs("li",{children:["Find your zone code at ",x.jsx(Rt,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),x.jsxs("li",{children:["Zone codes look like: ",x.jsx($e,{children:"IDZ016"}),", ",x.jsx($e,{children:"UTZ040"}),", etc."]})]}),x.jsx(Te,{children:"The User-Agent Field"}),x.jsx("p",{children:"NWS wants to know who's using their API — not for approval, just so they can contact you if something breaks. You make it up:"}),x.jsx("p",{children:x.jsx($e,{children:"(meshai, you@email.com)"})}),x.jsx("p",{children:"No registration. No waiting. Just type it in."}),x.jsx(Te,{children:"Learn More"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx(Rt,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," — see current alerts"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," — technical details"]})]})]}),x.jsxs(vi,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:"MeshAI tracks space weather — solar activity and its effects on Earth's magnetic field. This matters for radio operators because the sun directly controls how well HF radio works, and major solar events can affect all radio communications."}),x.jsx(Te,{children:"Solar Flux Index (SFI)"}),x.jsx("p",{children:'Think of SFI as a "how active is the sun" number. Higher = better for HF radio, but also higher risk of solar flares.'}),x.jsx(jt,{headers:["SFI","What It Means for You"],rows:[["Below 70","Quiet sun. Higher HF bands (10m, 15m) are probably dead. Stick to lower bands."],["70-90","Getting better. Some openings on 15m and above, but inconsistent."],["90-120","Good. Most HF bands work. Reliable contacts on 20m and 15m."],["120-170","Great. All HF bands open. 10m works for worldwide contacts."],["Above 170","Excellent. Best HF conditions — but watch for flares."]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),x.jsx(Te,{children:"Kp Index"}),x.jsx("p",{children:"Kp measures how disturbed Earth's magnetic field is, on a 0-9 scale. Higher = more disturbance = worse for HF radio but better for aurora viewing."}),x.jsx(jt,{headers:["Kp","What It Means for You"],rows:[["0-2","Quiet. Best HF conditions."],["3","Slightly unsettled. You probably won't notice."],["4","Active. Some noise and fading on HF, especially if you're at higher latitudes."],[x.jsx("strong",{children:"5"}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60°N)."]})],[x.jsx("strong",{children:"6"}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55°N)."]})],[x.jsx("strong",{children:"7"}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[x.jsx("strong",{children:"8-9"}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),x.jsx(Te,{children:"R / S / G Scales"}),x.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),x.jsx(hl,{children:"R (Radio Blackouts) — from solar flares:"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),x.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),x.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),x.jsx(hl,{children:"S (Solar Radiation Storms) — from energetic particles:"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsx("li",{children:"Mostly affects polar regions and satellites"}),x.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),x.jsx(hl,{children:"G (Geomagnetic Storms) — from solar wind disturbances:"}),x.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:x.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),x.jsx(Te,{children:"Bz — The Storm Predictor"}),x.jsx("p",{children:"Bz measures the direction of the solar wind's magnetic field. When it points south (negative values), the solar wind can dump energy into Earth's magnetic field, causing storms."}),x.jsx(jt,{headers:["Bz","What It Means"],rows:[["Positive","All good. Solar wind bouncing off."],["0 to -5","Slight coupling. Nothing dramatic."],["-5 to -10","Things starting to pick up. Storm possible."],["Below -10","Storm likely. Kp will start climbing."],["Below -20","Severe storm probable."]]}),x.jsx("p",{children:"Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips."}),x.jsx(Te,{children:"Learn More"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx(Rt,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," — live data"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," — what R/S/G mean"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," — ham-friendly display"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," — live Kp"]})]})]}),x.jsxs(vi,{id:"ducting",title:"Tropospheric Ducting",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:'Sometimes the atmosphere creates an invisible "pipe" that traps radio signals and carries them much farther than normal. This is called tropospheric ducting. It mostly affects VHF and UHF frequencies.'}),x.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),x.jsx(Te,{children:"How Do I Know If Ducting Is Happening?"}),x.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),x.jsx(jt,{headers:["Condition","What It Means"],rows:[["Normal","Standard propagation. Nothing unusual."],["Super-refraction","Slightly enhanced range. You might hear a few more distant stations than usual."],["Surface Duct","Radio signals trapped near the ground. You may hear stations hundreds of km away that you've never heard before."],["Elevated Duct",'Same effect but the "pipe" is up in the atmosphere. Affects signals passing through that altitude.']]}),x.jsx(Te,{children:"What You'll Actually Notice"}),x.jsx("p",{children:"When ducting happens on your mesh:"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),x.jsx("li",{children:"Nodes appear from far outside your normal range"}),x.jsx("li",{children:"You hear FM radio stations from other cities"}),x.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),x.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),x.jsx(Te,{children:"The dM/dz Number"}),x.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:`}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"Below -50"})," = strong ducting — classic VHF/UHF DX event"]})]}),x.jsx(Te,{children:"When Does Ducting Happen?"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),x.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),x.jsx("li",{children:"Most common in late summer and early fall"}),x.jsx("li",{children:"Strongest along coastlines and over water"}),x.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),x.jsx(Te,{children:"Setting It Up"}),x.jsx("p",{children:"Just configure the latitude and longitude of the center of your mesh area in Config → Environmental → Ducting. MeshAI checks the atmospheric conditions there every 3 hours using free weather model data. No API key needed."}),x.jsx(Te,{children:"Learn More"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx(Rt,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," — 6-day tropo prediction"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://dxmaps.com",children:"DX Maps"})," — real-time VHF/UHF propagation reports"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," — background"]})]})]}),x.jsxs(vi,{id:"avalanche",title:"Avalanche Danger",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:"MeshAI pulls avalanche forecasts from your regional avalanche center during winter months. The danger scale has 5 levels and it's the same across all of North America."}),x.jsx(Te,{children:"The Danger Scale"}),x.jsx(jt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",x.jsx(ir,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",x.jsx(ir,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",x.jsx(ir,{color:"orange"}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"DANGEROUS."}),` This is where most people die in avalanches — they see "3 out of 5" and think it's fine. It's not. Use extreme caution.`]})],["4","High",x.jsx(ir,{color:"red"}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",x.jsx(ir,{color:"black"}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),x.jsx(Te,{children:"The Most Important Thing to Know"}),x.jsxs("p",{children:[x.jsx("strong",{children:"Level 3 (Considerable) kills more people than any other level."}),' People look at "3 out of 5" and think "middle of the road, probably okay." In reality, the risk roughly doubles at each step up the scale. Level 3 is where dangerous conditions overlap with people thinking they can handle it.']}),x.jsx(Te,{children:"Seasonal"}),x.jsx("p",{children:'MeshAI only checks avalanche conditions during winter months (configurable, default December through April). Outside season, it shows "off season" and saves API calls.'}),x.jsx(Te,{children:"Finding Your Avalanche Center"}),x.jsxs("p",{children:["Go to ",x.jsx(Rt,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx($e,{children:"SNFAC"})," — Sawtooth (central Idaho)"]}),x.jsxs("li",{children:[x.jsx($e,{children:"UAC"})," — Utah"]}),x.jsxs("li",{children:[x.jsx($e,{children:"NWAC"})," — Cascades/Olympics (WA/OR)"]}),x.jsxs("li",{children:[x.jsx($e,{children:"CAIC"})," — Colorado"]}),x.jsxs("li",{children:[x.jsx($e,{children:"SAC"})," — Sierra Nevada (CA)"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GNFAC"})," — Gallatin (SW Montana)"]})]}),x.jsx(Te,{children:"Learn More"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx(Rt,{href:"https://avalanche.org",children:"Avalanche.org"})," — US forecasts"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," — full scale explanation"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://kbyg.org",children:"Know Before You Go"})," — avalanche awareness"]})]})]}),x.jsxs(vi,{id:"traffic",title:"Traffic Flow",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),x.jsx(Te,{children:"Speed Ratio — The Key Number"}),x.jsx("p",{children:'MeshAI compares current speed to "free-flow speed" (what traffic normally does when the road is empty). The ratio tells you how congested it is:'}),x.jsx(jt,{headers:["Ratio","What It Means"],rows:[[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Note"}),`: "free-flow speed" is NOT the speed limit. It's what traffic actually does on that road when nobody's in the way. Drivers often exceed speed limits on open highways.`]}),x.jsx(Te,{children:"Confidence — Can You Trust the Data?"}),x.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),x.jsx(jt,{headers:["Confidence","What It Means"],rows:[["Above 0.9","Very reliable — lots of real-time probe data"],["0.7-0.9","Good — mix of real-time and historical"],["Below 0.7",x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Unreliable"})," — mostly guessing from historical patterns. Don't alert on this."]})]]}),x.jsx("p",{children:"Set minimum confidence to 0.7 to avoid false congestion alerts at night or on rural roads where few probe vehicles drive."}),x.jsx(Te,{children:"Setting Up Corridors"}),x.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),x.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[x.jsx("li",{children:"Go to Google Maps, find the road"}),x.jsx("li",{children:`Right-click the road → "What's here?" → copy the coordinates`}),x.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),x.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),x.jsx(Te,{children:"Getting an API Key"}),x.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:["Sign up at ",x.jsx(Rt,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),x.jsx("li",{children:"Create an app → get your API key"}),x.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),x.jsx(Te,{children:"Learn More"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx(Rt,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," — API docs and key signup"]}),x.jsxs("li",{children:[x.jsx(Rt,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," — city congestion rankings"]})]})]}),x.jsxs(vi,{id:"roads-511",title:"Road Conditions (511)",children:[x.jsx(Te,{children:"What You're Looking At"}),x.jsx("p",{children:"511 systems report road closures, construction, weather events, mountain pass conditions, and incidents. Every state runs their own 511 system — there is no national API."}),x.jsx(Te,{children:"Setting It Up"}),x.jsx("p",{children:"You need to find YOUR state's 511 developer API. MeshAI does not include a default URL because every state is different. Some states have free public APIs, some require registration, and some don't have developer APIs at all."}),x.jsx("p",{children:"Configure in Config → Environmental → 511:"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx("strong",{children:"Base URL"})," — your state's API endpoint"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"API Key"})," — if required by your state"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"Endpoints"})," — which data feeds to poll (varies by state)"]})]}),x.jsx(Te,{children:"Learn More"}),x.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),x.jsxs(vi,{id:"mesh-health",title:"Mesh Health",children:[x.jsx(Te,{children:"Health Score"}),x.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:"}),x.jsx(jt,{headers:["Pillar","Weight","What It Measures"],rows:[[x.jsx("strong",{children:"Infrastructure"}),"30%","Are your routers online?"],[x.jsx("strong",{children:"Utilization"}),"25%","Is the radio channel congested?"],[x.jsx("strong",{children:"Coverage"}),"20%","Do nodes have redundant paths to gateways?"],[x.jsx("strong",{children:"Behavior"}),"15%","Are any nodes flooding the channel?"],[x.jsx("strong",{children:"Power"}),"10%","Are battery-powered nodes running low?"]]}),x.jsx("p",{children:"The overall score is the weighted sum:"}),x.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"Score = (Infrastructure × 30%) + (Utilization × 25%) + (Coverage × 20%) + (Behavior × 15%) + (Power × 10%)"}),x.jsx(Te,{children:"How Each Pillar Is Calculated"}),x.jsx(hl,{children:"Infrastructure (30%)"}),x.jsx("p",{children:"This is the simplest pillar — what percentage of your infrastructure nodes are currently online?"}),x.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"(routers online ÷ total routers) × 100"}),x.jsxs("p",{children:["Only nodes with the ",x.jsx($e,{children:"ROUTER"}),", ",x.jsx($e,{children:"ROUTER_LATE"}),", or ",x.jsx($e,{children:"ROUTER_CLIENT"})," role count as infrastructure. Regular client nodes going offline doesn't affect this score. If you have 5 routers and 3 are online, infrastructure scores 60."]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Special case:"})," If you have no routers at all (all clients), this pillar scores 100. You're not penalized for not having infrastructure — you just don't have any to track."]}),x.jsx(hl,{children:"Utilization (25%)"}),x.jsxs("p",{children:["MeshAI reads the channel utilization that each router reports in its telemetry — this is the firmware's own measurement of how busy the radio channel is. MeshAI uses the ",x.jsx("strong",{children:"highest"})," value from any infrastructure node because the busiest router is the bottleneck for the whole mesh."]}),x.jsx("p",{children:x.jsx("strong",{children:"How it works:"})}),x.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-4",children:[x.jsxs("li",{children:["Collect ",x.jsx($e,{children:"channel_utilization"})," from all infrastructure nodes that report it"]}),x.jsx("li",{children:"If no infra nodes have telemetry, try all nodes"}),x.jsxs("li",{children:["Use the ",x.jsx("strong",{children:"maximum"})," value for scoring (busiest node = bottleneck)"]}),x.jsx("li",{children:"If no nodes report utilization (older firmware), fall back to packet count estimate"})]}),x.jsxs("p",{className:"mt-4",children:[x.jsx("strong",{children:"Fallback method"})," (when telemetry unavailable): estimates from packet counts using 200ms/packet airtime. This is less accurate — it assumes MediumFast preset and sums packets across all nodes."]}),x.jsx(jt,{headers:["Channel Utilization","Score","What It Means"],rows:[["Under 20%","100","Channel is clear — this is the goal"],["20-25%","75-100","Slight degradation, occasional collisions"],["25-35%","50-75","Severe degradation — firmware throttling active"],["35-45%","25-50","Mesh struggling badly — reliability dropping"],["Over 45%","0-25","Mesh is effectively unusable"]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Special case:"})," If no utilization data is available (no telemetry and no packet data), this pillar scores 100. You're not penalized for missing data."]}),x.jsx(hl,{children:"Coverage (20%)"}),x.jsx("p",{children:'Measures gateway redundancy — how many of your data sources can "see" each node. A node reported by all 3 of your gateways has full coverage. A node only seen by 1 gateway is a single point of failure.'}),x.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["coverage_ratio = average_gateways_per_node ÷ total_sources",x.jsx("br",{}),"single_gw_penalty = (single_gateway_nodes ÷ total_nodes) × 40"]}),x.jsx("p",{children:"If a node is seen by 2 out of 3 sources, its coverage ratio is 0.67. Infrastructure nodes with only single-gateway coverage get an extra penalty — they're critical but have no backup path."}),x.jsx(jt,{headers:["Coverage Ratio","Base Score","After Penalty"],rows:[["100% (all sources)","100","100 minus single-gw penalty"],["70-99%","90","Minus penalties"],["50-69%","70","Minus penalties"],["Under 50%","50 or less","Heavy penalty"]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Special case:"})," With only 1 data source, this pillar can't score well — there's no redundancy to measure. Coverage becomes meaningful when you have 2+ sources (MeshMonitor + MQTT, multiple gateways, etc.)."]}),x.jsx(hl,{children:"Behavior (15%)"}),x.jsx("p",{children:"Counts how many nodes are sending an unusually high number of non-text packets. This catches firmware bugs, stuck transmitters, and misconfigured nodes that are flooding the channel."}),x.jsxs("p",{children:[x.jsx("strong",{children:"What counts as flooding:"})," More than 500 non-text packets in 24 hours. Text messages don't count — the behavior pillar only flags telemetry, position, and routing packet floods."]}),x.jsx(jt,{headers:["Flagged Nodes","Score"],rows:[["0","100"],["1","80"],["2-3","60"],["4-5","40"],["6+","20"]]}),x.jsx("p",{children:"A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar."}),x.jsx(hl,{children:"Power (10%)"}),x.jsx("p",{children:"Measures what fraction of battery-powered nodes are below the warning threshold (default 20%)."}),x.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"100 × (1 − low_battery_nodes ÷ total_battery_nodes)"}),x.jsx("p",{children:"If 2 out of 10 battery nodes are below 20%, power scores 80."}),x.jsxs("p",{children:[x.jsx("strong",{children:"Important:"})," USB-powered nodes are excluded from this calculation. Many nodes report 100% battery even when running on wall power with no battery installed. Only nodes actually running on batteries affect this pillar."]}),x.jsx(Te,{children:"Health Tiers"}),x.jsx(jt,{headers:["Score","Tier","What It Means"],rows:[["90-100",x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),x.jsx(Te,{children:"Channel Utilization — Is the Radio Channel Full?"}),x.jsx("p",{children:"Meshtastic radios share one LoRa channel. If too many nodes are transmitting too often, they step on each other and messages get lost."}),x.jsx(jt,{headers:["Utilization","What's Happening"],rows:[[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target."],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[x.jsxs(x.Fragment,{children:[x.jsx(ir,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),x.jsx(Te,{children:"Packet Flooding"}),x.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:x.jsx("strong",{children:'⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),x.jsx("p",{children:"A normal Meshtastic node sends a packet every few minutes (announcing itself, reporting telemetry, updating position). If a node starts blasting packets every few seconds, something is wrong — firmware bug, stuck transmitter, or misconfiguration."}),x.jsx(jt,{headers:["Packets per Minute","What It Means"],rows:[["1-5","Normal"],["5-10","Elevated — might be someone chatting a lot"],["10-20","Suspicious — worth investigating"],["Over 30","Something is broken. This node is actively hurting the mesh."]]}),x.jsx(Te,{children:"Battery Levels"}),x.jsx("p",{children:"Most Meshtastic radios (T-Beam, RAK4631, Heltec V3) use a single lithium battery cell. The voltage tells you how much charge is left:"}),x.jsx(jt,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[x.jsx("strong",{children:"3.60V"}),x.jsx("strong",{children:"~30%"}),x.jsx(x.Fragment,{children:x.jsx("strong",{children:"⚠️ Warning — charge it soon"})})],[x.jsx("strong",{children:"3.50V"}),x.jsx("strong",{children:"~15%"}),x.jsx(x.Fragment,{children:x.jsx("strong",{children:"🔴 Low — charge it now"})})],[x.jsx("strong",{children:"3.40V"}),x.jsx("strong",{children:"~7%"}),x.jsx(x.Fragment,{children:x.jsx("strong",{children:"⚫ About to die"})})],["3.30V","~3%","Device shutting down"]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"USB-powered nodes"})," report 100% battery even if there's no battery installed. Battery alerts only matter for nodes actually running on battery power."]}),x.jsx(Te,{children:"Node Offline Detection"}),x.jsx("p",{children:`MeshAI marks a node as "offline" when it hasn't been heard for a configurable time period. Different node types need different thresholds:`}),x.jsx(jt,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",x.jsx("strong",{children:"2 hours"}),"These should always be transmitting. 2 hours of silence means something is wrong."],["Fixed client (wall power)","2-4 hours","Same logic, slightly more lenient."],["Mobile / vehicle","4-8 hours","They go behind mountains, into garages, out of range. Normal."],["Solar-powered","12-24 hours","May shut down at night when solar stops charging."]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Rule of thumb"}),`: set the threshold to about 4× the node's beacon interval. Too tight and nodes will constantly flap "offline/online" from normal gaps. Too loose and real outages go unnoticed.`]})]}),x.jsxs(vi,{id:"notifications",title:"Notifications",children:[x.jsx(Te,{children:"How It Works"}),x.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx("strong",{children:"Something happens"})," — a fire is detected, weather warning issued, node goes offline, etc."]}),x.jsxs("li",{children:[x.jsx("strong",{children:"MeshAI checks your rules"})," — does this event match any of your notification rules? Is it severe enough? Are we in quiet hours?"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"If a rule matches"})," — MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),x.jsx(Te,{children:"Building Rules"}),x.jsx("p",{children:"Each rule answers three questions:"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),x.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),x.jsx(Te,{children:"Severity Levels — What Should I Set?"}),x.jsx(jt,{headers:["Level","When It's Used","Notification Volume"],rows:[["Info","Routine stuff (ducting detected, new router appeared)","High — lots of messages"],["Advisory","Worth knowing (weather advisory, slow traffic, battery declining)","Moderate"],["Watch","Pay attention (fire within 50km, weather watch, stream rising)","Low-moderate"],[x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Warning"})," ✓"]}),"Take action (fire within 15km, severe weather, critical battery)","Low — recommended for most rules"],["Emergency","Life safety (extreme weather, fire at infrastructure, total blackout)","Very rare"]]}),x.jsxs("p",{children:[x.jsx("strong",{children:'"Warning" is the sweet spot for most rules.'})," You get alerted when something actually needs your attention without being overwhelmed by every minor event."]}),x.jsx(Te,{children:"Quiet Hours"}),x.jsx("p",{children:'When enabled, non-emergency notifications are held during sleeping hours (default 10pm-6am). Emergency alerts and rules marked "Override Quiet Hours" always get through.'}),x.jsx("p",{children:"You can turn quiet hours off entirely if you don't want them."}),x.jsx(Te,{children:"Webhook — The Swiss Army Knife"}),x.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx("strong",{children:"Discord"})," — use a Discord webhook URL"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"Slack"})," — use a Slack incoming webhook URL"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"ntfy.sh"})," — POST to ",x.jsx($e,{children:"https://ntfy.sh/your-topic"})]}),x.jsxs("li",{children:[x.jsx("strong",{children:"Pushover"})," — POST to the Pushover API"]}),x.jsxs("li",{children:[x.jsx("strong",{children:"Home Assistant"})," — POST to an automation webhook URL"]}),x.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),x.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),x.jsxs(vi,{id:"commands",title:"Commands",children:[x.jsxs("p",{children:["All commands use the ",x.jsx($e,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),x.jsx(Te,{children:"Basic Commands"}),x.jsx(jt,{headers:["Command","What It Does"],rows:[[x.jsx($e,{children:"!help"}),"Shows all available commands"],[x.jsx($e,{children:"!ping"}),"Tests if the bot is alive"],[x.jsx($e,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[x.jsx($e,{children:"!health"}),"Detailed health report with pillar scores"],[x.jsx($e,{children:"!weather"}),"Current weather for your area"]]}),x.jsx(Te,{children:"Environmental Commands"}),x.jsx(jt,{headers:["Command","What It Does"],rows:[[x.jsx($e,{children:"!alerts"}),"Active NWS weather alerts for your area"],[x.jsxs(x.Fragment,{children:[x.jsx($e,{children:"!solar"})," (or ",x.jsx($e,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[x.jsx($e,{children:"!fire"}),"Active wildfires near your mesh"],[x.jsx($e,{children:"!avy"}),'Avalanche advisory (seasonal — shows "off season" in summer)'],[x.jsxs(x.Fragment,{children:[x.jsx($e,{children:"!streams"})," (or ",x.jsx($e,{children:"!gauges"}),")"]}),"Stream gauge readings"],[x.jsxs(x.Fragment,{children:[x.jsx($e,{children:"!roads"})," (or ",x.jsx($e,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[x.jsx($e,{children:"!hotspots"}),"Satellite fire detections"]]}),x.jsx(Te,{children:"Subscription Commands"}),x.jsx(jt,{headers:["Command","What It Does"],rows:[[x.jsx($e,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[x.jsx($e,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[x.jsx($e,{children:"!subscribe all"}),"Subscribe to everything"],[x.jsx($e,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[x.jsx($e,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),x.jsx(Te,{children:"Conversational"}),x.jsx("p",{children:`MeshAI isn't just commands — you can ask it questions in plain English. "How's the mesh doing?" "Is there any ducting?" "What's the fire situation?" "How's traffic on I-84?" It uses the live environmental data and mesh health data to answer.`})]}),x.jsxs(vi,{id:"api",title:"API Reference",children:[x.jsxs("p",{children:["MeshAI's REST API is available at ",x.jsx($e,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),x.jsx(Te,{children:"System"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/status"})," — version, uptime, node count"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/channels"})," — radio channel list"]}),x.jsxs("li",{children:[x.jsx($e,{children:"POST /api/restart"})," — restart the bot"]})]}),x.jsx(Te,{children:"Mesh Data"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/health"})," — health score and pillars"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/nodes"})," — all nodes with positions and telemetry"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/edges"})," — neighbor links with signal quality"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/regions"})," — region summaries"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/sources"})," — data source health"]})]}),x.jsx(Te,{children:"Configuration"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/config"})," — full config"]}),x.jsxs("li",{children:[x.jsxs($e,{children:["GET /api/config/","{section}"]})," — one section"]}),x.jsxs("li",{children:[x.jsxs($e,{children:["PUT /api/config/","{section}"]})," — update a section"]})]}),x.jsx(Te,{children:"Environmental"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/env/status"})," — per-feed health"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/env/active"})," — all active events"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/env/swpc"})," — solar/geomagnetic data"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/env/ducting"})," — atmospheric profile"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/env/fires"})," — wildfire perimeters"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/env/hotspots"})," — satellite fire detections"]})]}),x.jsx(Te,{children:"Alerts"}),x.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/alerts/active"})," — current alerts"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/alerts/history"})," — past alerts"]}),x.jsxs("li",{children:[x.jsx($e,{children:"GET /api/notifications/categories"})," — available alert categories"]})]}),x.jsx(Te,{children:"Real-time"}),x.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:x.jsxs("li",{children:[x.jsx($e,{children:"ws://your-host:8080/ws/live"})," — WebSocket for live updates"]})})]})]})})]})}const det=1500;function vet(){const[e,t]=W.useState({}),[r,n]=W.useState({}),[i,a]=W.useState(!0),[o,s]=W.useState(null),[l,u]=W.useState({}),[c,f]=W.useState({}),[h,d]=W.useState({}),v=W.useCallback(async()=>{a(!0),s(null);try{const[S,T]=await Promise.all([fetch("/api/adapter-config"),fetch("/api/adapter-meta")]);if(!S.ok)throw new Error(`GET /adapter-config: ${S.status}`);if(!T.ok)throw new Error(`GET /adapter-meta: ${T.status}`);t(await S.json()),n(await T.json())}catch(S){s(String(S))}finally{a(!1)}},[]);W.useEffect(()=>{v()},[v]);const g=W.useCallback((S,T,C)=>{f(A=>({...A,[S]:T})),C&&d(A=>({...A,[S]:C})),T==="saved"&&setTimeout(()=>{f(A=>A[S]==="saved"?{...A,[S]:"idle"}:A)},det)},[]),m=W.useCallback(async(S,T,C)=>{const A=`${S}.${T}`;g(A,"saving");try{const P=await fetch(`/api/adapter-config/${S}/${T}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:C})});if(!P.ok){const E=(await P.json().catch(()=>({}))).detail||P.statusText;g(A,"error",String(E));return}const I=await P.json();t(k=>({...k,[S]:(k[S]||[]).map(E=>E.key===T?I:E)})),g(A,"saved")}catch(P){g(A,"error",String(P))}},[g]),y=W.useCallback(async(S,T)=>{const C=`${S}.${T}`;g(C,"saving");try{const A=await fetch(`/api/adapter-config/${S}/${T}/reset`,{method:"POST"});if(!A.ok){g(C,"error",`reset failed (${A.status})`);return}const P=await A.json();t(I=>({...I,[S]:(I[S]||[]).map(k=>k.key===T?P:k)})),g(C,"saved")}catch(A){g(C,"error",String(A))}},[g]),_=W.useCallback(async(S,T)=>{const C=`meta:${S}`;g(C,"saving");try{const A=await fetch(`/api/adapter-meta/${S}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!A.ok){const I=await A.json().catch(()=>({}));g(C,"error",String(I.detail||A.statusText));return}const P=await A.json();n(I=>({...I,[S]:P})),g(C,"saved")}catch(A){g(C,"error",String(A))}},[g]);if(i)return x.jsxs("div",{className:"p-6 flex items-center gap-2 text-slate-400",children:[x.jsx(OZ,{className:"w-5 h-5 animate-spin"})," Loading adapter config…"]});if(o)return x.jsxs("div",{className:"p-6 text-red-400",children:[x.jsx(au,{className:"w-5 h-5 inline mr-2"}),"Failed to load: ",o]});const b=Array.from(new Set([...Object.keys(r),...Object.keys(e)])).sort();return x.jsxs("div",{className:"p-6 space-y-4",children:[x.jsxs("div",{className:"flex items-center gap-2 text-slate-200",children:[x.jsx(NZ,{className:"w-5 h-5"}),x.jsx("h1",{className:"text-xl font-semibold",children:"Adapter Config"}),x.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[Object.values(e).reduce((S,T)=>S+T.length,0)," settings across ",b.length," adapters"]})]}),x.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:"Per-adapter tunables (thresholds, freshness windows, toggles, curation lists). Changes take effect on the next handler call -- no container restart needed. Sentence templates, emoji, and translation maps live in code by design."}),b.map(S=>{const T=r[S]||{display_name:S,include_in_llm_context:!0,description:""},C=e[S]||[],A=l[S]??!1,P=`meta:${S}`,I=c[P]||"idle";return x.jsxs("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg",children:[x.jsxs("div",{className:"p-4 flex items-start gap-4",children:[x.jsx("button",{onClick:()=>u(k=>({...k,[S]:!k[S]})),className:"text-slate-400 hover:text-white","aria-label":"toggle expand",children:A?x.jsx(yu,{className:"w-5 h-5"}):x.jsx(iu,{className:"w-5 h-5"})}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("h2",{className:"text-base font-semibold text-slate-100",children:T.display_name}),x.jsx("code",{className:"text-xs text-slate-500",children:S}),C.length>0&&x.jsxs("span",{className:"text-xs text-slate-400 ml-1",children:["(",C.length," settings)"]}),C.length===0&&x.jsx("span",{className:"text-xs text-slate-500 ml-1 italic",children:"(meta only)"})]}),T.description&&x.jsx("p",{className:"text-xs text-slate-400 mt-1",children:T.description})]}),x.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-300 select-none",children:[x.jsx("input",{type:"checkbox",checked:T.include_in_llm_context,onChange:k=>_(S,{include_in_llm_context:k.target.checked}),className:"w-4 h-4 accent-cyan-500"}),"LLM context",x.jsx(eae,{status:I,error:h[P]})]})]}),A&&C.length>0&&x.jsx("div",{className:"border-t border-slate-700 divide-y divide-slate-700/60",children:C.map(k=>x.jsx(pet,{row:k,status:c[`${S}.${k.key}`]||"idle",error:h[`${S}.${k.key}`],onCommit:E=>m(S,k.key,E),onReset:()=>y(S,k.key)},k.key))})]},S)})]})}function pet({row:e,status:t,error:r,onCommit:n,onReset:i}){const[a,o]=W.useState(yP(e));W.useEffect(()=>{o(yP(e))},[e.value,e.type]);const s=a!==yP(e),l=JSON.stringify(e.value)===JSON.stringify(e.default),u=()=>{const c=get(a,e.type);c.error||c.changed(e.value)&&n(c.value)};return x.jsxs("div",{className:"px-6 py-3 flex items-start gap-4",children:[x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("code",{className:"text-sm font-mono text-cyan-300",children:e.key}),x.jsxs("span",{className:"text-xs text-slate-500",children:["[",e.type,"]"]}),!l&&x.jsx("span",{className:"text-xs text-amber-400",children:"edited"})]}),e.description&&x.jsx("p",{className:"text-xs text-slate-400 mt-1",children:e.description})]}),x.jsxs("div",{className:"flex items-center gap-2 min-w-[280px] justify-end",children:[e.type==="bool"?x.jsx("input",{type:"checkbox",checked:e.value===!0,onChange:c=>n(c.target.checked),className:"w-5 h-5 accent-cyan-500"}):e.type==="json"?x.jsx("textarea",{className:"w-72 h-20 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-xs font-mono text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u}):x.jsx("input",{type:e.type==="int"||e.type==="float"?"number":"text",step:e.type==="float"?"any":"1",className:"w-48 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-sm text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()}}),x.jsx(eae,{status:t,error:r,dirty:s}),x.jsx("button",{onClick:i,disabled:l,className:"text-slate-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset to default",children:x.jsx(IS,{className:"w-4 h-4"})})]})]})}function eae({status:e,error:t,dirty:r}){return e==="saving"?x.jsx(OZ,{className:"w-4 h-4 text-cyan-400 animate-spin"}):e==="saved"?x.jsx(nu,{className:"w-4 h-4 text-emerald-400"}):e==="error"?x.jsx("span",{title:t,className:"text-red-400 cursor-help",children:x.jsx(au,{className:"w-4 h-4"})}):r?x.jsx("span",{className:"w-2 h-2 bg-amber-400 rounded-full",title:"unsaved"}):x.jsx("span",{className:"w-4 h-4"})}function yP(e){return e.type==="bool"?String(e.value===!0):e.type==="json"?JSON.stringify(e.value,null,2):e.value===null||e.value===void 0?"":String(e.value)}function get(e,t){if(t==="int"){const r=Number(e);return!Number.isFinite(r)||!Number.isInteger(r)?{error:"expected integer",value:null,changed:()=>!1}:{error:null,value:r,changed:n=>n!==r}}if(t==="float"){const r=Number(e);return Number.isFinite(r)?{error:null,value:r,changed:n=>n!==r}:{error:"expected number",value:null,changed:()=>!1}}if(t==="str")return{error:null,value:e,changed:r=>r!==e};if(t==="json")try{const r=JSON.parse(e);return{error:null,value:r,changed:n=>JSON.stringify(n)!==JSON.stringify(r)}}catch{return{error:"invalid JSON",value:null,changed:()=>!1}}return{error:null,value:e,changed:()=>!0}}function met(){return x.jsx(Pce,{children:x.jsx(Ice,{children:x.jsxs(zue,{children:[x.jsx(os,{path:"/",element:x.jsx(cNe,{})}),x.jsx(os,{path:"/mesh",element:x.jsx(MQe,{})}),x.jsx(os,{path:"/environment",element:x.jsx(KQe,{})}),x.jsx(os,{path:"/config",element:x.jsx(ZQe,{})}),x.jsx(os,{path:"/alerts",element:x.jsx(aet,{})}),x.jsx(os,{path:"/notifications",element:x.jsx(fet,{})}),x.jsx(os,{path:"/reference",element:x.jsx(het,{})}),x.jsx(os,{path:"/adapter-config",element:x.jsx(vet,{})})]})})})}xP.createRoot(document.getElementById("root")).render(x.jsx(Q.StrictMode,{children:x.jsx(Uue,{children:x.jsx(met,{})})})); + */(function(e,t){(function(r,n){n(t)})(dg,function(r){var n="1.9.4";function i(p){var w,M,O,R;for(M=1,O=arguments.length;M"u"||!L||!L.Mixin)){p=b(p)?p:[p];for(var w=0;w0?Math.floor(p):Math.ceil(p)};j.prototype={clone:function(){return new j(this.x,this.y)},add:function(p){return this.clone()._add(G(p))},_add:function(p){return this.x+=p.x,this.y+=p.y,this},subtract:function(p){return this.clone()._subtract(G(p))},_subtract:function(p){return this.x-=p.x,this.y-=p.y,this},divideBy:function(p){return this.clone()._divideBy(p)},_divideBy:function(p){return this.x/=p,this.y/=p,this},multiplyBy:function(p){return this.clone()._multiplyBy(p)},_multiplyBy:function(p){return this.x*=p,this.y*=p,this},scaleBy:function(p){return new j(this.x*p.x,this.y*p.y)},unscaleBy:function(p){return new j(this.x/p.x,this.y/p.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=U(this.x),this.y=U(this.y),this},distanceTo:function(p){p=G(p);var w=p.x-this.x,M=p.y-this.y;return Math.sqrt(w*w+M*M)},equals:function(p){return p=G(p),p.x===this.x&&p.y===this.y},contains:function(p){return p=G(p),Math.abs(p.x)<=Math.abs(this.x)&&Math.abs(p.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}};function G(p,w,M){return p instanceof j?p:b(p)?new j(p[0],p[1]):p==null?p:typeof p=="object"&&"x"in p&&"y"in p?new j(p.x,p.y):new j(p,w,M)}function V(p,w){if(p)for(var M=w?[p,w]:p,O=0,R=M.length;O=this.min.x&&M.x<=this.max.x&&w.y>=this.min.y&&M.y<=this.max.y},intersects:function(p){p=Y(p);var w=this.min,M=this.max,O=p.min,R=p.max,H=R.x>=w.x&&O.x<=M.x,X=R.y>=w.y&&O.y<=M.y;return H&&X},overlaps:function(p){p=Y(p);var w=this.min,M=this.max,O=p.min,R=p.max,H=R.x>w.x&&O.xw.y&&O.y=w.lat&&R.lat<=M.lat&&O.lng>=w.lng&&R.lng<=M.lng},intersects:function(p){p=ee(p);var w=this._southWest,M=this._northEast,O=p.getSouthWest(),R=p.getNorthEast(),H=R.lat>=w.lat&&O.lat<=M.lat,X=R.lng>=w.lng&&O.lng<=M.lng;return H&&X},overlaps:function(p){p=ee(p);var w=this._southWest,M=this._northEast,O=p.getSouthWest(),R=p.getNorthEast(),H=R.lat>w.lat&&O.latw.lng&&O.lng1,vae=function(){var p=!1;try{var w=Object.defineProperty({},"passive",{get:function(){p=!0}});window.addEventListener("testPassiveEventSupport",f,w),window.removeEventListener("testPassiveEventSupport",f,w)}catch{}return p}(),pae=function(){return!!document.createElement("canvas").getContext}(),gC=!!(document.createElementNS&&Ge("svg").createSVGRect),gae=!!gC&&function(){var p=document.createElement("div");return p.innerHTML="",(p.firstChild&&p.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),mae=!gC&&function(){try{var p=document.createElement("div");p.innerHTML='';var w=p.firstChild;return w.style.behavior="url(#default#VML)",w&&typeof w.adj=="object"}catch{return!1}}(),yae=navigator.platform.indexOf("Mac")===0,xae=navigator.platform.indexOf("Linux")===0;function to(p){return navigator.userAgent.toLowerCase().indexOf(p)>=0}var Ue={ie:Ft,ielt9:rr,edge:Nn,webkit:Xr,android:qn,android23:zf,androidStock:L0,opera:vC,chrome:QR,gecko:e5,safari:aae,phantom:t5,opera12:r5,win:oae,ie3d:n5,webkit3d:pC,gecko3d:i5,any3d:sae,mobile:ip,mobileWebkit:lae,mobileWebkit3d:uae,msPointer:a5,pointer:o5,touch:cae,touchNative:s5,mobileOpera:fae,mobileGecko:hae,retina:dae,passiveEvents:vae,canvas:pae,svg:gC,vml:mae,inlineSvg:gae,mac:yae,linux:xae},l5=Ue.msPointer?"MSPointerDown":"pointerdown",u5=Ue.msPointer?"MSPointerMove":"pointermove",c5=Ue.msPointer?"MSPointerUp":"pointerup",f5=Ue.msPointer?"MSPointerCancel":"pointercancel",mC={touchstart:l5,touchmove:u5,touchend:c5,touchcancel:f5},h5={touchstart:Cae,touchmove:I0,touchend:I0,touchcancel:I0},$f={},d5=!1;function _ae(p,w,M){return w==="touchstart"&&Tae(),h5[w]?(M=h5[w].bind(this,M),p.addEventListener(mC[w],M,!1),M):(console.warn("wrong event specified:",w),f)}function bae(p,w,M){if(!mC[w]){console.warn("wrong event specified:",w);return}p.removeEventListener(mC[w],M,!1)}function wae(p){$f[p.pointerId]=p}function Sae(p){$f[p.pointerId]&&($f[p.pointerId]=p)}function v5(p){delete $f[p.pointerId]}function Tae(){d5||(document.addEventListener(l5,wae,!0),document.addEventListener(u5,Sae,!0),document.addEventListener(c5,v5,!0),document.addEventListener(f5,v5,!0),d5=!0)}function I0(p,w){if(w.pointerType!==(w.MSPOINTER_TYPE_MOUSE||"mouse")){w.touches=[];for(var M in $f)w.touches.push($f[M]);w.changedTouches=[w],p(w)}}function Cae(p,w){w.MSPOINTER_TYPE_TOUCH&&w.pointerType===w.MSPOINTER_TYPE_TOUCH&&ln(w),I0(p,w)}function Aae(p){var w={},M,O;for(O in p)M=p[O],w[O]=M&&M.bind?M.bind(p):M;return p=w,w.type="dblclick",w.detail=2,w.isTrusted=!1,w._simulated=!0,w}var Mae=200;function Pae(p,w){p.addEventListener("dblclick",w);var M=0,O;function R(H){if(H.detail!==1){O=H.detail;return}if(!(H.pointerType==="mouse"||H.sourceCapabilities&&!H.sourceCapabilities.firesTouchEvents)){var X=x5(H);if(!(X.some(function(oe){return oe instanceof HTMLLabelElement&&oe.attributes.for})&&!X.some(function(oe){return oe instanceof HTMLInputElement||oe instanceof HTMLSelectElement}))){var re=Date.now();re-M<=Mae?(O++,O===2&&w(Aae(H))):O=1,M=re}}}return p.addEventListener("click",R),{dblclick:w,simDblclick:R}}function kae(p,w){p.removeEventListener("dblclick",w.dblclick),p.removeEventListener("click",w.simDblclick)}var yC=D0(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ap=D0(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),p5=ap==="webkitTransition"||ap==="OTransition"?ap+"End":"transitionend";function g5(p){return typeof p=="string"?document.getElementById(p):p}function op(p,w){var M=p.style[w]||p.currentStyle&&p.currentStyle[w];if((!M||M==="auto")&&document.defaultView){var O=document.defaultView.getComputedStyle(p,null);M=O?O[w]:null}return M==="auto"?null:M}function Ct(p,w,M){var O=document.createElement(p);return O.className=w||"",M&&M.appendChild(O),O}function nr(p){var w=p.parentNode;w&&w.removeChild(p)}function O0(p){for(;p.firstChild;)p.removeChild(p.firstChild)}function Ff(p){var w=p.parentNode;w&&w.lastChild!==p&&w.appendChild(p)}function Vf(p){var w=p.parentNode;w&&w.firstChild!==p&&w.insertBefore(p,w.firstChild)}function xC(p,w){if(p.classList!==void 0)return p.classList.contains(w);var M=E0(p);return M.length>0&&new RegExp("(^|\\s)"+w+"(\\s|$)").test(M)}function ut(p,w){if(p.classList!==void 0)for(var M=v(w),O=0,R=M.length;O0?2*window.devicePixelRatio:1;function b5(p){return Ue.edge?p.wheelDeltaY/2:p.deltaY&&p.deltaMode===0?-p.deltaY/Oae:p.deltaY&&p.deltaMode===1?-p.deltaY*20:p.deltaY&&p.deltaMode===2?-p.deltaY*60:p.deltaX||p.deltaZ?0:p.wheelDelta?(p.wheelDeltaY||p.wheelDelta)/2:p.detail&&Math.abs(p.detail)<32765?-p.detail*20:p.detail?p.detail/-32765*60:0}function IC(p,w){var M=w.relatedTarget;if(!M)return!0;try{for(;M&&M!==p;)M=M.parentNode}catch{return!1}return M!==p}var Eae={__proto__:null,on:st,off:Wt,stopPropagation:Ou,disableScrollPropagation:LC,disableClickPropagation:cp,preventDefault:ln,stop:Eu,getPropagationPath:x5,getMousePosition:_5,getWheelDelta:b5,isExternalTarget:IC,addListener:st,removeListener:Wt},w5=Z.extend({run:function(p,w,M,O){this.stop(),this._el=p,this._inProgress=!0,this._duration=M||.25,this._easeOutPower=1/Math.max(O||.5,.2),this._startPos=Iu(p),this._offset=w.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=E(this._animate,this),this._step()},_step:function(p){var w=+new Date-this._startTime,M=this._duration*1e3;wthis.options.maxZoom)?this.setZoom(p):this},panInsideBounds:function(p,w){this._enforcingBounds=!0;var M=this.getCenter(),O=this._limitCenter(M,this._zoom,ee(p));return M.equals(O)||this.panTo(O,w),this._enforcingBounds=!1,this},panInside:function(p,w){w=w||{};var M=G(w.paddingTopLeft||w.padding||[0,0]),O=G(w.paddingBottomRight||w.padding||[0,0]),R=this.project(this.getCenter()),H=this.project(p),X=this.getPixelBounds(),re=Y([X.min.add(M),X.max.subtract(O)]),oe=re.getSize();if(!re.contains(H)){this._enforcingBounds=!0;var de=H.subtract(re.getCenter()),Ee=re.extend(H).getSize().subtract(oe);R.x+=de.x<0?-Ee.x:Ee.x,R.y+=de.y<0?-Ee.y:Ee.y,this.panTo(this.unproject(R),w),this._enforcingBounds=!1}return this},invalidateSize:function(p){if(!this._loaded)return this;p=i({animate:!1,pan:!0},p===!0?{animate:!0}:p);var w=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var M=this.getSize(),O=w.divideBy(2).round(),R=M.divideBy(2).round(),H=O.subtract(R);return!H.x&&!H.y?this:(p.animate&&p.pan?this.panBy(H):(p.pan&&this._rawPanBy(H),this.fire("move"),p.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:w,newSize:M}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(p){if(p=this._locateOptions=i({timeout:1e4,watch:!1},p),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var w=o(this._handleGeolocationResponse,this),M=o(this._handleGeolocationError,this);return p.watch?this._locationWatchId=navigator.geolocation.watchPosition(w,M,p):navigator.geolocation.getCurrentPosition(w,M,p),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(p){if(this._container._leaflet_id){var w=p.code,M=p.message||(w===1?"permission denied":w===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:w,message:"Geolocation error: "+M+"."})}},_handleGeolocationResponse:function(p){if(this._container._leaflet_id){var w=p.coords.latitude,M=p.coords.longitude,O=new le(w,M),R=O.toBounds(p.coords.accuracy*2),H=this._locateOptions;if(H.setView){var X=this.getBoundsZoom(R);this.setView(O,H.maxZoom?Math.min(X,H.maxZoom):X)}var re={latlng:O,bounds:R,timestamp:p.timestamp};for(var oe in p.coords)typeof p.coords[oe]=="number"&&(re[oe]=p.coords[oe]);this.fire("locationfound",re)}},addHandler:function(p,w){if(!w)return this;var M=this[p]=new w(this);return this._handlers.push(M),this.options[p]&&M.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),nr(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(D(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var p;for(p in this._layers)this._layers[p].remove();for(p in this._panes)nr(this._panes[p]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(p,w){var M="leaflet-pane"+(p?" leaflet-"+p.replace("Pane","")+"-pane":""),O=Ct("div",M,w||this._mapPane);return p&&(this._panes[p]=O),O},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var p=this.getPixelBounds(),w=this.unproject(p.getBottomLeft()),M=this.unproject(p.getTopRight());return new K(w,M)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(p,w,M){p=ee(p),M=G(M||[0,0]);var O=this.getZoom()||0,R=this.getMinZoom(),H=this.getMaxZoom(),X=p.getNorthWest(),re=p.getSouthEast(),oe=this.getSize().subtract(M),de=Y(this.project(re,O),this.project(X,O)).getSize(),Ee=Ue.any3d?this.options.zoomSnap:1,Qe=oe.x/de.x,pt=oe.y/de.y,jn=w?Math.max(Qe,pt):Math.min(Qe,pt);return O=this.getScaleZoom(jn,O),Ee&&(O=Math.round(O/(Ee/100))*(Ee/100),O=w?Math.ceil(O/Ee)*Ee:Math.floor(O/Ee)*Ee),Math.max(R,Math.min(H,O))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new j(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(p,w){var M=this._getTopLeftPoint(p,w);return new V(M,M.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(p){return this.options.crs.getProjectedBounds(p===void 0?this.getZoom():p)},getPane:function(p){return typeof p=="string"?this._panes[p]:p},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(p,w){var M=this.options.crs;return w=w===void 0?this._zoom:w,M.scale(p)/M.scale(w)},getScaleZoom:function(p,w){var M=this.options.crs;w=w===void 0?this._zoom:w;var O=M.zoom(p*M.scale(w));return isNaN(O)?1/0:O},project:function(p,w){return w=w===void 0?this._zoom:w,this.options.crs.latLngToPoint(he(p),w)},unproject:function(p,w){return w=w===void 0?this._zoom:w,this.options.crs.pointToLatLng(G(p),w)},layerPointToLatLng:function(p){var w=G(p).add(this.getPixelOrigin());return this.unproject(w)},latLngToLayerPoint:function(p){var w=this.project(he(p))._round();return w._subtract(this.getPixelOrigin())},wrapLatLng:function(p){return this.options.crs.wrapLatLng(he(p))},wrapLatLngBounds:function(p){return this.options.crs.wrapLatLngBounds(ee(p))},distance:function(p,w){return this.options.crs.distance(he(p),he(w))},containerPointToLayerPoint:function(p){return G(p).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(p){return G(p).add(this._getMapPanePos())},containerPointToLatLng:function(p){var w=this.containerPointToLayerPoint(G(p));return this.layerPointToLatLng(w)},latLngToContainerPoint:function(p){return this.layerPointToContainerPoint(this.latLngToLayerPoint(he(p)))},mouseEventToContainerPoint:function(p){return _5(p,this._container)},mouseEventToLayerPoint:function(p){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(p))},mouseEventToLatLng:function(p){return this.layerPointToLatLng(this.mouseEventToLayerPoint(p))},_initContainer:function(p){var w=this._container=g5(p);if(w){if(w._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");st(w,"scroll",this._onScroll,this),this._containerId=l(w)},_initLayout:function(){var p=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ue.any3d,ut(p,"leaflet-container"+(Ue.touch?" leaflet-touch":"")+(Ue.retina?" leaflet-retina":"")+(Ue.ielt9?" leaflet-oldie":"")+(Ue.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var w=op(p,"position");w!=="absolute"&&w!=="relative"&&w!=="fixed"&&w!=="sticky"&&(p.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var p=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ar(this._mapPane,new j(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ut(p.markerPane,"leaflet-zoom-hide"),ut(p.shadowPane,"leaflet-zoom-hide"))},_resetView:function(p,w,M){Ar(this._mapPane,new j(0,0));var O=!this._loaded;this._loaded=!0,w=this._limitZoom(w),this.fire("viewprereset");var R=this._zoom!==w;this._moveStart(R,M)._move(p,w)._moveEnd(R),this.fire("viewreset"),O&&this.fire("load")},_moveStart:function(p,w){return p&&this.fire("zoomstart"),w||this.fire("movestart"),this},_move:function(p,w,M,O){w===void 0&&(w=this._zoom);var R=this._zoom!==w;return this._zoom=w,this._lastCenter=p,this._pixelOrigin=this._getNewPixelOrigin(p),O?M&&M.pinch&&this.fire("zoom",M):((R||M&&M.pinch)&&this.fire("zoom",M),this.fire("move",M)),this},_moveEnd:function(p){return p&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return D(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(p){Ar(this._mapPane,this._getMapPanePos().subtract(p))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(p){this._targets={},this._targets[l(this._container)]=this;var w=p?Wt:st;w(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&w(window,"resize",this._onResize,this),Ue.any3d&&this.options.transform3DLimit&&(p?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){D(this._resizeRequest),this._resizeRequest=E(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var p=this._getMapPanePos();Math.max(Math.abs(p.x),Math.abs(p.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(p,w){for(var M=[],O,R=w==="mouseout"||w==="mouseover",H=p.target||p.srcElement,X=!1;H;){if(O=this._targets[l(H)],O&&(w==="click"||w==="preclick")&&this._draggableMoved(O)){X=!0;break}if(O&&O.listens(w,!0)&&(R&&!IC(H,p)||(M.push(O),R))||H===this._container)break;H=H.parentNode}return!M.length&&!X&&!R&&this.listens(w,!0)&&(M=[this]),M},_isClickDisabled:function(p){for(;p&&p!==this._container;){if(p._leaflet_disable_click)return!0;p=p.parentNode}},_handleDOMEvent:function(p){var w=p.target||p.srcElement;if(!(!this._loaded||w._leaflet_disable_events||p.type==="click"&&this._isClickDisabled(w))){var M=p.type;M==="mousedown"&&CC(w),this._fireDOMEvent(p,M)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(p,w,M){if(p.type==="click"){var O=i({},p);O.type="preclick",this._fireDOMEvent(O,O.type,M)}var R=this._findEventTargets(p,w);if(M){for(var H=[],X=0;X0?Math.round(p-w)/2:Math.max(0,Math.ceil(p))-Math.max(0,Math.floor(w))},_limitZoom:function(p){var w=this.getMinZoom(),M=this.getMaxZoom(),O=Ue.any3d?this.options.zoomSnap:1;return O&&(p=Math.round(p/O)*O),Math.max(w,Math.min(M,p))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_r(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(p,w){var M=this._getCenterOffset(p)._trunc();return(w&&w.animate)!==!0&&!this.getSize().contains(M)?!1:(this.panBy(M,w),!0)},_createAnimProxy:function(){var p=this._proxy=Ct("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(p),this.on("zoomanim",function(w){var M=yC,O=this._proxy.style[M];Lu(this._proxy,this.project(w.center,w.zoom),this.getZoomScale(w.zoom,1)),O===this._proxy.style[M]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){nr(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var p=this.getCenter(),w=this.getZoom();Lu(this._proxy,this.project(p,w),this.getZoomScale(w,1))},_catchTransitionEnd:function(p){this._animatingZoom&&p.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(p,w,M){if(this._animatingZoom)return!0;if(M=M||{},!this._zoomAnimated||M.animate===!1||this._nothingToAnimate()||Math.abs(w-this._zoom)>this.options.zoomAnimationThreshold)return!1;var O=this.getZoomScale(w),R=this._getCenterOffset(p)._divideBy(1-1/O);return M.animate!==!0&&!this.getSize().contains(R)?!1:(E(function(){this._moveStart(!0,M.noMoveStart||!1)._animateZoom(p,w,!0)},this),!0)},_animateZoom:function(p,w,M,O){this._mapPane&&(M&&(this._animatingZoom=!0,this._animateToCenter=p,this._animateToZoom=w,ut(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:p,zoom:w,noUpdate:O}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_r(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Dae(p,w){return new wt(p,w)}var wa=z.extend({options:{position:"topright"},initialize:function(p){g(this,p)},getPosition:function(){return this.options.position},setPosition:function(p){var w=this._map;return w&&w.removeControl(this),this.options.position=p,w&&w.addControl(this),this},getContainer:function(){return this._container},addTo:function(p){this.remove(),this._map=p;var w=this._container=this.onAdd(p),M=this.getPosition(),O=p._controlCorners[M];return ut(w,"leaflet-control"),M.indexOf("bottom")!==-1?O.insertBefore(w,O.firstChild):O.appendChild(w),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(nr(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(p){this._map&&p&&p.screenX>0&&p.screenY>0&&this._map.getContainer().focus()}}),fp=function(p){return new wa(p)};wt.include({addControl:function(p){return p.addTo(this),this},removeControl:function(p){return p.remove(),this},_initControlPos:function(){var p=this._controlCorners={},w="leaflet-",M=this._controlContainer=Ct("div",w+"control-container",this._container);function O(R,H){var X=w+R+" "+w+H;p[R+H]=Ct("div",X,M)}O("top","left"),O("top","right"),O("bottom","left"),O("bottom","right")},_clearControlPos:function(){for(var p in this._controlCorners)nr(this._controlCorners[p]);nr(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var S5=wa.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(p,w,M,O){return M1,this._baseLayersList.style.display=p?"":"none"),this._separator.style.display=w&&p?"":"none",this},_onLayerChange:function(p){this._handlingClick||this._update();var w=this._getLayer(l(p.target)),M=w.overlay?p.type==="add"?"overlayadd":"overlayremove":p.type==="add"?"baselayerchange":null;M&&this._map.fire(M,w)},_createRadioElement:function(p,w){var M='",O=document.createElement("div");return O.innerHTML=M,O.firstChild},_addItem:function(p){var w=document.createElement("label"),M=this._map.hasLayer(p.layer),O;p.overlay?(O=document.createElement("input"),O.type="checkbox",O.className="leaflet-control-layers-selector",O.defaultChecked=M):O=this._createRadioElement("leaflet-base-layers_"+l(this),M),this._layerControlInputs.push(O),O.layerId=l(p.layer),st(O,"click",this._onInputClick,this);var R=document.createElement("span");R.innerHTML=" "+p.name;var H=document.createElement("span");w.appendChild(H),H.appendChild(O),H.appendChild(R);var X=p.overlay?this._overlaysList:this._baseLayersList;return X.appendChild(w),this._checkDisabledLayers(),w},_onInputClick:function(){if(!this._preventClick){var p=this._layerControlInputs,w,M,O=[],R=[];this._handlingClick=!0;for(var H=p.length-1;H>=0;H--)w=p[H],M=this._getLayer(w.layerId).layer,w.checked?O.push(M):w.checked||R.push(M);for(H=0;H=0;R--)w=p[R],M=this._getLayer(w.layerId).layer,w.disabled=M.options.minZoom!==void 0&&OM.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var p=this._section;this._preventClick=!0,st(p,"click",ln),this.expand();var w=this;setTimeout(function(){Wt(p,"click",ln),w._preventClick=!1})}}),Nae=function(p,w,M){return new S5(p,w,M)},OC=wa.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(p){var w="leaflet-control-zoom",M=Ct("div",w+" leaflet-bar"),O=this.options;return this._zoomInButton=this._createButton(O.zoomInText,O.zoomInTitle,w+"-in",M,this._zoomIn),this._zoomOutButton=this._createButton(O.zoomOutText,O.zoomOutTitle,w+"-out",M,this._zoomOut),this._updateDisabled(),p.on("zoomend zoomlevelschange",this._updateDisabled,this),M},onRemove:function(p){p.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(p){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(p.shiftKey?3:1))},_createButton:function(p,w,M,O,R){var H=Ct("a",M,O);return H.innerHTML=p,H.href="#",H.title=w,H.setAttribute("role","button"),H.setAttribute("aria-label",w),cp(H),st(H,"click",Eu),st(H,"click",R,this),st(H,"click",this._refocusOnMap,this),H},_updateDisabled:function(){var p=this._map,w="leaflet-disabled";_r(this._zoomInButton,w),_r(this._zoomOutButton,w),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||p._zoom===p.getMinZoom())&&(ut(this._zoomOutButton,w),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||p._zoom===p.getMaxZoom())&&(ut(this._zoomInButton,w),this._zoomInButton.setAttribute("aria-disabled","true"))}});wt.mergeOptions({zoomControl:!0}),wt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new OC,this.addControl(this.zoomControl))});var jae=function(p){return new OC(p)},T5=wa.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(p){var w="leaflet-control-scale",M=Ct("div",w),O=this.options;return this._addScales(O,w+"-line",M),p.on(O.updateWhenIdle?"moveend":"move",this._update,this),p.whenReady(this._update,this),M},onRemove:function(p){p.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(p,w,M){p.metric&&(this._mScale=Ct("div",w,M)),p.imperial&&(this._iScale=Ct("div",w,M))},_update:function(){var p=this._map,w=p.getSize().y/2,M=p.distance(p.containerPointToLatLng([0,w]),p.containerPointToLatLng([this.options.maxWidth,w]));this._updateScales(M)},_updateScales:function(p){this.options.metric&&p&&this._updateMetric(p),this.options.imperial&&p&&this._updateImperial(p)},_updateMetric:function(p){var w=this._getRoundNum(p),M=w<1e3?w+" m":w/1e3+" km";this._updateScale(this._mScale,M,w/p)},_updateImperial:function(p){var w=p*3.2808399,M,O,R;w>5280?(M=w/5280,O=this._getRoundNum(M),this._updateScale(this._iScale,O+" mi",O/M)):(R=this._getRoundNum(w),this._updateScale(this._iScale,R+" ft",R/w))},_updateScale:function(p,w,M){p.style.width=Math.round(this.options.maxWidth*M)+"px",p.innerHTML=w},_getRoundNum:function(p){var w=Math.pow(10,(Math.floor(p)+"").length-1),M=p/w;return M=M>=10?10:M>=5?5:M>=3?3:M>=2?2:1,w*M}}),Rae=function(p){return new T5(p)},Bae='',EC=wa.extend({options:{position:"bottomright",prefix:''+(Ue.inlineSvg?Bae+" ":"")+"Leaflet"},initialize:function(p){g(this,p),this._attributions={}},onAdd:function(p){p.attributionControl=this,this._container=Ct("div","leaflet-control-attribution"),cp(this._container);for(var w in p._layers)p._layers[w].getAttribution&&this.addAttribution(p._layers[w].getAttribution());return this._update(),p.on("layeradd",this._addAttribution,this),this._container},onRemove:function(p){p.off("layeradd",this._addAttribution,this)},_addAttribution:function(p){p.layer.getAttribution&&(this.addAttribution(p.layer.getAttribution()),p.layer.once("remove",function(){this.removeAttribution(p.layer.getAttribution())},this))},setPrefix:function(p){return this.options.prefix=p,this._update(),this},addAttribution:function(p){return p?(this._attributions[p]||(this._attributions[p]=0),this._attributions[p]++,this._update(),this):this},removeAttribution:function(p){return p?(this._attributions[p]&&(this._attributions[p]--,this._update()),this):this},_update:function(){if(this._map){var p=[];for(var w in this._attributions)this._attributions[w]&&p.push(w);var M=[];this.options.prefix&&M.push(this.options.prefix),p.length&&M.push(p.join(", ")),this._container.innerHTML=M.join(' ')}}});wt.mergeOptions({attributionControl:!0}),wt.addInitHook(function(){this.options.attributionControl&&new EC().addTo(this)});var zae=function(p){return new EC(p)};wa.Layers=S5,wa.Zoom=OC,wa.Scale=T5,wa.Attribution=EC,fp.layers=Nae,fp.zoom=jae,fp.scale=Rae,fp.attribution=zae;var no=z.extend({initialize:function(p){this._map=p},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});no.addTo=function(p,w){return p.addHandler(w,this),this};var $ae={Events:$},C5=Ue.touch?"touchstart mousedown":"mousedown",rl=Z.extend({options:{clickTolerance:3},initialize:function(p,w,M,O){g(this,O),this._element=p,this._dragStartTarget=w||p,this._preventOutline=M},enable:function(){this._enabled||(st(this._dragStartTarget,C5,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(rl._dragging===this&&this.finishDrag(!0),Wt(this._dragStartTarget,C5,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(p){if(this._enabled&&(this._moved=!1,!xC(this._element,"leaflet-zoom-anim"))){if(p.touches&&p.touches.length!==1){rl._dragging===this&&this.finishDrag();return}if(!(rl._dragging||p.shiftKey||p.which!==1&&p.button!==1&&!p.touches)&&(rl._dragging=this,this._preventOutline&&CC(this._element),wC(),sp(),!this._moving)){this.fire("down");var w=p.touches?p.touches[0]:p,M=m5(this._element);this._startPoint=new j(w.clientX,w.clientY),this._startPos=Iu(this._element),this._parentScale=AC(M);var O=p.type==="mousedown";st(document,O?"mousemove":"touchmove",this._onMove,this),st(document,O?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(p){if(this._enabled){if(p.touches&&p.touches.length>1){this._moved=!0;return}var w=p.touches&&p.touches.length===1?p.touches[0]:p,M=new j(w.clientX,w.clientY)._subtract(this._startPoint);!M.x&&!M.y||Math.abs(M.x)+Math.abs(M.y)H&&(X=re,H=oe);H>M&&(w[X]=1,NC(p,w,M,O,X),NC(p,w,M,X,R))}function Wae(p,w){for(var M=[p[0]],O=1,R=0,H=p.length;Ow&&(M.push(p[O]),R=O);return Rw.max.x&&(M|=2),p.yw.max.y&&(M|=8),M}function Hae(p,w){var M=w.x-p.x,O=w.y-p.y;return M*M+O*O}function hp(p,w,M,O){var R=w.x,H=w.y,X=M.x-R,re=M.y-H,oe=X*X+re*re,de;return oe>0&&(de=((p.x-R)*X+(p.y-H)*re)/oe,de>1?(R=M.x,H=M.y):de>0&&(R+=X*de,H+=re*de)),X=p.x-R,re=p.y-H,O?X*X+re*re:new j(R,H)}function Bi(p){return!b(p[0])||typeof p[0][0]!="object"&&typeof p[0][0]<"u"}function O5(p){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Bi(p)}function E5(p,w){var M,O,R,H,X,re,oe,de;if(!p||p.length===0)throw new Error("latlngs not passed");Bi(p)||(console.warn("latlngs are not flat! Only the first ring will be used"),p=p[0]);var Ee=he([0,0]),Qe=ee(p),pt=Qe.getNorthWest().distanceTo(Qe.getSouthWest())*Qe.getNorthEast().distanceTo(Qe.getNorthWest());pt<1700&&(Ee=DC(p));var jn=p.length,qr=[];for(M=0;MO){oe=(H-O)/R,de=[re.x-oe*(re.x-X.x),re.y-oe*(re.y-X.y)];break}var Kn=w.unproject(G(de));return he([Kn.lat+Ee.lat,Kn.lng+Ee.lng])}var Uae={__proto__:null,simplify:P5,pointToSegmentDistance:k5,closestPointOnSegment:Vae,clipSegment:I5,_getEdgeIntersection:R0,_getBitCode:Du,_sqClosestPointOnSegment:hp,isFlat:Bi,_flat:O5,polylineCenter:E5},jC={project:function(p){return new j(p.lng,p.lat)},unproject:function(p){return new le(p.y,p.x)},bounds:new V([-180,-90],[180,90])},RC={R:6378137,R_MINOR:6356752314245179e-9,bounds:new V([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(p){var w=Math.PI/180,M=this.R,O=p.lat*w,R=this.R_MINOR/M,H=Math.sqrt(1-R*R),X=H*Math.sin(O),re=Math.tan(Math.PI/4-O/2)/Math.pow((1-X)/(1+X),H/2);return O=-M*Math.log(Math.max(re,1e-10)),new j(p.lng*w*M,O)},unproject:function(p){for(var w=180/Math.PI,M=this.R,O=this.R_MINOR/M,R=Math.sqrt(1-O*O),H=Math.exp(-p.y/M),X=Math.PI/2-2*Math.atan(H),re=0,oe=.1,de;re<15&&Math.abs(oe)>1e-7;re++)de=R*Math.sin(X),de=Math.pow((1-de)/(1+de),R/2),oe=Math.PI/2-2*Math.atan(H*de)-X,X+=oe;return new le(X*w,p.x*w/M)}},Zae={__proto__:null,LonLat:jC,Mercator:RC,SphericalMercator:fe},Yae=i({},ge,{code:"EPSG:3395",projection:RC,transformation:function(){var p=.5/(Math.PI*RC.R);return te(p,.5,-p,.5)}()}),D5=i({},ge,{code:"EPSG:4326",projection:jC,transformation:te(1/180,1,-1/180,.5)}),Xae=i({},Re,{projection:jC,transformation:te(1,0,-1,0),scale:function(p){return Math.pow(2,p)},zoom:function(p){return Math.log(p)/Math.LN2},distance:function(p,w){var M=w.lng-p.lng,O=w.lat-p.lat;return Math.sqrt(M*M+O*O)},infinite:!0});Re.Earth=ge,Re.EPSG3395=Yae,Re.EPSG3857=Ve,Re.EPSG900913=Se,Re.EPSG4326=D5,Re.Simple=Xae;var Sa=Z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(p){return p.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(p){return p&&p.removeLayer(this),this},getPane:function(p){return this._map.getPane(p?this.options[p]||p:this.options.pane)},addInteractiveTarget:function(p){return this._map._targets[l(p)]=this,this},removeInteractiveTarget:function(p){return delete this._map._targets[l(p)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(p){var w=p.target;if(w.hasLayer(this)){if(this._map=w,this._zoomAnimated=w._zoomAnimated,this.getEvents){var M=this.getEvents();w.on(M,this),this.once("remove",function(){w.off(M,this)},this)}this.onAdd(w),this.fire("add"),w.fire("layeradd",{layer:this})}}});wt.include({addLayer:function(p){if(!p._layerAdd)throw new Error("The provided object is not a Layer.");var w=l(p);return this._layers[w]?this:(this._layers[w]=p,p._mapToAdd=this,p.beforeAdd&&p.beforeAdd(this),this.whenReady(p._layerAdd,p),this)},removeLayer:function(p){var w=l(p);return this._layers[w]?(this._loaded&&p.onRemove(this),delete this._layers[w],this._loaded&&(this.fire("layerremove",{layer:p}),p.fire("remove")),p._map=p._mapToAdd=null,this):this},hasLayer:function(p){return l(p)in this._layers},eachLayer:function(p,w){for(var M in this._layers)p.call(w,this._layers[M]);return this},_addLayers:function(p){p=p?b(p)?p:[p]:[];for(var w=0,M=p.length;wthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&w[0]instanceof le&&w[0].equals(w[M-1])&&w.pop(),w},_setLatLngs:function(p){es.prototype._setLatLngs.call(this,p),Bi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Bi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var p=this._renderer._bounds,w=this.options.weight,M=new j(w,w);if(p=new V(p.min.subtract(M),p.max.add(M)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(p))){if(this.options.noClip){this._parts=this._rings;return}for(var O=0,R=this._rings.length,H;Op.y!=R.y>p.y&&p.x<(R.x-O.x)*(p.y-O.y)/(R.y-O.y)+O.x&&(w=!w);return w||es.prototype._containsPoint.call(this,p,!0)}});function noe(p,w){return new Hf(p,w)}var ts=Qo.extend({initialize:function(p,w){g(this,w),this._layers={},p&&this.addData(p)},addData:function(p){var w=b(p)?p:p.features,M,O,R;if(w){for(M=0,O=w.length;M0&&R.push(R[0].slice()),R}function Uf(p,w){return p.feature?i({},p.feature,{geometry:w}):G0(w)}function G0(p){return p.type==="Feature"||p.type==="FeatureCollection"?p:{type:"Feature",properties:{},geometry:p}}var FC={toGeoJSON:function(p){return Uf(this,{type:"Point",coordinates:$C(this.getLatLng(),p)})}};B0.include(FC),BC.include(FC),z0.include(FC),es.include({toGeoJSON:function(p){var w=!Bi(this._latlngs),M=V0(this._latlngs,w?1:0,!1,p);return Uf(this,{type:(w?"Multi":"")+"LineString",coordinates:M})}}),Hf.include({toGeoJSON:function(p){var w=!Bi(this._latlngs),M=w&&!Bi(this._latlngs[0]),O=V0(this._latlngs,M?2:w?1:0,!0,p);return w||(O=[O]),Uf(this,{type:(M?"Multi":"")+"Polygon",coordinates:O})}}),Gf.include({toMultiPoint:function(p){var w=[];return this.eachLayer(function(M){w.push(M.toGeoJSON(p).geometry.coordinates)}),Uf(this,{type:"MultiPoint",coordinates:w})},toGeoJSON:function(p){var w=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(w==="MultiPoint")return this.toMultiPoint(p);var M=w==="GeometryCollection",O=[];return this.eachLayer(function(R){if(R.toGeoJSON){var H=R.toGeoJSON(p);if(M)O.push(H.geometry);else{var X=G0(H);X.type==="FeatureCollection"?O.push.apply(O,X.features):O.push(X)}}}),M?Uf(this,{geometries:O,type:"GeometryCollection"}):{type:"FeatureCollection",features:O}}});function R5(p,w){return new ts(p,w)}var ioe=R5,W0=Sa.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(p,w,M){this._url=p,this._bounds=ee(w),g(this,M)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ut(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){nr(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(p){return this.options.opacity=p,this._image&&this._updateOpacity(),this},setStyle:function(p){return p.opacity&&this.setOpacity(p.opacity),this},bringToFront:function(){return this._map&&Ff(this._image),this},bringToBack:function(){return this._map&&Vf(this._image),this},setUrl:function(p){return this._url=p,this._image&&(this._image.src=p),this},setBounds:function(p){return this._bounds=ee(p),this._map&&this._reset(),this},getEvents:function(){var p={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(p.zoomanim=this._animateZoom),p},setZIndex:function(p){return this.options.zIndex=p,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var p=this._url.tagName==="IMG",w=this._image=p?this._url:Ct("img");if(ut(w,"leaflet-image-layer"),this._zoomAnimated&&ut(w,"leaflet-zoom-animated"),this.options.className&&ut(w,this.options.className),w.onselectstart=f,w.onmousemove=f,w.onload=o(this.fire,this,"load"),w.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(w.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),p){this._url=w.src;return}w.src=this._url,w.alt=this.options.alt},_animateZoom:function(p){var w=this._map.getZoomScale(p.zoom),M=this._map._latLngBoundsToNewLayerBounds(this._bounds,p.zoom,p.center).min;Lu(this._image,M,w)},_reset:function(){var p=this._image,w=new V(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),M=w.getSize();Ar(p,w.min),p.style.width=M.x+"px",p.style.height=M.y+"px"},_updateOpacity:function(){Ri(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var p=this.options.errorOverlayUrl;p&&this._url!==p&&(this._url=p,this._image.src=p)},getCenter:function(){return this._bounds.getCenter()}}),aoe=function(p,w,M){return new W0(p,w,M)},B5=W0.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var p=this._url.tagName==="VIDEO",w=this._image=p?this._url:Ct("video");if(ut(w,"leaflet-image-layer"),this._zoomAnimated&&ut(w,"leaflet-zoom-animated"),this.options.className&&ut(w,this.options.className),w.onselectstart=f,w.onmousemove=f,w.onloadeddata=o(this.fire,this,"load"),p){for(var M=w.getElementsByTagName("source"),O=[],R=0;R0?O:[w.src];return}b(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(w.style,"objectFit")&&(w.style.objectFit="fill"),w.autoplay=!!this.options.autoplay,w.loop=!!this.options.loop,w.muted=!!this.options.muted,w.playsInline=!!this.options.playsInline;for(var H=0;HR?(w.height=R+"px",ut(p,H)):_r(p,H),this._containerWidth=this._container.offsetWidth},_animateZoom:function(p){var w=this._map._latLngToNewLayerPoint(this._latlng,p.zoom,p.center),M=this._getAnchor();Ar(this._container,w.add(M))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var p=this._map,w=parseInt(op(this._container,"marginBottom"),10)||0,M=this._container.offsetHeight+w,O=this._containerWidth,R=new j(this._containerLeft,-M-this._containerBottom);R._add(Iu(this._container));var H=p.layerPointToContainerPoint(R),X=G(this.options.autoPanPadding),re=G(this.options.autoPanPaddingTopLeft||X),oe=G(this.options.autoPanPaddingBottomRight||X),de=p.getSize(),Ee=0,Qe=0;H.x+O+oe.x>de.x&&(Ee=H.x+O-de.x+oe.x),H.x-Ee-re.x<0&&(Ee=H.x-re.x),H.y+M+oe.y>de.y&&(Qe=H.y+M-de.y+oe.y),H.y-Qe-re.y<0&&(Qe=H.y-re.y),(Ee||Qe)&&(this.options.keepInView&&(this._autopanning=!0),p.fire("autopanstart").panBy([Ee,Qe]))}},_getAnchor:function(){return G(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),loe=function(p,w){return new H0(p,w)};wt.mergeOptions({closePopupOnClick:!0}),wt.include({openPopup:function(p,w,M){return this._initOverlay(H0,p,w,M).openOn(this),this},closePopup:function(p){return p=arguments.length?p:this._popup,p&&p.close(),this}}),Sa.include({bindPopup:function(p,w){return this._popup=this._initOverlay(H0,this._popup,p,w),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(p){return this._popup&&(this instanceof Qo||(this._popup._source=this),this._popup._prepareOpen(p||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(p){return this._popup&&this._popup.setContent(p),this},getPopup:function(){return this._popup},_openPopup:function(p){if(!(!this._popup||!this._map)){Eu(p);var w=p.layer||p.target;if(this._popup._source===w&&!(w instanceof nl)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(p.latlng);return}this._popup._source=w,this.openPopup(p.latlng)}},_movePopup:function(p){this._popup.setLatLng(p.latlng)},_onKeyPress:function(p){p.originalEvent.keyCode===13&&this._openPopup(p)}});var U0=io.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(p){io.prototype.onAdd.call(this,p),this.setOpacity(this.options.opacity),p.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(p){io.prototype.onRemove.call(this,p),p.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var p=io.prototype.getEvents.call(this);return this.options.permanent||(p.preclick=this.close),p},_initLayout:function(){var p="leaflet-tooltip",w=p+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Ct("div",w),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(p){var w,M,O=this._map,R=this._container,H=O.latLngToContainerPoint(O.getCenter()),X=O.layerPointToContainerPoint(p),re=this.options.direction,oe=R.offsetWidth,de=R.offsetHeight,Ee=G(this.options.offset),Qe=this._getAnchor();re==="top"?(w=oe/2,M=de):re==="bottom"?(w=oe/2,M=0):re==="center"?(w=oe/2,M=de/2):re==="right"?(w=0,M=de/2):re==="left"?(w=oe,M=de/2):X.xthis.options.maxZoom||MO?this._retainParent(R,H,X,O):!1)},_retainChildren:function(p,w,M,O){for(var R=2*p;R<2*p+2;R++)for(var H=2*w;H<2*w+2;H++){var X=new j(R,H);X.z=M+1;var re=this._tileCoordsToKey(X),oe=this._tiles[re];if(oe&&oe.active){oe.retain=!0;continue}else oe&&oe.loaded&&(oe.retain=!0);M+1this.options.maxZoom||this.options.minZoom!==void 0&&R1){this._setView(p,M);return}for(var Qe=R.min.y;Qe<=R.max.y;Qe++)for(var pt=R.min.x;pt<=R.max.x;pt++){var jn=new j(pt,Qe);if(jn.z=this._tileZoom,!!this._isValidTile(jn)){var qr=this._tiles[this._tileCoordsToKey(jn)];qr?qr.current=!0:X.push(jn)}}if(X.sort(function(Kn,Yf){return Kn.distanceTo(H)-Yf.distanceTo(H)}),X.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var zi=document.createDocumentFragment();for(pt=0;ptM.max.x)||!w.wrapLat&&(p.yM.max.y))return!1}if(!this.options.bounds)return!0;var O=this._tileCoordsToBounds(p);return ee(this.options.bounds).overlaps(O)},_keyToBounds:function(p){return this._tileCoordsToBounds(this._keyToTileCoords(p))},_tileCoordsToNwSe:function(p){var w=this._map,M=this.getTileSize(),O=p.scaleBy(M),R=O.add(M),H=w.unproject(O,p.z),X=w.unproject(R,p.z);return[H,X]},_tileCoordsToBounds:function(p){var w=this._tileCoordsToNwSe(p),M=new K(w[0],w[1]);return this.options.noWrap||(M=this._map.wrapLatLngBounds(M)),M},_tileCoordsToKey:function(p){return p.x+":"+p.y+":"+p.z},_keyToTileCoords:function(p){var w=p.split(":"),M=new j(+w[0],+w[1]);return M.z=+w[2],M},_removeTile:function(p){var w=this._tiles[p];w&&(nr(w.el),delete this._tiles[p],this.fire("tileunload",{tile:w.el,coords:this._keyToTileCoords(p)}))},_initTile:function(p){ut(p,"leaflet-tile");var w=this.getTileSize();p.style.width=w.x+"px",p.style.height=w.y+"px",p.onselectstart=f,p.onmousemove=f,Ue.ielt9&&this.options.opacity<1&&Ri(p,this.options.opacity)},_addTile:function(p,w){var M=this._getTilePos(p),O=this._tileCoordsToKey(p),R=this.createTile(this._wrapCoords(p),o(this._tileReady,this,p));this._initTile(R),this.createTile.length<2&&E(o(this._tileReady,this,p,null,R)),Ar(R,M),this._tiles[O]={el:R,coords:p,current:!0},w.appendChild(R),this.fire("tileloadstart",{tile:R,coords:p})},_tileReady:function(p,w,M){w&&this.fire("tileerror",{error:w,tile:M,coords:p});var O=this._tileCoordsToKey(p);M=this._tiles[O],M&&(M.loaded=+new Date,this._map._fadeAnimated?(Ri(M.el,0),D(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(M.active=!0,this._pruneTiles()),w||(ut(M.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:M.el,coords:p})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ue.ielt9||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(p){return p.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(p){var w=new j(this._wrapX?c(p.x,this._wrapX):p.x,this._wrapY?c(p.y,this._wrapY):p.y);return w.z=p.z,w},_pxBoundsToTileRange:function(p){var w=this.getTileSize();return new V(p.min.unscaleBy(w).floor(),p.max.unscaleBy(w).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var p in this._tiles)if(!this._tiles[p].loaded)return!1;return!0}});function foe(p){return new vp(p)}var Zf=vp.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(p,w){this._url=p,w=g(this,w),w.detectRetina&&Ue.retina&&w.maxZoom>0?(w.tileSize=Math.floor(w.tileSize/2),w.zoomReverse?(w.zoomOffset--,w.minZoom=Math.min(w.maxZoom,w.minZoom+1)):(w.zoomOffset++,w.maxZoom=Math.max(w.minZoom,w.maxZoom-1)),w.minZoom=Math.max(0,w.minZoom)):w.zoomReverse?w.minZoom=Math.min(w.maxZoom,w.minZoom):w.maxZoom=Math.max(w.minZoom,w.maxZoom),typeof w.subdomains=="string"&&(w.subdomains=w.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(p,w){return this._url===p&&w===void 0&&(w=!0),this._url=p,w||this.redraw(),this},createTile:function(p,w){var M=document.createElement("img");return st(M,"load",o(this._tileOnLoad,this,w,M)),st(M,"error",o(this._tileOnError,this,w,M)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(M.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(M.referrerPolicy=this.options.referrerPolicy),M.alt="",M.src=this.getTileUrl(p),M},getTileUrl:function(p){var w={r:Ue.retina?"@2x":"",s:this._getSubdomain(p),x:p.x,y:p.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var M=this._globalTileRange.max.y-p.y;this.options.tms&&(w.y=M),w["-y"]=M}return _(this._url,i(w,this.options))},_tileOnLoad:function(p,w){Ue.ielt9?setTimeout(o(p,this,null,w),0):p(null,w)},_tileOnError:function(p,w,M){var O=this.options.errorTileUrl;O&&w.getAttribute("src")!==O&&(w.src=O),p(M,w)},_onTileRemove:function(p){p.tile.onload=null},_getZoomForUrl:function(){var p=this._tileZoom,w=this.options.maxZoom,M=this.options.zoomReverse,O=this.options.zoomOffset;return M&&(p=w-p),p+O},_getSubdomain:function(p){var w=Math.abs(p.x+p.y)%this.options.subdomains.length;return this.options.subdomains[w]},_abortLoading:function(){var p,w;for(p in this._tiles)if(this._tiles[p].coords.z!==this._tileZoom&&(w=this._tiles[p].el,w.onload=f,w.onerror=f,!w.complete)){w.src=T;var M=this._tiles[p].coords;nr(w),delete this._tiles[p],this.fire("tileabort",{tile:w,coords:M})}},_removeTile:function(p){var w=this._tiles[p];if(w)return w.el.setAttribute("src",T),vp.prototype._removeTile.call(this,p)},_tileReady:function(p,w,M){if(!(!this._map||M&&M.getAttribute("src")===T))return vp.prototype._tileReady.call(this,p,w,M)}});function F5(p,w){return new Zf(p,w)}var V5=Zf.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(p,w){this._url=p;var M=i({},this.defaultWmsParams);for(var O in w)O in this.options||(M[O]=w[O]);w=g(this,w);var R=w.detectRetina&&Ue.retina?2:1,H=this.getTileSize();M.width=H.x*R,M.height=H.y*R,this.wmsParams=M},onAdd:function(p){this._crs=this.options.crs||p.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var w=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[w]=this._crs.code,Zf.prototype.onAdd.call(this,p)},getTileUrl:function(p){var w=this._tileCoordsToNwSe(p),M=this._crs,O=Y(M.project(w[0]),M.project(w[1])),R=O.min,H=O.max,X=(this._wmsVersion>=1.3&&this._crs===D5?[R.y,R.x,H.y,H.x]:[R.x,R.y,H.x,H.y]).join(","),re=Zf.prototype.getTileUrl.call(this,p);return re+m(this.wmsParams,re,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+X},setParams:function(p,w){return i(this.wmsParams,p),w||this.redraw(),this}});function hoe(p,w){return new V5(p,w)}Zf.WMS=V5,F5.wms=hoe;var rs=Sa.extend({options:{padding:.1},initialize:function(p){g(this,p),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ut(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var p={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(p.zoomanim=this._onAnimZoom),p},_onAnimZoom:function(p){this._updateTransform(p.center,p.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(p,w){var M=this._map.getZoomScale(w,this._zoom),O=this._map.getSize().multiplyBy(.5+this.options.padding),R=this._map.project(this._center,w),H=O.multiplyBy(-M).add(R).subtract(this._map._getNewPixelOrigin(p,w));Ue.any3d?Lu(this._container,H,M):Ar(this._container,H)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var p in this._layers)this._layers[p]._reset()},_onZoomEnd:function(){for(var p in this._layers)this._layers[p]._project()},_updatePaths:function(){for(var p in this._layers)this._layers[p]._update()},_update:function(){var p=this.options.padding,w=this._map.getSize(),M=this._map.containerPointToLayerPoint(w.multiplyBy(-p)).round();this._bounds=new V(M,M.add(w.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),G5=rs.extend({options:{tolerance:0},getEvents:function(){var p=rs.prototype.getEvents.call(this);return p.viewprereset=this._onViewPreReset,p},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){rs.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var p=this._container=document.createElement("canvas");st(p,"mousemove",this._onMouseMove,this),st(p,"click dblclick mousedown mouseup contextmenu",this._onClick,this),st(p,"mouseout",this._handleMouseOut,this),p._leaflet_disable_events=!0,this._ctx=p.getContext("2d")},_destroyContainer:function(){D(this._redrawRequest),delete this._ctx,nr(this._container),Wt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var p;this._redrawBounds=null;for(var w in this._layers)p=this._layers[w],p._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){rs.prototype._update.call(this);var p=this._bounds,w=this._container,M=p.getSize(),O=Ue.retina?2:1;Ar(w,p.min),w.width=O*M.x,w.height=O*M.y,w.style.width=M.x+"px",w.style.height=M.y+"px",Ue.retina&&this._ctx.scale(2,2),this._ctx.translate(-p.min.x,-p.min.y),this.fire("update")}},_reset:function(){rs.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(p){this._updateDashArray(p),this._layers[l(p)]=p;var w=p._order={layer:p,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=w),this._drawLast=w,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(p){this._requestRedraw(p)},_removePath:function(p){var w=p._order,M=w.next,O=w.prev;M?M.prev=O:this._drawLast=O,O?O.next=M:this._drawFirst=M,delete p._order,delete this._layers[l(p)],this._requestRedraw(p)},_updatePath:function(p){this._extendRedrawBounds(p),p._project(),p._update(),this._requestRedraw(p)},_updateStyle:function(p){this._updateDashArray(p),this._requestRedraw(p)},_updateDashArray:function(p){if(typeof p.options.dashArray=="string"){var w=p.options.dashArray.split(/[, ]+/),M=[],O,R;for(R=0;R')}}catch{}return function(p){return document.createElement("<"+p+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),doe={_initContainer:function(){this._container=Ct("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(rs.prototype._update.call(this),this.fire("update"))},_initPath:function(p){var w=p._container=pp("shape");ut(w,"leaflet-vml-shape "+(this.options.className||"")),w.coordsize="1 1",p._path=pp("path"),w.appendChild(p._path),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){var w=p._container;this._container.appendChild(w),p.options.interactive&&p.addInteractiveTarget(w)},_removePath:function(p){var w=p._container;nr(w),p.removeInteractiveTarget(w),delete this._layers[l(p)]},_updateStyle:function(p){var w=p._stroke,M=p._fill,O=p.options,R=p._container;R.stroked=!!O.stroke,R.filled=!!O.fill,O.stroke?(w||(w=p._stroke=pp("stroke")),R.appendChild(w),w.weight=O.weight+"px",w.color=O.color,w.opacity=O.opacity,O.dashArray?w.dashStyle=b(O.dashArray)?O.dashArray.join(" "):O.dashArray.replace(/( *, *)/g," "):w.dashStyle="",w.endcap=O.lineCap.replace("butt","flat"),w.joinstyle=O.lineJoin):w&&(R.removeChild(w),p._stroke=null),O.fill?(M||(M=p._fill=pp("fill")),R.appendChild(M),M.color=O.fillColor||O.color,M.opacity=O.fillOpacity):M&&(R.removeChild(M),p._fill=null)},_updateCircle:function(p){var w=p._point.round(),M=Math.round(p._radius),O=Math.round(p._radiusY||M);this._setPath(p,p._empty()?"M0 0":"AL "+w.x+","+w.y+" "+M+","+O+" 0,"+65535*360)},_setPath:function(p,w){p._path.v=w},_bringToFront:function(p){Ff(p._container)},_bringToBack:function(p){Vf(p._container)}},Z0=Ue.vml?pp:Ge,gp=rs.extend({_initContainer:function(){this._container=Z0("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Z0("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){nr(this._container),Wt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){rs.prototype._update.call(this);var p=this._bounds,w=p.getSize(),M=this._container;(!this._svgSize||!this._svgSize.equals(w))&&(this._svgSize=w,M.setAttribute("width",w.x),M.setAttribute("height",w.y)),Ar(M,p.min),M.setAttribute("viewBox",[p.min.x,p.min.y,w.x,w.y].join(" ")),this.fire("update")}},_initPath:function(p){var w=p._path=Z0("path");p.options.className&&ut(w,p.options.className),p.options.interactive&&ut(w,"leaflet-interactive"),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(p._path),p.addInteractiveTarget(p._path)},_removePath:function(p){nr(p._path),p.removeInteractiveTarget(p._path),delete this._layers[l(p)]},_updatePath:function(p){p._project(),p._update()},_updateStyle:function(p){var w=p._path,M=p.options;w&&(M.stroke?(w.setAttribute("stroke",M.color),w.setAttribute("stroke-opacity",M.opacity),w.setAttribute("stroke-width",M.weight),w.setAttribute("stroke-linecap",M.lineCap),w.setAttribute("stroke-linejoin",M.lineJoin),M.dashArray?w.setAttribute("stroke-dasharray",M.dashArray):w.removeAttribute("stroke-dasharray"),M.dashOffset?w.setAttribute("stroke-dashoffset",M.dashOffset):w.removeAttribute("stroke-dashoffset")):w.setAttribute("stroke","none"),M.fill?(w.setAttribute("fill",M.fillColor||M.color),w.setAttribute("fill-opacity",M.fillOpacity),w.setAttribute("fill-rule",M.fillRule||"evenodd")):w.setAttribute("fill","none"))},_updatePoly:function(p,w){this._setPath(p,Ye(p._parts,w))},_updateCircle:function(p){var w=p._point,M=Math.max(Math.round(p._radius),1),O=Math.max(Math.round(p._radiusY),1)||M,R="a"+M+","+O+" 0 1,0 ",H=p._empty()?"M0 0":"M"+(w.x-M)+","+w.y+R+M*2+",0 "+R+-M*2+",0 ";this._setPath(p,H)},_setPath:function(p,w){p._path.setAttribute("d",w)},_bringToFront:function(p){Ff(p._path)},_bringToBack:function(p){Vf(p._path)}});Ue.vml&&gp.include(doe);function H5(p){return Ue.svg||Ue.vml?new gp(p):null}wt.include({getRenderer:function(p){var w=p.options.renderer||this._getPaneRenderer(p.options.pane)||this.options.renderer||this._renderer;return w||(w=this._renderer=this._createRenderer()),this.hasLayer(w)||this.addLayer(w),w},_getPaneRenderer:function(p){if(p==="overlayPane"||p===void 0)return!1;var w=this._paneRenderers[p];return w===void 0&&(w=this._createRenderer({pane:p}),this._paneRenderers[p]=w),w},_createRenderer:function(p){return this.options.preferCanvas&&W5(p)||H5(p)}});var U5=Hf.extend({initialize:function(p,w){Hf.prototype.initialize.call(this,this._boundsToLatLngs(p),w)},setBounds:function(p){return this.setLatLngs(this._boundsToLatLngs(p))},_boundsToLatLngs:function(p){return p=ee(p),[p.getSouthWest(),p.getNorthWest(),p.getNorthEast(),p.getSouthEast()]}});function voe(p,w){return new U5(p,w)}gp.create=Z0,gp.pointsToPath=Ye,ts.geometryToLayer=$0,ts.coordsToLatLng=zC,ts.coordsToLatLngs=F0,ts.latLngToCoords=$C,ts.latLngsToCoords=V0,ts.getFeature=Uf,ts.asFeature=G0,wt.mergeOptions({boxZoom:!0});var Z5=no.extend({initialize:function(p){this._map=p,this._container=p._container,this._pane=p._panes.overlayPane,this._resetStateTimeout=0,p.on("unload",this._destroy,this)},addHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Wt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){nr(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(p){if(!p.shiftKey||p.which!==1&&p.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),sp(),wC(),this._startPoint=this._map.mouseEventToContainerPoint(p),st(document,{contextmenu:Eu,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(p){this._moved||(this._moved=!0,this._box=Ct("div","leaflet-zoom-box",this._container),ut(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(p);var w=new V(this._point,this._startPoint),M=w.getSize();Ar(this._box,w.min),this._box.style.width=M.x+"px",this._box.style.height=M.y+"px"},_finish:function(){this._moved&&(nr(this._box),_r(this._container,"leaflet-crosshair")),lp(),SC(),Wt(document,{contextmenu:Eu,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(p){if(!(p.which!==1&&p.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var w=new K(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(w).fire("boxzoomend",{boxZoomBounds:w})}},_onKeyDown:function(p){p.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});wt.addInitHook("addHandler","boxZoom",Z5),wt.mergeOptions({doubleClickZoom:!0});var Y5=no.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(p){var w=this._map,M=w.getZoom(),O=w.options.zoomDelta,R=p.originalEvent.shiftKey?M-O:M+O;w.options.doubleClickZoom==="center"?w.setZoom(R):w.setZoomAround(p.containerPoint,R)}});wt.addInitHook("addHandler","doubleClickZoom",Y5),wt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var X5=no.extend({addHooks:function(){if(!this._draggable){var p=this._map;this._draggable=new rl(p._mapPane,p._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),p.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),p.on("zoomend",this._onZoomEnd,this),p.whenReady(this._onZoomEnd,this))}ut(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_r(this._map._container,"leaflet-grab"),_r(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var p=this._map;if(p._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var w=ee(this._map.options.maxBounds);this._offsetLimit=Y(this._map.latLngToContainerPoint(w.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(w.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;p.fire("movestart").fire("dragstart"),p.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(p){if(this._map.options.inertia){var w=this._lastTime=+new Date,M=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(M),this._times.push(w),this._prunePositions(w)}this._map.fire("move",p).fire("drag",p)},_prunePositions:function(p){for(;this._positions.length>1&&p-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var p=this._map.getSize().divideBy(2),w=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=w.subtract(p).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(p,w){return p-(p-w)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var p=this._draggable._newPos.subtract(this._draggable._startPos),w=this._offsetLimit;p.xw.max.x&&(p.x=this._viscousLimit(p.x,w.max.x)),p.y>w.max.y&&(p.y=this._viscousLimit(p.y,w.max.y)),this._draggable._newPos=this._draggable._startPos.add(p)}},_onPreDragWrap:function(){var p=this._worldWidth,w=Math.round(p/2),M=this._initialWorldOffset,O=this._draggable._newPos.x,R=(O-w+M)%p+w-M,H=(O+w+M)%p-w-M,X=Math.abs(R+M)0?H:-H))-w;this._delta=0,this._startTime=null,X&&(p.options.scrollWheelZoom==="center"?p.setZoom(w+X):p.setZoomAround(this._lastMousePos,w+X))}});wt.addInitHook("addHandler","scrollWheelZoom",K5);var poe=600;wt.mergeOptions({tapHold:Ue.touchNative&&Ue.safari&&Ue.mobile,tapTolerance:15});var J5=no.extend({addHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Wt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(p){if(clearTimeout(this._holdTimeout),p.touches.length===1){var w=p.touches[0];this._startPos=this._newPos=new j(w.clientX,w.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(st(document,"touchend",ln),st(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",w))},this),poe),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function p(){Wt(document,"touchend",ln),Wt(document,"touchend touchcancel",p)},_cancel:function(){clearTimeout(this._holdTimeout),Wt(document,"touchend touchcancel contextmenu",this._cancel,this),Wt(document,"touchmove",this._onMove,this)},_onMove:function(p){var w=p.touches[0];this._newPos=new j(w.clientX,w.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(p,w){var M=new MouseEvent(p,{bubbles:!0,cancelable:!0,view:window,screenX:w.screenX,screenY:w.screenY,clientX:w.clientX,clientY:w.clientY});M._simulated=!0,w.target.dispatchEvent(M)}});wt.addInitHook("addHandler","tapHold",J5),wt.mergeOptions({touchZoom:Ue.touch,bounceAtZoomLimits:!0});var Q5=no.extend({addHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){_r(this._map._container,"leaflet-touch-zoom"),Wt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(p){var w=this._map;if(!(!p.touches||p.touches.length!==2||w._animatingZoom||this._zooming)){var M=w.mouseEventToContainerPoint(p.touches[0]),O=w.mouseEventToContainerPoint(p.touches[1]);this._centerPoint=w.getSize()._divideBy(2),this._startLatLng=w.containerPointToLatLng(this._centerPoint),w.options.touchZoom!=="center"&&(this._pinchStartLatLng=w.containerPointToLatLng(M.add(O)._divideBy(2))),this._startDist=M.distanceTo(O),this._startZoom=w.getZoom(),this._moved=!1,this._zooming=!0,w._stop(),st(document,"touchmove",this._onTouchMove,this),st(document,"touchend touchcancel",this._onTouchEnd,this),ln(p)}},_onTouchMove:function(p){if(!(!p.touches||p.touches.length!==2||!this._zooming)){var w=this._map,M=w.mouseEventToContainerPoint(p.touches[0]),O=w.mouseEventToContainerPoint(p.touches[1]),R=M.distanceTo(O)/this._startDist;if(this._zoom=w.getScaleZoom(R,this._startZoom),!w.options.bounceAtZoomLimits&&(this._zoomw.getMaxZoom()&&R>1)&&(this._zoom=w._limitZoom(this._zoom)),w.options.touchZoom==="center"){if(this._center=this._startLatLng,R===1)return}else{var H=M._add(O)._divideBy(2)._subtract(this._centerPoint);if(R===1&&H.x===0&&H.y===0)return;this._center=w.unproject(w.project(this._pinchStartLatLng,this._zoom).subtract(H),this._zoom)}this._moved||(w._moveStart(!0,!1),this._moved=!0),D(this._animRequest);var X=o(w._move,w,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=E(X,this,!0),ln(p)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,D(this._animRequest),Wt(document,"touchmove",this._onTouchMove,this),Wt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});wt.addInitHook("addHandler","touchZoom",Q5),wt.BoxZoom=Z5,wt.DoubleClickZoom=Y5,wt.Drag=X5,wt.Keyboard=q5,wt.ScrollWheelZoom=K5,wt.TapHold=J5,wt.TouchZoom=Q5,r.Bounds=V,r.Browser=Ue,r.CRS=Re,r.Canvas=G5,r.Circle=BC,r.CircleMarker=z0,r.Class=z,r.Control=wa,r.DivIcon=$5,r.DivOverlay=io,r.DomEvent=Eae,r.DomUtil=Iae,r.Draggable=rl,r.Evented=Z,r.FeatureGroup=Qo,r.GeoJSON=ts,r.GridLayer=vp,r.Handler=no,r.Icon=Wf,r.ImageOverlay=W0,r.LatLng=le,r.LatLngBounds=K,r.Layer=Sa,r.LayerGroup=Gf,r.LineUtil=Uae,r.Map=wt,r.Marker=B0,r.Mixin=$ae,r.Path=nl,r.Point=j,r.PolyUtil=Fae,r.Polygon=Hf,r.Polyline=es,r.Popup=H0,r.PosAnimation=w5,r.Projection=Zae,r.Rectangle=U5,r.Renderer=rs,r.SVG=gp,r.SVGOverlay=z5,r.TileLayer=Zf,r.Tooltip=U0,r.Transformation=ue,r.Util=N,r.VideoOverlay=B5,r.bind=o,r.bounds=Y,r.canvas=W5,r.circle=toe,r.circleMarker=eoe,r.control=fp,r.divIcon=coe,r.extend=i,r.featureGroup=Kae,r.geoJSON=R5,r.geoJson=ioe,r.gridLayer=foe,r.icon=Jae,r.imageOverlay=aoe,r.latLng=he,r.latLngBounds=ee,r.layerGroup=qae,r.map=Dae,r.marker=Qae,r.point=G,r.polygon=noe,r.polyline=roe,r.popup=loe,r.rectangle=voe,r.setOptions=g,r.stamp=l,r.svg=H5,r.svgOverlay=soe,r.tileLayer=F5,r.tooltip=uoe,r.transformation=te,r.version=n,r.videoOverlay=ooe;var goe=window.L;r.noConflict=function(){return window.L=goe,this},window.L=r})})(iE,iE.exports);var Bf=iE.exports;const Kie=$t(Bf);function P0(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function qR(e,t){return t==null?function(n,i){const a=W.useRef();return a.current||(a.current=e(n,i)),a}:function(n,i){const a=W.useRef();a.current||(a.current=e(n,i));const o=W.useRef(n),{instance:s}=a.current;return W.useEffect(function(){o.current!==n&&(t(s,n,o.current),o.current=n)},[s,n,i]),a}}function Jie(e,t){W.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var a;(a=t.layerContainer)==null||a.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function KJe(e){return function(r){const n=hC(),i=e(dC(r,n),n);return Zie(n.map,r.attribution),XR(i.current,r.eventHandlers),Jie(i.current,n),i}}function JJe(e,t){const r=W.useRef();W.useEffect(function(){if(t.pathOptions!==r.current){const i=t.pathOptions??{};e.instance.setStyle(i),r.current=i}},[e,t])}function QJe(e){return function(r){const n=hC(),i=e(dC(r,n),n);return XR(i.current,r.eventHandlers),Jie(i.current,n),JJe(i.current,r),i}}function Qie(e,t){const r=qR(e),n=qJe(r,t);return YJe(n)}function eae(e,t){const r=qR(e,t),n=QJe(r);return ZJe(n)}function eQe(e,t){const r=qR(e,t),n=KJe(r);return XJe(n)}function tQe(e,t,r){const{opacity:n,zIndex:i}=t;n!=null&&n!==r.opacity&&e.setOpacity(n),i!=null&&i!==r.zIndex&&e.setZIndex(i)}function rQe(){return hC().map}const nQe=eae(function({center:t,children:r,...n},i){const a=new Bf.CircleMarker(t,n);return P0(a,Yie(i,{overlayContainer:a}))},WJe);function aE(){return aE=Object.assign||function(e){for(var t=1;t(d==null?void 0:d.map)??null,[d]);const g=W.useCallback(x=>{if(x!==null&&d===null){const _=new Bf.Map(x,c);r!=null&&u!=null?_.setView(r,u):e!=null&&_.fitBounds(e,t),l!=null&&_.whenReady(l),v(UJe(_))}},[]);W.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const m=d?Q.createElement(qie,{value:d},n):o??null;return Q.createElement("div",aE({},h,{ref:g}),m)}const aQe=W.forwardRef(iQe),oQe=eae(function({positions:t,...r},n){const i=new Bf.Polyline(t,r);return P0(i,Yie(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),sQe=Qie(function(t,r){const n=new Bf.Popup(t,r.overlayContainer);return P0(n,r)},function(t,r,{position:n},i){W.useEffect(function(){const{instance:o}=t;function s(u){u.popup===o&&(o.update(),i(!0))}function l(u){u.popup===o&&i(!1)}return r.map.on({popupopen:s,popupclose:l}),r.overlayContainer==null?(n!=null&&o.setLatLng(n),o.openOn(r.map)):r.overlayContainer.bindPopup(o),function(){var c;r.map.off({popupopen:s,popupclose:l}),(c=r.overlayContainer)==null||c.unbindPopup(),r.map.removeLayer(o)}},[t,r,i,n])}),lQe=eQe(function({url:t,...r},n){const i=new Bf.TileLayer(t,dC(r,n));return P0(i,n)},function(t,r,n){tQe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),uQe=Qie(function(t,r){const n=new Bf.Tooltip(t,r.overlayContainer);return P0(n,r)},function(t,r,{position:n},i){W.useEffect(function(){const o=r.overlayContainer;if(o==null)return;const{instance:s}=t,l=c=>{c.tooltip===s&&(n!=null&&s.setLatLng(n),s.update(),i(!0))},u=c=>{c.tooltip===s&&i(!1)};return o.on({tooltipopen:l,tooltipclose:u}),o.bindTooltip(s),function(){o.off({tooltipopen:l,tooltipclose:u}),o._map!=null&&o.unbindTooltip()}},[t,r,i,n])}),cQe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",fQe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",hQe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete Kie.Icon.Default.prototype._getIconUrl;Kie.Icon.Default.mergeOptions({iconUrl:cQe,iconRetinaUrl:fQe,shadowUrl:hQe});const ZU=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],dQe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function vQe(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function pQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function gQe(e){if(!e)return"Unknown";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function mQe({bounds:e}){const t=rQe();return W.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function yQe({node:e}){const t=e.latitude!==null&&e.longitude!==null,r=e.battery_level!==null?e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`:"Unknown";return y.jsxs("div",{className:"min-w-[200px]",children:[y.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),y.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),y.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[y.jsx("div",{className:"text-slate-500",children:"Role"}),y.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),y.jsx("div",{className:"text-slate-500",children:"Hardware"}),y.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),y.jsx("div",{className:"text-slate-500",children:"Battery"}),y.jsx("div",{className:"text-slate-700",children:r}),y.jsx("div",{className:"text-slate-500",children:"Last Heard"}),y.jsx("div",{className:"text-slate-700",children:gQe(e.last_heard)})]}),t&&y.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[y.jsxs("a",{href:`https://www.google.com/maps?q=${e.latitude},${e.longitude}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800",children:[y.jsx(Cd,{size:10}),"Google Maps"]}),y.jsxs("a",{href:`https://www.openstreetmap.org/?mlat=${e.latitude}&mlon=${e.longitude}&zoom=14`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800",children:[y.jsx(Cd,{size:10}),"OSM"]})]})]})}function xQe({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=W.useMemo(()=>e.filter(f=>f.latitude!==null&&f.longitude!==null),[e]),a=e.length-i.length,o=W.useMemo(()=>new Map(i.map(f=>[f.node_num,f])),[i]),s=W.useMemo(()=>t.filter(f=>o.has(f.from_node)&&o.has(f.to_node)),[t,o]),l=W.useMemo(()=>{if(i.length===0)return null;const f=i.map(d=>d.latitude),h=i.map(d=>d.longitude);return[[Math.min(...f),Math.min(...h)],[Math.max(...f),Math.max(...h)]]},[i]),u=[43.6,-114.4],c=W.useMemo(()=>{const f=new Set;return r!==null&&t.forEach(h=>{h.from_node===r&&f.add(h.to_node),h.to_node===r&&f.add(h.from_node)}),f},[r,t]);return y.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[y.jsxs(aQe,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[y.jsx(lQe,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© OpenStreetMap, © CARTO'}),y.jsx(mQe,{bounds:l}),s.map((f,h)=>{const d=o.get(f.from_node),v=o.get(f.to_node),g=r===null||f.from_node===r||f.to_node===r;return y.jsx(oQe,{positions:[[d.latitude,d.longitude],[v.latitude,v.longitude]],color:vQe(f.snr),weight:g&&r!==null?2.5:1.5,opacity:r===null?.3:g?.6:.08},h)}),i.map(f=>{const h=f.node_num===r,d=c.has(f.node_num),v=r===null||h||d,g=dQe.includes(f.role),m=pQe(f.latitude),x=ZU[m%ZU.length];return y.jsxs(nQe,{center:[f.latitude,f.longitude],radius:g?8:5,fillColor:g?x:"#111827",fillOpacity:v?.9:.2,stroke:!0,color:h?"#ffffff":x,weight:h?3:g?0:2,opacity:v?1:.3,eventHandlers:{click:()=>n(h?null:f.node_num)},children:[y.jsx(uQe,{direction:"top",offset:[0,-8],children:y.jsx("span",{className:"font-mono text-xs",children:f.short_name})}),y.jsx(sQe,{children:y.jsx(yQe,{node:f})})]},f.node_num)})]}),y.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded px-3 py-2 text-xs text-slate-400 flex items-center gap-2",children:[y.jsx(xv,{size:12}),y.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&y.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const YU=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],_Qe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function XU(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function bQe(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function wQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function SQe(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function TQe(e){if(!e)return"Unknown";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function CQe(e){if(!e)return"bg-slate-500";const t=new Date(e),n=(new Date().getTime()-t.getTime())/36e5;return n<1?"bg-green-500":n<24?"bg-amber-500":"bg-slate-500"}function AQe({node:e,edges:t,nodes:r,onSelectNode:n}){const i=W.useMemo(()=>{if(!e)return[];const f=new Map(r.map(d=>[d.node_num,d])),h=[];return t.forEach(d=>{if(d.from_node===e.node_num){const v=f.get(d.to_node);v&&h.push({node:v,snr:d.snr,quality:d.quality})}else if(d.to_node===e.node_num){const v=f.get(d.from_node);v&&h.push({node:v,snr:d.snr,quality:d.quality})}}),h.sort((d,v)=>v.snr-d.snr)},[e,t,r]);if(!e)return y.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border p-4 flex flex-col items-center justify-center h-[540px]",children:[y.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:y.jsx(Ya,{size:24,className:"text-slate-500"})}),y.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=_Qe.includes(e.role),o=wQe(e.latitude),s=YU[o%YU.length],l=e.latitude!==null&&e.longitude!==null,u=e.battery_level!==null?e.battery_level>100||e.voltage&&e.voltage>4.1?"USB":`${e.battery_level.toFixed(0)}%`:"—",c=e.battery_level!==null&&(e.battery_level>100||e.voltage&&e.voltage>4.1);return y.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[y.jsxs("div",{className:"p-4 border-b border-border",children:[y.jsx("div",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-mono mb-2",style:{backgroundColor:`${s}20`,color:s},children:e.node_id_hex}),y.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),y.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),y.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),y.jsx("div",{className:`text-sm font-medium ${a?"text-cyan-400":"text-slate-300"}`,children:e.role})]}),y.jsxs("div",{children:[y.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),y.jsx("div",{className:"text-sm text-slate-300",children:SQe(o)})]}),y.jsxs("div",{children:[y.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),y.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&y.jsx(Lm,{size:12,className:"text-amber-400"}),u]})]}),y.jsxs("div",{children:[y.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),y.jsxs("div",{className:"flex items-center gap-1.5",children:[y.jsx("div",{className:`w-2 h-2 rounded-full ${CQe(e.last_heard)}`}),y.jsx("span",{className:"text-sm text-slate-300",children:TQe(e.last_heard)})]})]}),y.jsxs("div",{className:"col-span-2",children:[y.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),y.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&y.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[y.jsxs("a",{href:`https://www.google.com/maps?q=${e.latitude},${e.longitude}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300",children:[y.jsx(Cd,{size:10}),"Google Maps"]}),y.jsxs("a",{href:`https://www.openstreetmap.org/?mlat=${e.latitude}&mlon=${e.longitude}&zoom=14`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300",children:[y.jsx(Cd,{size:10}),"OSM"]})]}),y.jsxs("div",{className:"flex-1 overflow-y-auto",children:[y.jsxs("div",{className:"px-4 py-2 text-xs text-slate-500 font-medium sticky top-0 bg-bg-card border-b border-border",children:["Neighbors (",i.length,")"]}),i.length>0?y.jsx("div",{className:"divide-y divide-border",children:i.map(f=>y.jsxs("button",{onClick:()=>n(f.node.node_num),className:"w-full px-4 py-2 text-left hover:bg-bg-hover transition-colors flex items-center gap-2",style:{borderLeftWidth:3,borderLeftColor:XU(f.snr)},children:[y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:f.node.short_name}),y.jsx("div",{className:"text-xs text-slate-500 truncate",children:f.node.long_name})]}),y.jsxs("div",{className:"text-right flex-shrink-0",children:[y.jsxs("div",{className:"text-xs font-mono",style:{color:XU(f.snr)},children:[f.snr.toFixed(1)," dB"]}),y.jsx("div",{className:"text-xs text-slate-500",children:bQe(f.snr)})]})]},f.node.node_num))}):y.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const qU=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function MQe(e){if(!e)return"bg-slate-500";const t=new Date(e),n=(new Date().getTime()-t.getTime())/36e5;return n<1?"bg-green-500":n<24?"bg-amber-500":"bg-slate-500"}function PQe(e){if(!e)return"—";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function kQe(e){return e.battery_level===null?"—":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`}function KU(e){return e===null?"—":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function LQe({nodes:e,selectedNodeId:t,onSelectNode:r}){const[n,i]=W.useState(""),[a,o]=W.useState("short_name"),[s,l]=W.useState("asc"),[u,c]=W.useState("all"),f=W.useMemo(()=>{let v=[...e];if(u==="infra"?v=v.filter(g=>qU.includes(g.role)):u==="online"&&(v=v.filter(g=>{if(!g.last_heard)return!1;const m=new Date(g.last_heard);return(new Date().getTime()-m.getTime())/36e5<1})),n){const g=n.toLowerCase();v=v.filter(m=>m.short_name.toLowerCase().includes(g)||m.long_name.toLowerCase().includes(g)||m.role.toLowerCase().includes(g)||KU(m.latitude).toLowerCase().includes(g))}return v.sort((g,m)=>{let x="",_="";switch(a){case"short_name":x=g.short_name.toLowerCase(),_=m.short_name.toLowerCase();break;case"role":x=g.role,_=m.role;break;case"battery_level":x=g.battery_level??-1,_=m.battery_level??-1;break;case"last_heard":x=g.last_heard?new Date(g.last_heard).getTime():0,_=m.last_heard?new Date(m.last_heard).getTime():0;break;case"hardware":x=g.hardware.toLowerCase(),_=m.hardware.toLowerCase();break}return x<_?s==="asc"?-1:1:x>_?s==="asc"?1:-1:0}),v},[e,n,a,s,u]),h=v=>{a===v?l(s==="asc"?"desc":"asc"):(o(v),l("asc"))},d=({field:v})=>a!==v?null:s==="asc"?y.jsx(uce,{size:14,className:"inline ml-1"}):y.jsx(yu,{size:14,className:"inline ml-1"});return y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg overflow-hidden",children:[y.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[y.jsxs("div",{className:"relative flex-1 max-w-xs",children:[y.jsx(sD,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),y.jsx("input",{type:"text",placeholder:"Search nodes...",value:n,onChange:v=>i(v.target.value),className:"w-full pl-9 pr-3 py-1.5 bg-bg-hover border border-border rounded text-sm text-slate-200 placeholder-slate-500 focus:outline-none focus:border-accent"})]}),y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(aD,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(v=>y.jsx("button",{onClick:()=>c(v),className:`px-2 py-1 text-xs rounded transition-colors ${u===v?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:v==="all"?"All":v==="infra"?"Infra":"Online"},v))]}),y.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[f.length," of ",e.length," nodes"]})]}),y.jsxs("div",{className:"overflow-x-auto",children:[y.jsxs("table",{className:"w-full text-sm",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[y.jsx("th",{className:"w-8 px-3 py-2"}),y.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("short_name"),children:["Name ",y.jsx(d,{field:"short_name"})]}),y.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("role"),children:["Role ",y.jsx(d,{field:"role"})]}),y.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),y.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("battery_level"),children:["Battery ",y.jsx(d,{field:"battery_level"})]}),y.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("last_heard"),children:["Last Heard ",y.jsx(d,{field:"last_heard"})]}),y.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("hardware"),children:["Hardware ",y.jsx(d,{field:"hardware"})]})]})}),y.jsx("tbody",{className:"divide-y divide-border",children:f.slice(0,100).map(v=>{const g=qU.includes(v.role),m=v.node_num===t;return y.jsxs("tr",{onClick:()=>r(v.node_num),className:`cursor-pointer transition-colors ${m?"bg-accent/10":"hover:bg-bg-hover"}`,children:[y.jsx("td",{className:"px-3 py-2",children:y.jsx("div",{className:`w-2 h-2 rounded-full ${MQe(v.last_heard)}`})}),y.jsxs("td",{className:"px-3 py-2",children:[y.jsx("div",{className:"font-mono text-slate-200",children:v.short_name}),y.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:v.long_name})]}),y.jsx("td",{className:"px-3 py-2",children:y.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs font-medium ${g?"bg-cyan-500/20 text-cyan-400":"bg-slate-500/20 text-slate-400"}`,children:v.role})}),y.jsx("td",{className:"px-3 py-2 text-slate-400",children:KU(v.latitude)}),y.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:kQe(v)}),y.jsx("td",{className:"px-3 py-2 text-slate-400",children:PQe(v.last_heard)}),y.jsx("td",{className:"px-3 py-2 font-mono text-xs text-slate-400 truncate max-w-[150px]",children:v.hardware||"—"})]},v.node_num)})})]}),f.length>100&&y.jsxs("div",{className:"px-3 py-2 text-xs text-slate-500 text-center border-t border-border",children:["Showing first 100 of ",f.length," nodes"]}),f.length===0&&y.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function IQe(){const[e,t]=W.useState([]),[r,n]=W.useState([]),[i,a]=W.useState([]),[o,s]=W.useState(null),[l,u]=W.useState("topo"),[c,f]=W.useState(!0),[h,d]=W.useState(null);W.useEffect(()=>{document.title="Mesh — MeshAI",Promise.all([wce(),Sce(),Pce()]).then(([m,x,_])=>{t(m),n(x),a(_),f(!1)}).catch(m=>{d(m.message),f(!1)})},[]);const v=W.useMemo(()=>e.find(m=>m.node_num===o)||null,[e,o]),g=W.useCallback(m=>{s(m)},[]);return c?y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):h?y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsxs("div",{className:"text-red-400",children:["Error: ",h]})}):y.jsxs("div",{className:"space-y-6",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes • ",r.length," edges"]}),y.jsxs("div",{className:"flex items-center bg-bg-card border border-border rounded-lg p-1",children:[y.jsxs("button",{onClick:()=>u("topo"),className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${l==="topo"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:[y.jsx(yce,{size:14}),"Topology"]}),y.jsxs("button",{onClick:()=>u("geo"),className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${l==="geo"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:[y.jsx(gce,{size:14}),"Geographic"]})]})]}),y.jsxs("div",{className:"flex gap-0",children:[y.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?y.jsx(GJe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:g}):y.jsx(xQe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:g})}),y.jsx(AQe,{node:v,edges:r,nodes:e,onSelectNode:g})]}),y.jsx(LQe,{nodes:e,selectedNodeId:o,onSelectNode:g})]})}function KR({label:e,value:t,onChange:r,helper:n,info:i,roleFilter:a,valueType:o="short_name"}){const[s,l]=W.useState([]),[u,c]=W.useState(!0),[f,h]=W.useState(""),[d,v]=W.useState(!1);W.useEffect(()=>{fetch("/api/nodes").then(S=>S.json()).then(S=>{l(S),c(!1)}).catch(()=>{l([]),c(!1)})},[]);const g=W.useMemo(()=>{let S=s;if(a&&(S=S.filter(T=>a==="ROUTER"||a==="infrastructure"?T.is_infrastructure||T.role==="ROUTER"||T.role==="ROUTER_CLIENT"||T.role==="REPEATER":T.role===a)),f.trim()){const T=f.toLowerCase();S=S.filter(C=>{var A,P,I,k;return((A=C.short_name)==null?void 0:A.toLowerCase().includes(T))||((P=C.long_name)==null?void 0:P.toLowerCase().includes(T))||((I=C.role)==null?void 0:I.toLowerCase().includes(T))||((k=C.node_id_hex)==null?void 0:k.toLowerCase().includes(T))})}return S.sort((T,C)=>(T.short_name||"").localeCompare(C.short_name||""))},[s,f,a]),m=S=>{switch(o){case"node_num":return String(S.node_num);case"node_id_hex":return S.node_id_hex;default:return S.short_name||String(S.node_num)}},x=S=>{const T=m(S);return t.includes(T)},_=S=>{const T=m(S);t.includes(T)?r(t.filter(C=>C!==T)):r([...t,T])},b=S=>{const T=[S.short_name];return S.long_name&&S.long_name!==S.short_name&&T.push(`— ${S.long_name}`),S.role&&T.push(`(${S.role})`),T.join(" ")};return!u&&s.length===0?y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),y.jsx("input",{type:"text",value:t.join(", "),onChange:S=>r(S.target.value.split(",").map(T=>T.trim()).filter(Boolean)),placeholder:"Enter node IDs separated by commas",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),n&&y.jsx("p",{className:"text-xs text-slate-600",children:n})]}):y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&y.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(C=>m(C)===S);return y.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-accent/20 text-accent rounded text-sm",children:[T?T.short_name:S,y.jsx("button",{type:"button",onClick:()=>r(t.filter(C=>C!==S)),className:"hover:text-white",children:y.jsx(zo,{size:14})})]},S)})}),y.jsxs("div",{className:"relative",children:[y.jsxs("div",{className:"relative",children:[y.jsx(sD,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),y.jsx("input",{type:"text",value:f,onChange:S=>h(S.target.value),onFocus:()=>v(!0),placeholder:u?"Loading nodes...":"Search nodes...",className:"w-full pl-9 pr-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent"})]}),d&&!u&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>v(!1)}),y.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 max-h-64 overflow-y-auto bg-[#0a0e17] border border-[#1e2a3a] rounded-lg shadow-xl",children:g.length===0?y.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):g.map(S=>y.jsxs("button",{type:"button",onClick:()=>_(S),className:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[#1e2a3a] ${x(S)?"bg-accent/10":""}`,children:[y.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${x(S)?"bg-accent border-accent":"border-slate-600"}`,children:x(S)&&y.jsx(Bo,{size:12,className:"text-white"})}),y.jsx("span",{className:"text-slate-200",children:b(S)})]},S.node_num))})]})]}),n&&y.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function JR(e){const[t,r]=W.useState([]),[n,i]=W.useState(!0);W.useEffect(()=>{fetch("/api/channels").then(h=>h.json()).then(h=>{r(h),i(!1)}).catch(()=>{r([]),i(!1)})},[]);const a=h=>{const d=h.role==="PRIMARY"?"Primary":h.role==="SECONDARY"?"Secondary":"";return`${h.index}: ${h.name}${d?` (${d})`:""}`};if(!n&&t.length===0)return e.mode==="single"?y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),y.jsx("input",{type:"number",value:e.value,onChange:h=>e.onChange(Number(h.target.value)),min:e.includeDisabled?-1:0,max:7,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),e.helper&&y.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),y.jsx("input",{type:"text",value:e.value.join(", "),onChange:h=>{const d=h.target.value.split(",").map(v=>parseInt(v.trim())).filter(v=>!isNaN(v));e.onChange(d)},placeholder:"Enter channel numbers separated by commas",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),e.helper&&y.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]});if(e.mode==="single"){const{value:h,onChange:d,label:v,helper:g,includeDisabled:m}=e,x=t.filter(_=>_.enabled);return y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:v}),y.jsxs("select",{value:h,onChange:_=>d(Number(_.target.value)),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:[m&&y.jsx("option",{value:-1,children:"Disabled"}),x.map(_=>y.jsx("option",{value:_.index,children:a(_)},_.index))]}),g&&y.jsx("p",{className:"text-xs text-slate-600",children:g})]})}const{value:o,onChange:s,label:l,helper:u}=e,c=t.filter(h=>h.enabled),f=h=>{o.includes(h)?s(o.filter(d=>d!==h)):s([...o,h].sort((d,v)=>d-v))};return y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),y.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:[c.map(h=>y.jsxs("label",{onClick:()=>f(h.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[y.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${o.includes(h.index)?"bg-accent border-accent":"border-slate-600"}`,children:o.includes(h.index)&&y.jsx(Bo,{size:12,className:"text-white"})}),y.jsx("span",{className:"text-sm text-slate-200",children:a(h)})]},h.index)),c.length===0&&y.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&y.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const JU=[{key:"bot",label:"Bot",icon:ace},{key:"connection",label:"Connection",icon:jS},{key:"response",label:"Response",icon:RZ},{key:"history",label:"History",icon:dce},{key:"memory",label:"Memory",icon:oce},{key:"context",label:"Context",icon:iD},{key:"commands",label:"Commands",icon:FZ},{key:"llm",label:"LLM",icon:EZ},{key:"weather",label:"Weather",icon:su},{key:"meshmonitor",label:"MeshMonitor",icon:Ya},{key:"knowledge",label:"Knowledge",icon:IZ},{key:"mesh_sources",label:"Mesh Sources",icon:NZ},{key:"mesh_intelligence",label:"Intelligence",icon:yv},{key:"dashboard",label:"Dashboard",icon:jZ}],fi={bot:"Identity and behavior settings for the bot on the mesh network.",connection:"How MeshAI connects to your Meshtastic radio.",response:"Controls how quickly and how much the bot responds on the mesh.",history:"Conversation history storage and cleanup.",memory:"Short-term conversation memory management. Controls how the bot maintains context within a conversation.",context:"Passive channel monitoring. The bot listens to mesh channels and uses recent messages as context when responding.",commands:"Mesh commands available via the configured prefix. Toggle individual commands on or off.",llm:"AI model configuration. MeshAI uses an LLM to understand questions and generate responses.",weather:"Weather data for the !weather command. This is separate from NWS environmental alerts.",meshmonitor:"AIDA MeshMonitor integration. An additional data source for mesh network monitoring.",knowledge:"Knowledge base for answering questions from stored documents. Connects to Qdrant vector database or local SQLite.",mesh_sources:"Data sources for mesh network information. MeshAI can pull data from multiple sources simultaneously and merge them into a unified view.",mesh_intelligence:"Advanced mesh analysis: health scoring, region management, and automated alerting. The intelligence engine monitors your mesh and detects problems automatically.",dashboard:"Web dashboard settings. You're looking at it right now."},OQe=[{name:"help",description:"Show available commands and usage"},{name:"health",description:"Mesh network health overview with status dots"},{name:"status",description:"Quick mesh status summary"},{name:"region",description:"List regions or get detailed region breakdown"},{name:"neighbors",description:"Show top infrastructure neighbors with signal quality"},{name:"ping",description:"Test bot responsiveness"},{name:"clear",description:"Clear your conversation history"},{name:"reset",description:"Reset conversation context"},{name:"sub",description:"Subscribe to scheduled reports or alerts"},{name:"unsub",description:"Remove a subscription"},{name:"mysubs",description:"List your active subscriptions"},{name:"alerts",description:"Active NWS weather alerts for mesh area"},{name:"solar",description:"Space weather and HF propagation conditions"},{name:"hf",description:"HF radio propagation (alias for !solar)"},{name:"fire",description:"Active wildfires near the mesh"},{name:"avy",description:"Avalanche advisories for configured zones"},{name:"hotspots",description:"NASA FIRMS satellite fire detections"},{name:"streams",description:"USGS stream gauge readings"},{name:"roads",description:"Road conditions and closures"},{name:"traffic",description:"Traffic flow on monitored corridors"}],EQe=[{value:"US-AL",label:"Alabama"},{value:"US-AK",label:"Alaska"},{value:"US-AZ",label:"Arizona"},{value:"US-AR",label:"Arkansas"},{value:"US-CA",label:"California"},{value:"US-CO",label:"Colorado"},{value:"US-CT",label:"Connecticut"},{value:"US-DE",label:"Delaware"},{value:"US-FL",label:"Florida"},{value:"US-GA",label:"Georgia"},{value:"US-HI",label:"Hawaii"},{value:"US-ID",label:"Idaho"},{value:"US-IL",label:"Illinois"},{value:"US-IN",label:"Indiana"},{value:"US-IA",label:"Iowa"},{value:"US-KS",label:"Kansas"},{value:"US-KY",label:"Kentucky"},{value:"US-LA",label:"Louisiana"},{value:"US-ME",label:"Maine"},{value:"US-MD",label:"Maryland"},{value:"US-MA",label:"Massachusetts"},{value:"US-MI",label:"Michigan"},{value:"US-MN",label:"Minnesota"},{value:"US-MS",label:"Mississippi"},{value:"US-MO",label:"Missouri"},{value:"US-MT",label:"Montana"},{value:"US-NE",label:"Nebraska"},{value:"US-NV",label:"Nevada"},{value:"US-NH",label:"New Hampshire"},{value:"US-NJ",label:"New Jersey"},{value:"US-NM",label:"New Mexico"},{value:"US-NY",label:"New York"},{value:"US-NC",label:"North Carolina"},{value:"US-ND",label:"North Dakota"},{value:"US-OH",label:"Ohio"},{value:"US-OK",label:"Oklahoma"},{value:"US-OR",label:"Oregon"},{value:"US-PA",label:"Pennsylvania"},{value:"US-RI",label:"Rhode Island"},{value:"US-SC",label:"South Carolina"},{value:"US-SD",label:"South Dakota"},{value:"US-TN",label:"Tennessee"},{value:"US-TX",label:"Texas"},{value:"US-UT",label:"Utah"},{value:"US-VT",label:"Vermont"},{value:"US-VA",label:"Virginia"},{value:"US-WA",label:"Washington"},{value:"US-WV",label:"West Virginia"},{value:"US-WI",label:"Wisconsin"},{value:"US-WY",label:"Wyoming"}];function Yo({info:e,link:t,linkText:r="Learn more"}){const[n,i]=W.useState(!1),a=W.useRef(null);return W.useEffect(()=>{if(!n)return;function o(l){a.current&&!a.current.contains(l.target)&&i(!1)}const s=setTimeout(()=>document.addEventListener("mousedown",o),0);return()=>{clearTimeout(s),document.removeEventListener("mousedown",o)}},[n]),y.jsxs("div",{className:"relative inline-block",ref:a,children:[y.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),i(!n)},className:"ml-1.5 w-4 h-4 rounded-full bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-slate-200 inline-flex items-center justify-center text-xs transition-colors",title:"More info",children:"?"}),n&&y.jsxs("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl text-xs text-slate-300 leading-relaxed",children:[y.jsx("button",{type:"button",onClick:()=>i(!1),className:"absolute top-1 right-1 w-5 h-5 rounded hover:bg-slate-700 text-slate-500 hover:text-slate-300 inline-flex items-center justify-center transition-colors","aria-label":"Close",children:y.jsx(zo,{size:12})}),y.jsx("div",{className:"pr-4",children:e}),t&&y.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"mt-2 flex items-center gap-1 text-accent hover:underline",onClick:o=>o.stopPropagation(),children:[r," ",y.jsx(Cd,{size:10})]})]})]})}function hi({text:e}){return y.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function xt({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o="",infoLink:s=""}){const[l,u]=W.useState(!1),c=n==="password";return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&y.jsx(Yo,{info:o,link:s})]}),y.jsxs("div",{className:"relative",children:[y.jsx("input",{type:c&&!l?"password":"text",value:t,onChange:f=>r(f.target.value),placeholder:i,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),c&&y.jsx("button",{type:"button",onClick:()=>u(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:l?y.jsx(DZ,{size:16}):y.jsx(iD,{size:16})})]}),a&&y.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function rt({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&y.jsx(Yo,{info:s,link:l})]}),y.jsx("input",{type:"number",value:t,onChange:u=>r(Number(u.target.value)),min:n,max:i,step:a,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),o&&y.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function yr({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return y.jsxs("div",{className:"flex items-center justify-between py-2",children:[y.jsxs("div",{children:[y.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&y.jsx(Yo,{info:i,link:a})]}),n&&y.jsx("p",{className:"text-xs text-slate-600",children:n})]}),y.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:y.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function ko({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&y.jsx(Yo,{info:a,link:o})]}),y.jsx("select",{value:t,onChange:s=>r(s.target.value),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:n.map(s=>y.jsx("option",{value:s.value,children:s.label},s.value))}),i&&y.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function DQe({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&y.jsx(Yo,{info:a,link:o})]}),y.jsx("textarea",{value:t,onChange:s=>r(s.target.value),rows:n,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent resize-y"}),i&&y.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function Qh({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=W.useState(t.join(", "));W.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>c.trim()).filter(Boolean);r(u)};return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&y.jsx(Yo,{info:i,link:a})]}),y.jsx("input",{type:"text",value:o,onChange:u=>s(u.target.value),onBlur:l,placeholder:"item1, item2, item3",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),n&&y.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function NQe({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=W.useState(t.join(", "));W.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>parseInt(c.trim(),10)).filter(c=>!isNaN(c));r(u)};return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&y.jsx(Yo,{info:i,link:a})]}),y.jsx("input",{type:"text",value:o,onChange:u=>s(u.target.value),onBlur:l,placeholder:"0, 1, 2",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),n&&y.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function Cn({label:e,description:t,checked:r,onChange:n,threshold:i,onThresholdChange:a,thresholdLabel:o,thresholdMin:s,thresholdMax:l,thresholdStep:u=1,thresholdSuffix:c=""}){return y.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3 space-y-2",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex-1",children:[y.jsx("span",{className:"text-sm text-slate-300",children:e}),y.jsx("p",{className:"text-xs text-slate-600",children:t})]}),y.jsx("button",{type:"button",onClick:()=>n(!r),className:`relative w-11 h-6 rounded-full transition-colors flex-shrink-0 ml-3 ${r?"bg-accent":"bg-[#1e2a3a]"}`,children:y.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${r?"translate-x-5":""}`})})]}),r&&i!==void 0&&a&&y.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[y.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),y.jsx("input",{type:"number",value:i,onChange:f=>a(Number(f.target.value)),min:s,max:l,step:u,className:"w-20 px-2 py-1 bg-[#0a0e17] border border-[#1e2a3a] rounded text-xs text-slate-200 font-mono"}),c&&y.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function jQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.bot}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"Bot Name",value:e.name,onChange:r=>t({...e,name:r}),helper:"Name the bot responds to on the mesh",info:"When someone sends a message containing this name, the bot will respond. Also used as the sender name in broadcasts. Changing this requires a restart."}),y.jsx(xt,{label:"Owner",value:e.owner,onChange:r=>t({...e,owner:r}),helper:"Your callsign or identifier",info:"Identifies the bot operator. Shown in !help responses and used for admin-level commands."})]}),y.jsx(yr,{label:"Respond to DMs",checked:e.respond_to_dms,onChange:r=>t({...e,respond_to_dms:r}),helper:"Reply when someone sends a direct message",info:"When enabled, the bot responds to direct messages from any node. When disabled, the bot only responds to channel messages that mention its name."}),y.jsx(yr,{label:"Filter BBS Protocols",checked:e.filter_bbs_protocols,onChange:r=>t({...e,filter_bbs_protocols:r}),helper:"Ignore BBS bulletin board traffic",info:"Filters out automated BBS protocol messages (advBBS, MAIL*, BOARD*) so the bot doesn't try to respond to machine-to-machine traffic."})]})}function RQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.connection}),y.jsx(ko,{label:"Connection Type",value:e.type,onChange:r=>t({...e,type:r}),options:[{value:"serial",label:"Serial (USB)"},{value:"tcp",label:"TCP (Network)"}],helper:"Serial for USB-connected radios, TCP for network or meshtasticd",info:"Serial: direct USB connection to a Meshtastic radio. TCP: connect over the network to a radio's IP or to meshtasticd running on another machine."}),e.type==="serial"?y.jsx(xt,{label:"Serial Port",value:e.serial_port,onChange:r=>t({...e,serial_port:r}),placeholder:"/dev/ttyUSB0",helper:"Device path for your USB radio",info:"Usually /dev/ttyUSB0 on Linux or /dev/ttyACM0. Check with 'ls /dev/tty*' after plugging in your radio."}):y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"TCP Host",value:e.tcp_host,onChange:r=>t({...e,tcp_host:r}),placeholder:"192.168.1.100",helper:"IP address or hostname of the radio/meshtasticd"}),y.jsx(rt,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function BQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.response}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Delay Min (sec)",value:e.delay_min,onChange:r=>t({...e,delay_min:r}),min:0,step:.1,helper:"Minimum wait before responding",info:"Adds a random delay between min and max before the bot sends a response. Prevents the bot from appearing to respond instantly, which can feel unnatural on a radio network."}),y.jsx(rt,{label:"Delay Max (sec)",value:e.delay_max,onChange:r=>t({...e,delay_max:r}),min:0,step:.1,helper:"Maximum wait before responding",info:"Also prevents collisions with other traffic by staggering transmissions."})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Max Length",value:e.max_length,onChange:r=>t({...e,max_length:r}),min:50,max:500,helper:"Maximum characters per response message",info:"Meshtastic packets have limited size. This caps how long each message chunk can be. The bot will split longer responses into multiple messages up to Max Messages."}),y.jsx(rt,{label:"Max Messages",value:e.max_messages,onChange:r=>t({...e,max_messages:r}),min:1,max:10,helper:"Maximum chunks per response",info:"If a response is longer than Max Length, the bot splits it into this many chunks at most. Higher values = more complete answers but more airtime used."})]})]})}function zQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.history}),y.jsx(xt,{label:"Database Path",value:e.database,onChange:r=>t({...e,database:r}),helper:"SQLite file for storing conversation history",info:"Path to the SQLite database file. Created automatically if it doesn't exist. Stores all conversation history for context."}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Max Messages Per User",value:e.max_messages_per_user,onChange:r=>t({...e,max_messages_per_user:r}),min:0,helper:"History limit per user (0 = unlimited)",info:"Limits how many messages are stored per user. Older messages are pruned when the limit is reached. Set to 0 for no limit."}),y.jsx(rt,{label:"Conversation Timeout (sec)",value:e.conversation_timeout,onChange:r=>t({...e,conversation_timeout:r}),min:0,helper:"Seconds before context resets",info:"If a user doesn't message for this long, their next message starts a new conversation context. The bot won't remember the previous topic."})]}),y.jsx(yr,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),y.jsx(rt,{label:"Max Age (days)",value:e.max_age_days,onChange:r=>t({...e,max_age_days:r}),min:1,helper:"Delete conversations older than this"})]})]})}function $Qe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.memory}),y.jsx(yr,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Window Size",value:e.window_size,onChange:r=>t({...e,window_size:r}),min:1,helper:"Recent message pairs kept in full",info:"The bot keeps this many recent exchanges (user message + bot response pairs) as full text in context. Older messages are summarized to save token space."}),y.jsx(rt,{label:"Summarize Threshold",value:e.summarize_threshold,onChange:r=>t({...e,summarize_threshold:r}),min:1,helper:"Messages before older context is summarized",info:"When the conversation exceeds this many messages, older ones outside the window are compressed into a summary by the LLM."})]})]})}function FQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.context}),y.jsx(yr,{label:"Enable Passive Context",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Listen to channel traffic for context",info:"When enabled, the bot monitors mesh channels and includes recent messages in its context. This lets the bot reference things other people said on the channel."}),e.enabled&&y.jsxs(y.Fragment,{children:[y.jsx(JR,{label:"Observe Channels",value:e.observe_channels,onChange:r=>t({...e,observe_channels:r}),helper:"Channels to monitor (empty = all)",info:"Meshtastic channels to listen on. Leave empty to monitor all channels.",mode:"multi"}),y.jsx(KR,{label:"Ignore Nodes",value:e.ignore_nodes,onChange:r=>t({...e,ignore_nodes:r}),helper:"Nodes to exclude from context",info:"Messages from these nodes won't be included in passive context. Useful for filtering out noisy automated nodes."}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),y.jsx(rt,{label:"Max Context Items",value:e.max_context_items,onChange:r=>t({...e,max_context_items:r}),min:1,helper:"Maximum recent messages to include"})]})]})]})}function VQe({data:e,onChange:t}){const r=new Set(e.disabled_commands.map(i=>i.toLowerCase())),n=i=>{const a=i.toLowerCase();r.has(a)?t({...e,disabled_commands:e.disabled_commands.filter(o=>o.toLowerCase()!==a)}):t({...e,disabled_commands:[...e.disabled_commands,i]})};return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.commands}),y.jsx(yr,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&y.jsxs(y.Fragment,{children:[y.jsx(xt,{label:"Command Prefix",value:e.prefix,onChange:i=>t({...e,prefix:i}),helper:"Character that triggers commands (e.g. ! for !help)",info:"Users type this character followed by the command name. Only single characters recommended."}),y.jsxs("div",{className:"space-y-2",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",y.jsx(Yo,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),y.jsx("div",{className:"grid gap-1",children:OQe.map(i=>{const a=!r.has(i.name.toLowerCase());return y.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),y.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),y.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:y.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${a?"translate-x-4":""}`})})]},i.name)})})]})]})]})}function GQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.llm}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(ko,{label:"Backend",value:e.backend,onChange:r=>t({...e,backend:r}),options:[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"google",label:"Google (Gemini)"}],helper:"LLM provider to use",info:"OpenAI: GPT models (gpt-4o, gpt-4o-mini). Anthropic: Claude models (claude-sonnet-4-20250514). Google: Gemini models. Can also point to compatible APIs like Ollama, LM Studio, or Open WebUI by changing the Base URL."}),y.jsx(xt,{label:"Model",value:e.model,onChange:r=>t({...e,model:r}),placeholder:"gpt-4o-mini",helper:"Specific model name",info:"The specific model to use. Common choices: gpt-4o-mini (fast, cheap), gpt-4o (better, costs more), claude-sonnet-4-20250514 (Anthropic equivalent). For local models via Ollama, use the model name you pulled (e.g. llama3.1)."})]}),y.jsx(xt,{label:"API Key",value:e.api_key,onChange:r=>t({...e,api_key:r}),type:"password",helper:"Supports ${ENV_VAR} syntax",info:"Your API key from the provider. You can also use ${ENV_VAR} syntax to read from an environment variable instead of storing the key in the config file."}),y.jsx(xt,{label:"Base URL",value:e.base_url,onChange:r=>t({...e,base_url:r}),placeholder:"https://api.openai.com/v1",helper:"API endpoint (change for local LLMs)",info:"Default API endpoint for the selected backend. Change this to point to a local LLM server (Ollama at http://localhost:11434/v1, Open WebUI, LM Studio, etc.) or a proxy."}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),y.jsx(rt,{label:"Max Response Tokens",value:e.max_response_tokens,onChange:r=>t({...e,max_response_tokens:r}),min:100,helper:"Token limit for LLM responses"})]}),y.jsx(yr,{label:"Use System Prompt",checked:e.use_system_prompt,onChange:r=>t({...e,use_system_prompt:r}),helper:"Enable custom system instructions"}),e.use_system_prompt&&y.jsx(DQe,{label:"System Prompt",value:e.system_prompt,onChange:r=>t({...e,system_prompt:r}),rows:6,helper:"Instructions that shape the bot's personality",info:"Instructions that shape the bot's personality and behavior. The bot always follows these instructions. MeshAI adds mesh health data and environmental context automatically — you don't need to include those here."}),y.jsx(yr,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),y.jsx(yr,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function WQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.weather}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(ko,{label:"Primary Provider",value:e.primary,onChange:r=>t({...e,primary:r}),options:[{value:"openmeteo",label:"Open-Meteo"},{value:"wttr",label:"wttr.in"},{value:"llm",label:"LLM"}],helper:"Main weather data source"}),y.jsx(ko,{label:"Fallback Provider",value:e.fallback,onChange:r=>t({...e,fallback:r}),options:[{value:"openmeteo",label:"Open-Meteo"},{value:"wttr",label:"wttr.in"},{value:"llm",label:"LLM"},{value:"none",label:"None"}],helper:"Backup if primary fails"})]}),y.jsx(xt,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function HQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.meshmonitor}),y.jsx(yr,{label:"Enable MeshMonitor",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Connect to AIDA MeshMonitor instance",info:"MeshMonitor by Yeraze provides node data, battery info, telemetry, and auto-responder patterns. MeshAI uses this as a data source and avoids duplicate responses."}),e.enabled&&y.jsxs(y.Fragment,{children:[y.jsx(xt,{label:"URL",value:e.url,onChange:r=>t({...e,url:r}),placeholder:"http://192.168.1.100:8080",helper:"MeshMonitor API endpoint",info:"Full URL to your MeshMonitor instance. Usually runs on port 8080."}),y.jsx(yr,{label:"Inject Into Prompt",checked:e.inject_into_prompt,onChange:r=>t({...e,inject_into_prompt:r}),helper:"Tell LLM about MeshMonitor commands",info:"Adds MeshMonitor's auto-responder patterns to the LLM context so it knows what commands MeshMonitor handles."}),y.jsx(rt,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),y.jsx(yr,{label:"Polite Mode",checked:e.polite_mode,onChange:r=>t({...e,polite_mode:r}),helper:"Reduce polling frequency",info:"Reduces polling frequency for shared instances to be a good neighbor."})]})]})}function UQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.knowledge}),y.jsx(yr,{label:"Enable Knowledge Base",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Answer questions from stored documents",info:"Uses RAG (Retrieval-Augmented Generation) to answer questions from a knowledge base. Supports Qdrant vector database or local SQLite with FTS5."}),e.enabled&&y.jsxs(y.Fragment,{children:[y.jsx(ko,{label:"Backend",value:e.backend,onChange:r=>t({...e,backend:r}),options:[{value:"auto",label:"Auto (Qdrant -> SQLite)"},{value:"qdrant",label:"Qdrant"},{value:"sqlite",label:"SQLite"}],helper:"Knowledge storage backend",info:"Auto tries Qdrant first, falls back to SQLite. Qdrant provides hybrid search with dense+sparse embeddings. SQLite uses FTS5 keyword search."}),(e.backend==="qdrant"||e.backend==="auto")&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"Qdrant Host",value:e.qdrant_host,onChange:r=>t({...e,qdrant_host:r}),helper:"Qdrant server hostname",info:"IP or hostname of your Qdrant vector database server."}),y.jsx(rt,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),y.jsx(xt,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"TEI Host",value:e.tei_host,onChange:r=>t({...e,tei_host:r}),helper:"Text Embeddings Inference host",info:"TEI service for generating dense embeddings. Uses BAAI/bge-m3 model."}),y.jsx(rt,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),y.jsx(yr,{label:"Use Sparse Embeddings",checked:e.use_sparse,onChange:r=>t({...e,use_sparse:r}),helper:"Enable hybrid search with sparse vectors",info:"Combines dense embeddings with sparse (keyword-based) embeddings using Reciprocal Rank Fusion for better search results."})]}),y.jsx(xt,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),y.jsx(rt,{label:"Top K Results",value:e.top_k,onChange:r=>t({...e,top_k:r}),min:1,max:20,helper:"Number of documents to retrieve"})]})]})}function ZQe({source:e,onChange:t,onDelete:r}){const[n,i]=W.useState(!1),a={meshview:"Web-based mesh monitoring tool. Enter the full URL of a MeshView instance. No API key typically required.",meshmonitor:"AIDA MeshMonitor API. Provides node data and network statistics. Requires API token.",mqtt:"Subscribe directly to a Meshtastic MQTT broker for real-time packet data. This is push-based (instant) vs the polling approach of MeshView/MeshMonitor."};return y.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[y.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[y.jsxs("div",{className:"flex items-center gap-3",children:[n?y.jsx(yu,{size:16}):y.jsx(au,{size:16}),y.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),y.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),y.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),y.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:y.jsx(Jy,{size:14})})]}),n&&y.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),y.jsx(ko,{label:"Type",value:e.type,onChange:o=>t({...e,type:o}),options:[{value:"meshview",label:"MeshView"},{value:"meshmonitor",label:"MeshMonitor"},{value:"mqtt",label:"MQTT Broker"}],info:a[e.type]||""})]}),e.type!=="mqtt"&&y.jsx(xt,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&y.jsx(xt,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),y.jsx(rt,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),y.jsx(xt,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),y.jsx(xt,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),y.jsx(yr,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),y.jsx(rt,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),y.jsx(yr,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),y.jsx(yr,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function YQe({data:e,onChange:t}){const r=()=>{t([...e,{name:"New Source",type:"meshview",url:"",api_token:"",refresh_interval:30,polite_mode:!1,enabled:!0,host:"",port:1883,username:"",password:"",topic_root:"msh/US",use_tls:!1}])};return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.mesh_sources}),e.map((n,i)=>y.jsx(ZQe,{source:n,onChange:a=>{const o=[...e];o[i]=a,t(o)},onDelete:()=>{confirm(`Delete source "${n.name}"?`)&&t(e.filter((a,o)=>o!==i))}},i)),y.jsxs("button",{onClick:r,className:"w-full py-2 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[y.jsx(_v,{size:16})," Add Source"]})]})}function XQe({data:e,onChange:t}){const[r,n]=W.useState(null);return y.jsxs("div",{className:"space-y-6",children:[y.jsx(hi,{text:fi.mesh_intelligence}),y.jsx(yr,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Locality Radius (miles)",value:e.locality_radius_miles,onChange:i=>t({...e,locality_radius_miles:i}),min:1,step:.5,helper:"Region assignment radius",info:"Nodes within this distance of a region anchor point are assigned to that region."}),y.jsx(rt,{label:"Offline Threshold (hours)",value:e.offline_threshold_hours,onChange:i=>t({...e,offline_threshold_hours:i}),min:1,helper:"Time until node marked offline",info:"A node is considered offline after not being heard for this many hours."})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Packet Threshold",value:e.packet_threshold,onChange:i=>t({...e,packet_threshold:i}),min:0,helper:"Min packets per 24h to flag",info:"Minimum packets per 24 hours. Nodes below this are flagged as low activity."}),y.jsx(rt,{label:"Battery Warning %",value:e.battery_warning_percent,onChange:i=>t({...e,battery_warning_percent:i}),min:1,max:100,helper:"Global battery warning level"})]}),y.jsx(KR,{label:"Critical Nodes",value:e.critical_nodes,onChange:i=>t({...e,critical_nodes:i}),helper:"Critical infrastructure nodes",info:"Nodes that get priority alerting when they go offline.",roleFilter:"infrastructure"}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(JR,{label:"Alert Channel",value:e.alert_channel,onChange:i=>t({...e,alert_channel:i}),helper:"Channel for broadcast alerts",info:"Meshtastic channel for broadcast alerts. Select Disabled to turn off channel broadcasting.",mode:"single",includeDisabled:!0}),y.jsx(rt,{label:"Alert Cooldown (min)",value:e.alert_cooldown_minutes,onChange:i=>t({...e,alert_cooldown_minutes:i}),min:1,helper:"Min time between repeat alerts",info:"Minimum minutes between repeated alerts for the same condition. Uses scaling cooldown (12h, 24h, 48h)."})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",y.jsx(Yo,{info:"Regions group mesh nodes by geographic area. Each region has an anchor point (lat/lon) and nodes within the region radius are automatically assigned. Regions enable localized reports, alerts, and health scoring."})]}),e.regions.map((i,a)=>y.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[y.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[y.jsxs("div",{className:"flex items-center gap-3",children:[r===a?y.jsx(yu,{size:16}):y.jsx(au,{size:16}),y.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),y.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),y.jsx("button",{onClick:o=>{if(o.stopPropagation(),confirm(`Delete region "${i.name||"Unnamed Region"}"?`)){const s=e.regions.filter((l,u)=>u!==a);t({...e,regions:s})}},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:y.jsx(Jy,{size:14})})]}),r===a&&y.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),y.jsx(xt,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),y.jsx(rt,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),y.jsx(xt,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),y.jsx(Qh,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),y.jsx(Qh,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),y.jsxs("button",{onClick:()=>{const i={name:"",local_name:"",lat:0,lon:0,description:"",aliases:[],cities:[]};t({...e,regions:[...e.regions,i]}),n(e.regions.length)},className:"w-full py-2 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[y.jsx(_v,{size:16})," Add Region"]})]}),y.jsxs("div",{className:"space-y-3",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",y.jsx(Yo,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),y.jsx(Cn,{label:"Infra Offline",description:"Alert when an infrastructure node (router/repeater) goes offline",checked:e.alert_rules.infra_offline,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_offline:i}})}),y.jsx(Cn,{label:"Infra Recovery",description:"Alert when an offline infrastructure node comes back online",checked:e.alert_rules.infra_recovery,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_recovery:i}})}),y.jsx(Cn,{label:"New Router",description:"Alert when a new router/repeater appears on the mesh",checked:e.alert_rules.new_router,onChange:i=>t({...e,alert_rules:{...e.alert_rules,new_router:i}})}),y.jsx(Cn,{label:"Feeder Offline",description:"Alert when a data source (MeshView/MeshMonitor) stops responding",checked:e.alert_rules.feeder_offline,onChange:i=>t({...e,alert_rules:{...e.alert_rules,feeder_offline:i}})}),y.jsx(Cn,{label:"Single Gateway",description:"Alert when an infrastructure node has only one connection path",checked:e.alert_rules.infra_single_gateway,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_single_gateway:i}})}),y.jsx(Cn,{label:"Region Blackout",description:"Alert when all infrastructure in a region goes offline",checked:e.alert_rules.region_total_blackout,onChange:i=>t({...e,alert_rules:{...e.alert_rules,region_total_blackout:i}})})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),y.jsx(Cn,{label:"Battery Warning",description:"Alert when infra node battery drops below warning threshold",checked:e.alert_rules.battery_warning,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_warning:i}}),threshold:e.alert_rules.battery_warning_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_warning_threshold:i}}),thresholdLabel:"Below",thresholdMin:10,thresholdMax:90,thresholdSuffix:"%"}),y.jsx(Cn,{label:"Battery Critical",description:"Alert at critical battery level",checked:e.alert_rules.battery_critical,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_critical:i}}),threshold:e.alert_rules.battery_critical_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_critical_threshold:i}}),thresholdLabel:"Below",thresholdMin:5,thresholdMax:50,thresholdSuffix:"%"}),y.jsx(Cn,{label:"Battery Emergency",description:"Alert at emergency battery level",checked:e.alert_rules.battery_emergency,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_emergency:i}}),threshold:e.alert_rules.battery_emergency_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_emergency_threshold:i}}),thresholdLabel:"Below",thresholdMin:1,thresholdMax:25,thresholdSuffix:"%"}),y.jsx(Cn,{label:"Battery Trend Declining",description:"Alert when battery shows a declining trend over 7 days",checked:e.alert_rules.battery_trend_declining,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_trend_declining:i}})}),y.jsx(Cn,{label:"Power Source Change",description:"Alert when a node switches between battery and USB power",checked:e.alert_rules.power_source_change,onChange:i=>t({...e,alert_rules:{...e.alert_rules,power_source_change:i}})}),y.jsx(Cn,{label:"Solar Not Charging",description:"Alert when a solar-powered node isn't charging during daylight",checked:e.alert_rules.solar_not_charging,onChange:i=>t({...e,alert_rules:{...e.alert_rules,solar_not_charging:i}})})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),y.jsx(Cn,{label:"High Utilization",description:"Alert when channel utilization stays high for extended periods",checked:e.alert_rules.sustained_high_util,onChange:i=>t({...e,alert_rules:{...e.alert_rules,sustained_high_util:i}}),threshold:e.alert_rules.high_util_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,high_util_threshold:i}}),thresholdLabel:"Above",thresholdMin:5,thresholdMax:50,thresholdSuffix:`% for ${e.alert_rules.high_util_hours}h`}),y.jsx(Cn,{label:"Packet Flood",description:"Alert when a single node sends excessive packets",checked:e.alert_rules.packet_flood,onChange:i=>t({...e,alert_rules:{...e.alert_rules,packet_flood:i}}),threshold:e.alert_rules.packet_flood_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,packet_flood_threshold:i}}),thresholdLabel:"Over",thresholdMin:100,thresholdMax:2e3,thresholdSuffix:"pkts/24h"})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),y.jsx(Cn,{label:"Mesh Score Alert",description:"Alert when overall mesh health score drops below threshold",checked:e.alert_rules.mesh_score_alert,onChange:i=>t({...e,alert_rules:{...e.alert_rules,mesh_score_alert:i}}),threshold:e.alert_rules.mesh_score_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,mesh_score_threshold:i}}),thresholdLabel:"Below",thresholdMin:30,thresholdMax:90,thresholdSuffix:"/100"}),y.jsx(Cn,{label:"Region Score Alert",description:"Alert when a region's health score drops below threshold",checked:e.alert_rules.region_score_alert,onChange:i=>t({...e,alert_rules:{...e.alert_rules,region_score_alert:i}}),threshold:e.alert_rules.region_score_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,region_score_threshold:i}}),thresholdLabel:"Below",thresholdMin:30,thresholdMax:90,thresholdSuffix:"/100"})]})]})]})]})}function qQe({data:e,onChange:t}){return y.jsxs("div",{className:"space-y-4",children:[y.jsx(hi,{text:fi.dashboard}),y.jsx(yr,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(xt,{label:"Host",value:e.host,onChange:r=>t({...e,host:r}),placeholder:"0.0.0.0",helper:"Network bind address",info:"0.0.0.0 = accessible from any device on the network. 127.0.0.1 = only accessible from this machine."}),y.jsx(rt,{label:"Port",value:e.port,onChange:r=>t({...e,port:r}),min:1,max:65535,helper:"Dashboard URL port",info:"Port number for the web dashboard URL. You access the dashboard at http://your-ip:port"})]})]})}function KQe(){var I;const[e,t]=W.useState(null),[r,n]=W.useState(null),[i,a]=W.useState("bot"),[o,s]=W.useState(!0),[l,u]=W.useState(!1),[c,f]=W.useState(null),[h,d]=W.useState(null),[v,g]=W.useState(!1),[m,x]=W.useState(!1),_=W.useCallback(async()=>{try{const k=await fetch("/api/config");if(!k.ok)throw new Error("Failed to fetch config");const E=await k.json();t(E),n(JSON.parse(JSON.stringify(E))),x(!1),f(null)}catch(k){f(k instanceof Error?k.message:"Unknown error")}finally{s(!1)}},[]);W.useEffect(()=>{document.title="Config — MeshAI",_()},[_]),W.useEffect(()=>{e&&r&&x(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const b=async()=>{if(e){u(!0),f(null),d(null);try{const k=e[i],E=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),D=await E.json();if(!E.ok)throw new Error(D.detail||"Save failed");d(`${i} saved successfully`),n(JSON.parse(JSON.stringify(e))),x(!1),D.restart_required&&g(!0),setTimeout(()=>d(null),3e3)}catch(k){f(k instanceof Error?k.message:"Save failed")}finally{u(!1)}}},S=()=>{r&&(t(JSON.parse(JSON.stringify(r))),x(!1))},T=async()=>{try{await fetch("/api/restart",{method:"POST"}),g(!1),d("Restart initiated")}catch{f("Restart failed")}},C=(k,E)=>{e&&t({...e,[k]:E})};if(o)return y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const A=()=>{switch(i){case"bot":return y.jsx(jQe,{data:e.bot,onChange:k=>C("bot",k)});case"connection":return y.jsx(RQe,{data:e.connection,onChange:k=>C("connection",k)});case"response":return y.jsx(BQe,{data:e.response,onChange:k=>C("response",k)});case"history":return y.jsx(zQe,{data:e.history,onChange:k=>C("history",k)});case"memory":return y.jsx($Qe,{data:e.memory,onChange:k=>C("memory",k)});case"context":return y.jsx(FQe,{data:e.context,onChange:k=>C("context",k)});case"commands":return y.jsx(VQe,{data:e.commands,onChange:k=>C("commands",k)});case"llm":return y.jsx(GQe,{data:e.llm,onChange:k=>C("llm",k)});case"weather":return y.jsx(WQe,{data:e.weather,onChange:k=>C("weather",k)});case"meshmonitor":return y.jsx(HQe,{data:e.meshmonitor,onChange:k=>C("meshmonitor",k)});case"knowledge":return y.jsx(UQe,{data:e.knowledge,onChange:k=>C("knowledge",k)});case"mesh_sources":return y.jsx(YQe,{data:e.mesh_sources,onChange:k=>C("mesh_sources",k)});case"mesh_intelligence":return y.jsx(XQe,{data:e.mesh_intelligence,onChange:k=>C("mesh_intelligence",k)});case"dashboard":return y.jsx(qQe,{data:e.dashboard,onChange:k=>C("dashboard",k)});default:return null}},P=((I=JU.find(k=>k.key===i))==null?void 0:I.label)||i;return y.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[y.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:JU.map(({key:k,label:E,icon:D})=>y.jsxs("button",{onClick:()=>a(k),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===k?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[y.jsx(D,{size:16}),y.jsx("span",{children:E}),m&&i===k&&y.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},k))}),y.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[y.jsxs("div",{className:"flex items-center justify-between mb-6",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx(BZ,{size:20,className:"text-slate-500"}),y.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:P})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[m&&y.jsxs("button",{onClick:S,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 bg-bg-hover rounded transition-colors",children:[y.jsx(DS,{size:14}),"Discard"]}),y.jsxs("button",{onClick:b,disabled:l||!m,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm bg-accent text-white rounded hover:bg-accent/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[l?y.jsx(km,{size:14,className:"animate-spin"}):y.jsx(oD,{size:14}),"Save"]})]})]}),v&&y.jsxs("div",{className:"flex items-center justify-between p-3 mb-4 bg-amber-500/10 border border-amber-500/30 rounded-lg",children:[y.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[y.jsx(lu,{size:16}),y.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),y.jsx("button",{onClick:T,className:"px-3 py-1 text-sm bg-amber-500 text-white rounded hover:bg-amber-600 transition-colors",children:"Restart Now"})]}),c&&y.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400",children:[y.jsx(zo,{size:16}),y.jsx("span",{className:"text-sm",children:c})]}),h&&y.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-green-500/10 border border-green-500/30 rounded-lg text-green-400",children:[y.jsx(Bo,{size:16}),y.jsx("span",{className:"text-sm",children:h})]}),y.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:y.jsx("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:A()})})]})]})}function JQe({feed:e}){const t=e.is_loaded?e.consecutive_errors>0?"bg-amber-500":"bg-green-500":"bg-red-500",r=e.is_loaded?e.consecutive_errors>0?`${e.consecutive_errors} errors`:"Healthy":"Not loaded",n=e.last_fetch?new Date(e.last_fetch*1e3).toLocaleTimeString():"Never";return y.jsxs("div",{className:"bg-bg-hover rounded-lg p-4",children:[y.jsxs("div",{className:"flex items-center justify-between mb-2",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:`w-2 h-2 rounded-full ${t}`}),y.jsx("span",{className:"text-sm font-medium text-slate-200 uppercase",children:e.source})]}),y.jsx("span",{className:"text-xs text-slate-400",children:r})]}),y.jsxs("div",{className:"text-xs text-slate-500 space-y-1",children:[y.jsxs("div",{children:["Events: ",e.event_count]}),y.jsxs("div",{children:["Last fetch: ",n]}),e.last_error&&y.jsx("div",{className:"text-amber-500 truncate",children:e.last_error})]})]})}function QQe({event:e}){const t=e.severity.toLowerCase(),r=t==="extreme"||t==="severe"||t==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",Icon:ou,color:"text-red-500"}:t==="moderate"||t==="warning"||t==="priority"?{bg:"bg-amber-500/10",border:"border-amber-500",Icon:lu,color:"text-amber-500"}:{bg:"bg-blue-500/10",border:"border-blue-500",Icon:IS,color:"text-blue-500"},n=r.Icon;return y.jsx("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border}`,children:y.jsxs("div",{className:"flex items-start gap-3",children:[y.jsx(n,{size:16,className:r.color}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[y.jsx("span",{className:"text-sm font-medium text-slate-200",children:e.event_type}),y.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${r.bg} ${r.color}`,children:e.severity})]}),y.jsx("div",{className:"text-sm text-slate-300",children:e.headline})]})]})})}function tae({value:e,onChange:t,disabled:r,centralDisabled:n}){const i="px-2 py-1 text-xs transition-colors";return y.jsxs("div",{className:`flex rounded border border-[#1e2a3a] overflow-hidden ${r?"opacity-40":""}`,children:[y.jsx("button",{type:"button",disabled:r,onClick:()=>t("native"),className:`${i} ${e==="native"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"native"}),y.jsx("button",{type:"button",disabled:r||n,title:n?"Central not available for this adapter":"",onClick:()=>{n||t("central")},className:`${i} ${n?"text-slate-600 cursor-not-allowed":e==="central"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"central"})]})}function eet({title:e,subtitle:t,enabled:r,onEnabled:n,feedSource:i,onFeedSource:a,hasCentral:o,nativeOnly:s,hasKey:l,health:u,events:c,children:f}){const h=s||!o;return y.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{children:[y.jsx("span",{className:"text-sm font-medium text-slate-300",children:e}),t&&y.jsx("p",{className:"text-xs text-slate-600",children:t})]}),y.jsxs("div",{className:"flex items-center gap-4",children:[y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),y.jsx(tae,{value:i,onChange:a,disabled:!r,centralDisabled:h})]}),y.jsx(yr,{label:"",checked:r,onChange:n})]})]}),!l&&y.jsx("div",{className:"text-xs text-amber-400 bg-amber-500/10 rounded p-2",children:"API key not configured — contact admin"}),s&&y.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available for this adapter — native only"}),y.jsx("div",{className:r?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:f}),(u||c&&c.length>0)&&y.jsxs("div",{className:"pt-2 border-t border-[#1e2a3a] space-y-3",children:[y.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"Live status"}),u?y.jsx(JQe,{feed:u}):y.jsx("div",{className:"text-xs text-slate-600",children:"No status reported."}),c&&c.length>0&&y.jsx("div",{className:"space-y-2",children:c.slice(0,5).map((d,v)=>y.jsx(QQe,{event:d},v))})]})]})}const dl={nws:{label:"NWS Weather Alerts",subtitle:"National Weather Service alerts",health:"nws",hasCentral:!0,nativeOnly:!1,hasKey:!0},fires:{label:"NIFC Fire Perimeters",subtitle:"Active wildfires (National Interagency Fire Center)",health:"nifc",hasCentral:!0,nativeOnly:!1,hasKey:!0},firms:{label:"NASA FIRMS Hotspots",subtitle:"Satellite thermal-anomaly detections",health:"firms",hasCentral:!0,nativeOnly:!1,hasKey:!1},swpc:{label:"NOAA Space Weather (SWPC)",subtitle:"Solar indices, geomagnetic storms",health:"swpc",hasCentral:!0,nativeOnly:!1,hasKey:!0},ducting:{label:"Tropospheric Ducting",subtitle:"VHF/UHF extended-range conditions",health:"ducting",hasCentral:!1,nativeOnly:!0,hasKey:!0},traffic:{label:"TomTom Traffic",subtitle:"Traffic flow on monitored corridors",health:"traffic",hasCentral:!0,nativeOnly:!1,hasKey:!0},roads511:{label:"511 Road Conditions",subtitle:"State DOT road events and closures",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!1},usgs_quake:{label:"USGS Earthquakes",subtitle:"Seismic events from the USGS feed",health:"usgs_quake",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs:{label:"USGS Stream Gauges",subtitle:"River and stream water levels",health:"usgs",hasCentral:!0,nativeOnly:!1,hasKey:!0},avalanche:{label:"Avalanche Advisories",subtitle:"Backcountry avalanche danger ratings",health:"avalanche",hasCentral:!1,nativeOnly:!0,hasKey:!0}},_P=[{key:"weather",label:"Weather",icon:su,adapters:["nws"]},{key:"fire",label:"Fire",icon:LS,adapters:["fires","firms"]},{key:"rf",label:"RF Propagation",icon:Ya,adapters:["swpc","ducting"]},{key:"roads",label:"Roads",icon:PS,adapters:["traffic","roads511"]},{key:"geohazards",label:"Geohazards",icon:ES,adapters:["usgs_quake","usgs","avalanche"]},{key:"tracking",label:"Tracking",icon:NS,adapters:[]},{key:"mesh",label:"Mesh Health",icon:yv,adapters:[]}];function tet(){var j,U;const[e,t]=W.useState(null),[r,n]=W.useState(""),[i,a]=W.useState(null),[o,s]=W.useState([]),[l,u]=W.useState(!0),[c,f]=W.useState(!1),[h,d]=W.useState(null),[v,g]=W.useState(null),[m,x]=W.useState(!1),[_,b]=W.useState("weather"),[S,T]=W.useState("nws");W.useEffect(()=>{document.title="Environment — MeshAI",(async()=>{try{const V=await(await fetch("/api/config/environmental")).json();t(V),n(JSON.stringify(V))}catch(G){d(G instanceof Error?G.message:"Failed to load config")}finally{u(!1)}})()},[]),W.useEffect(()=>{const G=async()=>{try{a(await WZ()),s(await HZ())}catch{}};G();const V=setInterval(G,3e4);return()=>clearInterval(V)},[]);const C=e!==null&&JSON.stringify(e)!==r,A=async()=>{if(e){f(!0),d(null),g(null);try{const G=await fetch("/api/config/environmental",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V=await G.json();if(!G.ok)throw new Error(V.detail||"Save failed");n(JSON.stringify(e)),g("Environmental config saved"),V.restart_required&&x(!0),setTimeout(()=>g(null),3e3)}catch(G){d(G instanceof Error?G.message:"Save failed")}finally{f(!1)}}},P=()=>{e&&t(JSON.parse(r))},I=async()=>{try{await fetch("/api/restart",{method:"POST"}),x(!1),g("Restart initiated")}catch{d("Restart failed")}},k=G=>e&&t({...e,...G});if(l)return y.jsx("div",{className:"flex items-center justify-center h-64 text-slate-400",children:"Loading environmental config…"});if(!e)return y.jsx("div",{className:"flex items-center justify-center h-64 text-red-400",children:h||"No config"});const E=G=>i==null?void 0:i.feeds.find(V=>V.source===dl[G].health),D=G=>o.filter(V=>V.source===dl[G].health),N=_P.find(G=>G.key===_),z=N.adapters.length===0?null:S&&N.adapters.includes(S)?S:N.adapters[0],F=G=>{switch(G){case"nws":return y.jsxs(y.Fragment,{children:[y.jsx(Qh,{label:"NWS Zones",value:e.nws_zones,onChange:V=>k({nws_zones:V}),helper:"Zone IDs like IDZ016, IDZ030",infoLink:"https://www.weather.gov/pimar/PubZone"}),y.jsx(xt,{label:"User Agent",value:e.nws.user_agent,onChange:V=>k({nws:{...e.nws,user_agent:V}}),placeholder:"(MeshAI, you@email.com)",helper:"Format: (app_name, contact_email)"}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:V=>k({nws:{...e.nws,tick_seconds:V}}),min:30}),y.jsx(ko,{label:"Min Severity",value:e.nws.severity_min,onChange:V=>k({nws:{...e.nws,severity_min:V}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}]})]})]});case"swpc":return y.jsx("div",{className:"text-xs text-slate-500",children:"No additional settings."});case"ducting":return y.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[y.jsx(rt,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:V=>k({ducting:{...e.ducting,tick_seconds:V}}),min:60}),y.jsx(rt,{label:"Latitude",value:e.ducting.latitude,onChange:V=>k({ducting:{...e.ducting,latitude:V}}),step:.01}),y.jsx(rt,{label:"Longitude",value:e.ducting.longitude,onChange:V=>k({ducting:{...e.ducting,longitude:V}}),step:.01})]});case"fires":return y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(rt,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:V=>k({fires:{...e.fires,tick_seconds:V}}),min:60}),y.jsx(ko,{label:"State",value:e.fires.state,onChange:V=>k({fires:{...e.fires,state:V}}),options:EQe})]});case"avalanche":return y.jsxs(y.Fragment,{children:[y.jsx(rt,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:V=>k({avalanche:{...e.avalanche,tick_seconds:V}}),min:60}),y.jsx(Qh,{label:"Center IDs",value:e.avalanche.center_ids,onChange:V=>k({avalanche:{...e.avalanche,center_ids:V}}),helper:"e.g., SNFAC",infoLink:"https://avalanche.org/avalanche-centers/"}),y.jsx(NQe,{label:"Season Months",value:e.avalanche.season_months,onChange:V=>k({avalanche:{...e.avalanche,season_months:V}}),helper:"e.g., 12, 1, 2, 3, 4"})]});case"usgs":return y.jsxs(y.Fragment,{children:[y.jsx(rt,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:V=>k({usgs:{...e.usgs,tick_seconds:V}}),min:900,helper:"Minimum 15 min (900s)"}),y.jsx(Qh,{label:"Site IDs",value:e.usgs.sites,onChange:V=>k({usgs:{...e.usgs,sites:V}}),helper:"USGS gauge site numbers",infoLink:"https://waterdata.usgs.gov/nwis"})]});case"usgs_quake":return y.jsxs(y.Fragment,{children:[y.jsx(rt,{label:"Tick Seconds",value:e.usgs_quake.tick_seconds,onChange:V=>k({usgs_quake:{...e.usgs_quake,tick_seconds:V}}),min:60}),y.jsx(rt,{label:"Min Magnitude",value:e.usgs_quake.min_magnitude,onChange:V=>k({usgs_quake:{...e.usgs_quake,min_magnitude:V}}),step:.1,min:0}),y.jsx(xt,{label:"Region Tag",value:e.usgs_quake.region,onChange:V=>k({usgs_quake:{...e.usgs_quake,region:V}})}),y.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((V,Y)=>{var K;return y.jsx(rt,{label:V,value:((K=e.usgs_quake.bbox)==null?void 0:K[Y])??0,onChange:ee=>{const le=[...e.usgs_quake.bbox||[0,0,0,0]];le[Y]=ee,k({usgs_quake:{...e.usgs_quake,bbox:le}})},step:.01},V)})}),y.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box [W,S,E,N] geographic filter"})]});case"traffic":return y.jsxs(y.Fragment,{children:[y.jsx(xt,{label:"API Key",value:e.traffic.api_key,onChange:V=>k({traffic:{...e.traffic,api_key:V}}),type:"password",helper:"developer.tomtom.com"}),y.jsx(rt,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:V=>k({traffic:{...e.traffic,tick_seconds:V}}),min:60}),y.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Corridors:"}),(e.traffic.corridors||[]).map((V,Y)=>y.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[y.jsx(xt,{label:"Name",value:V.name,onChange:K=>{const ee=[...e.traffic.corridors];ee[Y]={...V,name:K},k({traffic:{...e.traffic,corridors:ee}})}}),y.jsx(rt,{label:"Lat",value:V.lat,onChange:K=>{const ee=[...e.traffic.corridors];ee[Y]={...V,lat:K},k({traffic:{...e.traffic,corridors:ee}})},step:.01}),y.jsx(rt,{label:"Lon",value:V.lon,onChange:K=>{const ee=[...e.traffic.corridors];ee[Y]={...V,lon:K},k({traffic:{...e.traffic,corridors:ee}})},step:.01}),y.jsx("button",{onClick:()=>k({traffic:{...e.traffic,corridors:e.traffic.corridors.filter((K,ee)=>ee!==Y)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30 rounded",children:"Remove"})]},Y)),y.jsx("button",{onClick:()=>k({traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"})]});case"roads511":return y.jsxs(y.Fragment,{children:[y.jsx(xt,{label:"Base URL",value:e.roads511.base_url,onChange:V=>k({roads511:{...e.roads511,base_url:V}}),placeholder:"https://511.yourstate.gov/api/v2"}),y.jsx(xt,{label:"API Key",value:e.roads511.api_key,onChange:V=>k({roads511:{...e.roads511,api_key:V}}),type:"password",helper:"Leave empty if not required"}),y.jsx(rt,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:V=>k({roads511:{...e.roads511,tick_seconds:V}}),min:60}),y.jsx(Qh,{label:"Endpoints",value:e.roads511.endpoints,onChange:V=>k({roads511:{...e.roads511,endpoints:V}}),helper:"e.g., /get/event"}),y.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((V,Y)=>{var K;return y.jsx(rt,{label:V,value:((K=e.roads511.bbox)==null?void 0:K[Y])??0,onChange:ee=>{const le=[...e.roads511.bbox||[0,0,0,0]];le[Y]=ee,k({roads511:{...e.roads511,bbox:le}})},step:.01},V)})})]});case"firms":return y.jsxs(y.Fragment,{children:[y.jsx(xt,{label:"MAP Key",value:e.firms.map_key,onChange:V=>k({firms:{...e.firms,map_key:V}}),type:"password",helper:"firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),y.jsx(rt,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:V=>k({firms:{...e.firms,tick_seconds:V}}),min:300}),y.jsx(ko,{label:"Satellite Source",value:e.firms.source,onChange:V=>k({firms:{...e.firms,source:V}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (NRT)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (NRT)"},{value:"MODIS_NRT",label:"MODIS (NRT)"}]}),y.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[y.jsx(rt,{label:"Day Range",value:e.firms.day_range,onChange:V=>k({firms:{...e.firms,day_range:V}}),min:1,max:10}),y.jsx(ko,{label:"Min Confidence",value:e.firms.confidence_min,onChange:V=>k({firms:{...e.firms,confidence_min:V}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),y.jsx(rt,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:V=>k({firms:{...e.firms,proximity_km:V}}),step:.5})]}),y.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((V,Y)=>{var K;return y.jsx(rt,{label:V,value:((K=e.firms.bbox)==null?void 0:K[Y])??0,onChange:ee=>{const le=[...e.firms.bbox||[0,0,0,0]];le[Y]=ee,k({firms:{...e.firms,bbox:le}})},step:.01},V)})})]})}},$=e,Z=(G,V)=>{const Y=e[G]||{};k({[G]:{...Y,...V}})};return y.jsxs("div",{className:"space-y-6",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("h1",{className:"text-xl font-semibold text-slate-200",children:"Environment"}),y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx(yr,{label:"Feeds Enabled",checked:e.enabled,onChange:G=>k({enabled:G})}),C&&y.jsxs(y.Fragment,{children:[y.jsxs("button",{onClick:P,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 border border-border rounded",children:[y.jsx(DS,{size:14})," Discard"]}),y.jsxs("button",{onClick:A,disabled:c,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-accent text-white rounded disabled:opacity-50",children:[y.jsx(oD,{size:14})," ",c?"Saving…":"Save"]})]})]})]}),h&&y.jsx("div",{className:"text-sm text-red-400 bg-red-500/10 rounded p-3",children:h}),v&&y.jsx("div",{className:"text-sm text-green-400 bg-green-500/10 rounded p-3",children:v}),m&&y.jsxs("div",{className:"flex items-center justify-between text-sm text-amber-400 bg-amber-500/10 border border-amber-500/30 rounded p-3",children:[y.jsxs("span",{className:"flex items-center gap-2",children:[y.jsx(km,{size:14})," A restart is required for some changes to take effect."]}),y.jsx("button",{onClick:I,className:"px-3 py-1 bg-amber-500/20 hover:bg-amber-500/30 rounded",children:"Restart now"})]}),e.central&&y.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{children:[y.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Central Connection"}),y.jsx("p",{className:"text-xs text-slate-600",children:'NATS JetStream source for any adapter set to "central"'})]}),y.jsx(yr,{label:"",checked:!!e.central.enabled,onChange:G=>k({central:{...e.central,enabled:G}})})]}),y.jsxs("div",{className:e.central.enabled?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:[y.jsx(xt,{label:"URL",value:e.central.url||"",onChange:G=>k({central:{...e.central,url:G}}),placeholder:"nats://central.echo6.mesh:4222"}),y.jsx(xt,{label:"Durable",value:e.central.durable||"",onChange:G=>k({central:{...e.central,durable:G}}),placeholder:"meshai-v04"}),y.jsx(xt,{label:"Region",value:e.central.region||"",onChange:G=>k({central:{...e.central,region:G}}),placeholder:"us.id",helper:"Central v0.9.20 region token (dotted, e.g. 'us.id'). Empty = bare wildcards (all-US firehose)."})]})]}),y.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:_P.map(({key:G,label:V,icon:Y})=>y.jsxs("button",{onClick:()=>{b(G);const K=_P.find(ee=>ee.key===G);T(K.adapters[0]??null)},className:`flex items-center gap-2 px-4 py-2 text-sm whitespace-nowrap border-b-2 -mb-px transition-colors ${_===G?"border-accent text-accent":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[y.jsx(Y,{size:15})," ",V]},G))}),_==="tracking"&&y.jsxs("div",{className:"flex flex-col items-center justify-center h-[40vh] text-center",children:[y.jsx(NS,{size:32,className:"text-slate-600 mb-4"}),y.jsx("p",{className:"text-slate-500 max-w-md",children:"No adapters yet. ADS-B / AIS / satellite passes are planned for v0.5."})]}),_==="mesh"&&y.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{children:[y.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Mesh Health"}),y.jsx("p",{className:"text-xs text-slate-600",children:"Node/infra telemetry — sourced from the mesh, not an environmental feed."})]}),y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),y.jsx(tae,{value:"native",onChange:()=>{},disabled:!1,centralDisabled:!0})]})]}),y.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available — reserved for a future migration."})]}),N.adapters.length>0&&z&&y.jsxs(y.Fragment,{children:[N.adapters.length>1&&y.jsx("div",{className:"flex gap-1",children:N.adapters.map(G=>y.jsx("button",{onClick:()=>T(G),className:`px-3 py-1.5 text-sm rounded ${z===G?"bg-bg-hover text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:dl[G].label},G))}),y.jsx(eet,{title:dl[z].label,subtitle:dl[z].subtitle,enabled:((j=$[z])==null?void 0:j.enabled)??!1,onEnabled:G=>Z(z,{enabled:G}),feedSource:((U=$[z])==null?void 0:U.feed_source)??"native",onFeedSource:G=>Z(z,{feed_source:G}),hasCentral:dl[z].hasCentral,nativeOnly:dl[z].nativeOnly,hasKey:dl[z].hasKey,health:E(z),events:D(z),children:F(z)})]})]})}const QU={infra_offline:VZ,infra_recovery:jS,battery_warning:gA,battery_critical:gA,battery_emergency:gA,hf_blackout:Lm,uhf_ducting:Ya,weather_warning:su,weather_watch:su,new_router:Ya,packet_flood:lu,sustained_high_util:lu,region_blackout:ou,default:Pm};function ret(e){return QU[e]||QU.default}function rae(e){switch(e==null?void 0:e.toLowerCase()){case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",badge:"bg-red-500/20 text-red-400",iconColor:"text-red-500"};case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",badge:"bg-amber-500/20 text-amber-400",iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",badge:"bg-blue-500/20 text-blue-400",iconColor:"text-blue-500"}}}function net(e){const t=typeof e=="number"?new Date(e*1e3):new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/1e3),a=Math.floor(i/60),o=Math.floor(a/60),s=Math.floor(o/24);return i<60?"Just now":a<60?`${a}m ago`:o<24?`${o}h ago`:`${s}d ago`}function iet(e){return(typeof e=="number"?new Date(e*1e3):new Date(e)).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function aet(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`${Math.floor(e/86400)}d`}function oet({alert:e,onAcknowledge:t}){var i;const r=rae(e.severity),n=ret(e.type);return y.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-4 ${r.border}`,children:y.jsxs("div",{className:"flex items-start gap-3",children:[y.jsx(n,{size:20,className:r.iconColor}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[y.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),y.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),y.jsx("div",{className:"text-sm text-slate-200",children:e.message}),y.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(Td,{size:12}),e.timestamp?net(e.timestamp):"Just now"]}),e.scope_value&&y.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),y.jsx("button",{onClick:()=>t(e),className:"px-3 py-1 text-xs text-slate-400 hover:text-slate-200 border border-border rounded hover:bg-bg-hover transition-colors",children:"Acknowledge"})]})})}function set({history:e,typeFilter:t,severityFilter:r,onTypeFilterChange:n,onSeverityFilterChange:i,page:a,totalPages:o,onPageChange:s}){const l=["all","infra_offline","infra_recovery","battery_warning","battery_critical","hf_blackout","uhf_ducting","weather_warning","new_router","packet_flood"],u=["all","immediate","priority","routine"];return y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg",children:[y.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(aD,{size:14,className:"text-slate-400"}),y.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),y.jsx("select",{value:t,onChange:c=>n(c.target.value),className:"bg-bg border border-border rounded px-3 py-1.5 text-sm text-slate-200 focus:outline-none focus:border-blue-500",children:l.map(c=>y.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),y.jsx("select",{value:r,onChange:c=>i(c.target.value),className:"bg-bg border border-border rounded px-3 py-1.5 text-sm text-slate-200 focus:outline-none focus:border-blue-500",children:u.map(c=>y.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),y.jsx("div",{className:"overflow-x-auto",children:y.jsxs("table",{className:"w-full",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"border-b border-border",children:[y.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),y.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),y.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),y.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),y.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),y.jsx("tbody",{children:e.length>0?e.map((c,f)=>{const h=rae(c.severity);return y.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[y.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:iet(c.timestamp)}),y.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),y.jsx("td",{className:"p-4",children:y.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${h.badge}`,children:c.severity})}),y.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),y.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?aet(c.duration):"-"})]},c.id||f)}):y.jsx("tr",{children:y.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&y.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[y.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{onClick:()=>s(a-1),disabled:a<=1,className:"p-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",children:y.jsx(lce,{size:16})}),y.jsx("button",{onClick:()=>s(a+1),disabled:a>=o,className:"p-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",children:y.jsx(au,{size:16})})]})]})]})}function uet({subscription:e,nodes:t}){const r=o=>{const s=t.find(l=>l.node_id_hex===o||String(l.node_num)===o||l.short_name===o);return s?s.long_name&&s.long_name!==s.short_name?`${s.short_name} (${s.long_name})`:s.short_name:o},n=()=>{if(e.sub_type==="alerts")return"Real-time";const o=e.schedule_time||"0000",s=parseInt(o.slice(0,2)),l=o.slice(2),u=s>=12?"PM":"AM";let f=`${s%12||12}:${l} ${u}`;return e.sub_type==="weekly"&&e.schedule_day&&(f+=` ${e.schedule_day.charAt(0).toUpperCase()}${e.schedule_day.slice(1)}`),f},a=(()=>{switch(e.sub_type){case"alerts":return Pm;case"daily":return Td;case"weekly":return Td;default:return Pm}})();return y.jsx("div",{className:"p-4 rounded-lg bg-bg-hover border border-border",children:y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:y.jsx(a,{size:18,className:"text-blue-400"})}),y.jsxs("div",{className:"flex-1",children:[y.jsxs("div",{className:"text-sm text-slate-200 font-medium",children:[e.sub_type.charAt(0).toUpperCase()+e.sub_type.slice(1),e.scope_type!=="mesh"&&e.scope_value&&y.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),y.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," • ",r(e.user_id)]})]}),y.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function cet(){const[e,t]=W.useState([]),[r,n]=W.useState([]),[i,a]=W.useState([]),[o,s]=W.useState([]),[l,u]=W.useState(!0),[c,f]=W.useState(null),[h,d]=W.useState("all"),[v,g]=W.useState("all"),[m,x]=W.useState(1),[_,b]=W.useState(1),S=20,[T,C]=W.useState(new Set),{lastAlert:A}=lD();W.useEffect(()=>{document.title="Alerts — MeshAI"},[]),W.useEffect(()=>{Promise.all([GZ().catch(()=>[]),SB(S,0).catch(()=>({items:[],total:0})),Cce().catch(()=>[]),fetch("/api/nodes").then(k=>k.json()).catch(()=>[])]).then(([k,E,D,N])=>{t(k),Array.isArray(E)?(n(E),b(1)):(n(E.items||[]),b(Math.ceil((E.total||0)/S))),a(D),s(N),u(!1)}).catch(k=>{f(k.message),u(!1)})},[]),W.useEffect(()=>{A&&t(k=>k.some(D=>D.type===A.type&&D.message===A.message)?k:[A,...k])},[A]),W.useEffect(()=>{const k=(m-1)*S;SB(S,k,h,v).then(E=>{Array.isArray(E)?(n(E),b(1)):(n(E.items||[]),b(Math.ceil((E.total||0)/S)))}).catch(()=>{})},[m,h,v]);const P=W.useCallback(k=>{const E=`${k.type}-${k.message}-${k.timestamp}`;C(D=>new Set([...D,E]))},[]),I=e.filter(k=>{const E=`${k.type}-${k.message}-${k.timestamp}`;return!T.has(E)});return l?y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):y.jsxs("div",{className:"space-y-6",children:[y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[y.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[y.jsx(lu,{size:14}),"Active Alerts (",I.length,")"]}),I.length>0?y.jsx("div",{className:"space-y-3",children:I.map((k,E)=>y.jsx(oet,{alert:k,onAcknowledge:P},`${k.type}-${k.timestamp}-${E}`))}):y.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[y.jsx(nD,{size:20,className:"text-green-500"}),y.jsx("span",{children:"No active alerts — all systems nominal"})]})]}),y.jsxs("div",{children:[y.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[y.jsx(Td,{size:14}),"Alert History"]}),y.jsx(set,{history:r,typeFilter:h,severityFilter:v,onTypeFilterChange:k=>{d(k),x(1)},onSeverityFilterChange:k=>{g(k),x(1)},page:m,totalPages:_,onPageChange:x})]}),y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[y.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[y.jsx(_ce,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?y.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(k=>y.jsx(uet,{subscription:k,nodes:o},k.id))}):y.jsxs("div",{className:"text-slate-500 py-4",children:[y.jsx("p",{children:"No active subscriptions."}),y.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",y.jsx("code",{className:"text-blue-400",children:"!subscribe"})," on mesh"]})]})]})]})}const Tb=[{value:"routine",label:"Routine",description:"Informational, no time pressure (ducting, new node, weather advisory, battery declining)"},{value:"priority",label:"Priority",description:"Needs attention soon (severe weather, fire nearby, node offline, HF blackout)"},{value:"immediate",label:"Immediate",description:"Act now, drop everything (fire at infrastructure, extreme weather, region blackout)"}],e7=[{id:"mesh_health",name:"Mesh Health Monitoring",description:"Infrastructure problems - offline nodes, low battery, channel congestion",rule:{name:"Mesh Health Monitoring",enabled:!0,trigger_type:"condition",categories:["infra_offline","critical_node_down","infra_recovery","battery_warning","battery_critical","battery_emergency","high_utilization","packet_flood","mesh_score_low"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,override_quiet:!1,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"weather_fire",name:"Weather & Fire Alerts",description:"Environmental threats - severe weather, nearby wildfires, new ignitions, flooding",rule:{name:"Weather & Fire Alerts",enabled:!0,trigger_type:"condition",categories:["weather_warning","fire_proximity","new_ignition","stream_flood_warning"],min_severity:"priority",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:15,override_quiet:!1,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"rf_conditions",name:"RF Conditions",description:"Propagation changes - solar events, HF blackouts, tropospheric ducting",rule:{name:"RF Conditions",enabled:!0,trigger_type:"condition",categories:["hf_blackout","tropospheric_ducting","geomagnetic_storm"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:60,override_quiet:!1,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"road_traffic",name:"Road & Traffic",description:"Road closures and severe congestion",rule:{name:"Road & Traffic",enabled:!0,trigger_type:"condition",categories:["road_closure","traffic_congestion"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,override_quiet:!1,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"everything_critical",name:"Everything Critical",description:"All emergency-level events regardless of type",rule:{name:"Everything Critical",enabled:!0,trigger_type:"condition",categories:[],min_severity:"immediate",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:5,override_quiet:!0,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"morning_briefing",name:"Morning Briefing",description:"Daily health and conditions summary at 7am",rule:{name:"Morning Briefing",enabled:!0,trigger_type:"schedule",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"mesh_health_summary",custom_message:"",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:0,override_quiet:!1,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}}];function G_(e){if(!e)return"Never";const r=Date.now()/1e3-e;return r<60?"Just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function ia({info:e}){const[t,r]=W.useState(!1);return y.jsxs("div",{className:"relative inline-block",children:[y.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),r(!t)},className:"ml-1.5 w-4 h-4 rounded-full bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-slate-200 inline-flex items-center justify-center text-xs transition-colors",title:"More info",children:"?"}),t&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),y.jsx("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl text-xs text-slate-300 leading-relaxed",children:e})]})]})}function Sl({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o=""}){const[s,l]=W.useState(!1),u=n==="password";return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&y.jsx(ia,{info:o})]}),y.jsxs("div",{className:"relative",children:[y.jsx("input",{type:u&&!s?"password":"text",value:t,onChange:c=>r(c.target.value),placeholder:i,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),u&&y.jsx("button",{type:"button",onClick:()=>l(!s),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:s?y.jsx(DZ,{size:16}):y.jsx(iD,{size:16})})]}),a&&y.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function Hy({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&y.jsx(ia,{info:s})]}),y.jsx("input",{type:"number",value:t,onChange:l=>r(Number(l.target.value)),min:n,max:i,step:a,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),o&&y.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function Jc({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return y.jsxs("div",{className:"flex items-center justify-between py-2",children:[y.jsxs("div",{children:[y.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&y.jsx(ia,{info:i})]}),n&&y.jsx("p",{className:"text-xs text-slate-600",children:n})]}),y.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:y.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Sc({label:e,value:t,onChange:r,helper:n="",info:i=""}){return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&y.jsx(ia,{info:i})]}),y.jsx("input",{type:"time",value:t,onChange:a=>r(a.target.value),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent"}),n&&y.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function Cb({label:e,value:t,onChange:r,placeholder:n="Add item...",helper:i="",info:a=""}){const[o,s]=W.useState(""),l=()=>{o.trim()&&!t.includes(o.trim())&&(r([...t,o.trim()]),s(""))},u=c=>{r(t.filter((f,h)=>h!==c))};return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&y.jsx(ia,{info:a})]}),y.jsxs("div",{className:"flex gap-2",children:[y.jsx("input",{type:"text",value:o,onChange:c=>s(c.target.value),onKeyDown:c=>c.key==="Enter"&&(c.preventDefault(),l()),className:"flex-1 px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent",placeholder:n}),y.jsx("button",{type:"button",onClick:l,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm text-white transition-colors",children:y.jsx(_v,{size:16})})]}),t.length>0&&y.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,f)=>y.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,y.jsx("button",{type:"button",onClick:()=>u(f),className:"text-slate-500 hover:text-red-400",children:y.jsx(zo,{size:14})})]},f))}),i&&y.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function nae({value:e,onChange:t}){const[r,n]=W.useState(!1),i=Tb.find(a=>a.value===e)||Tb[0];return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",y.jsx(ia,{info:"Only alerts at or above this severity trigger this rule. ROUTINE = informational, PRIORITY = needs attention, IMMEDIATE = act now."})]}),y.jsxs("div",{className:"relative",children:[y.jsxs("button",{type:"button",onClick:()=>n(!r),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-left flex items-center justify-between hover:border-accent transition-colors",children:[y.jsxs("div",{children:[y.jsx("span",{className:"text-slate-200",children:i.label}),y.jsxs("span",{className:"text-slate-500 ml-2",children:["- ",i.description]})]}),y.jsx(yu,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),y.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-[#0a0e17] border border-[#1e2a3a] rounded-lg shadow-xl overflow-hidden",children:Tb.map(a=>y.jsxs("button",{type:"button",onClick:()=>{t(a.value),n(!1)},className:`w-full px-3 py-2.5 text-left text-sm hover:bg-[#1e2a3a] transition-colors ${e===a.value?"bg-accent/10":""}`,children:[y.jsx("div",{className:"font-medium text-slate-200",children:a.label}),y.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),y.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function W_({rule:e}){const[t,r]=W.useState(!1),[n,i]=W.useState(null),a=async()=>{r(!0),i(null);try{let s={type:e.delivery_type};e.delivery_type==="mesh_broadcast"?s.channel_index=e.broadcast_channel:e.delivery_type==="mesh_dm"?s.node_ids=e.node_ids:e.delivery_type==="email"?s={type:"email",smtp_host:e.smtp_host,smtp_port:e.smtp_port,smtp_user:e.smtp_user,smtp_password:e.smtp_password,smtp_tls:e.smtp_tls,from_address:e.from_address,recipients:e.recipients}:e.delivery_type==="webhook"&&(s={type:"webhook",url:e.webhook_url,headers:e.webhook_headers});const u=await(await fetch("/api/notifications/channels/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();i(u)}catch(s){i({success:!1,message:"Test failed",error:s instanceof Error?s.message:"Unknown error",details:{}})}finally{r(!1)}};if(!e.delivery_type)return null;const o={mesh_broadcast:y.jsx(Ya,{size:14}),mesh_dm:y.jsx(RZ,{size:14}),email:y.jsx(pce,{size:14}),webhook:y.jsx(vce,{size:14})}[e.delivery_type]||y.jsx(jS,{size:14});return y.jsxs("div",{className:"space-y-2",children:[y.jsx("button",{type:"button",onClick:a,disabled:t,className:"flex items-center gap-2 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",children:t?y.jsxs(y.Fragment,{children:[y.jsx(km,{size:14,className:"animate-spin"}),"Testing..."]}):y.jsxs(y.Fragment,{children:[o,"Test Channel"]})}),n&&y.jsx("div",{className:`p-2 rounded text-xs ${n.success?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:y.jsxs("div",{className:"flex items-start gap-2",children:[n.success?y.jsx(Bo,{size:14,className:"mt-0.5 flex-shrink-0"}):y.jsx(zo,{size:14,className:"mt-0.5 flex-shrink-0"}),y.jsxs("div",{children:[y.jsx("div",{className:"font-medium",children:n.message}),n.error&&y.jsx("div",{className:"mt-1 text-red-300",children:n.error})]})]})})]})}function fet({rule:e,ruleIndex:t,categories:r,regions:n,quietHoursEnabled:i,onChange:a,onDelete:o,onDuplicate:s,onTest:l}){var N,z,F,$,Z;const[u,c]=W.useState(!e.name),[f,h]=W.useState(!1),[d,v]=W.useState(null),[g,m]=W.useState(null);W.useEffect(()=>{var j;e.name&&t>=0&&(fetch(`/api/notifications/rules/${t}/stats`).then(U=>U.json()).then(U=>v(U)).catch(()=>{}),(j=e.categories)!=null&&j.length&&fetch("/api/notifications/rules/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:e.categories})}).then(U=>U.json()).then(U=>m(U)).catch(()=>{}))},[e.name,t,e.categories]);const x=[{value:"",label:"(None)",description:"Rule matches but does not deliver"},{value:"mesh_broadcast",label:"Mesh Broadcast",description:"Send to a mesh radio channel"},{value:"mesh_dm",label:"Mesh DM",description:"Direct message to specific nodes"},{value:"email",label:"Email",description:"Send via SMTP"},{value:"webhook",label:"Webhook",description:"POST to any URL"}],_=[{value:"daily",label:"Daily"},{value:"twice_daily",label:"Twice Daily"},{value:"weekly",label:"Weekly"}],b=[{value:"mesh_health_summary",label:"Mesh Health Summary",description:"Current health score, pillar breakdown, problem nodes"},{value:"rf_propagation_report",label:"RF Propagation Report",description:"Solar indices, Kp, ducting conditions"},{value:"alerts_digest",label:"Active Alerts Digest",description:"Summary of all active environmental alerts"},{value:"environmental_conditions",label:"Environmental Conditions",description:"Full conditions: weather, fire, streams, roads"},{value:"custom",label:"Custom Message",description:"Write your own with template tokens"}],S=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],T=j=>{const U=e.categories||[];U.includes(j)?a({...e,categories:U.filter(G=>G!==j)}):a({...e,categories:[...U,j]})},C=(j,U)=>{const G=e.categories||[];if(U==="add"){const V=Array.from(new Set([...G,...j]));a({...e,categories:V})}else{const V=new Set(j);a({...e,categories:G.filter(Y=>!V.has(Y))})}},A=j=>{const U=e.region_scope||[];U.includes(j)?a({...e,region_scope:U.filter(G=>G!==j)}):a({...e,region_scope:[...U,j]})},P=j=>{const U=e.schedule_days||[];U.includes(j)?a({...e,schedule_days:U.filter(G=>G!==j)}):a({...e,schedule_days:[...U,j]})},I=async()=>{h(!0),await l(),h(!1)},k=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const j=e.categories||[];if(j.length===0&&r.length>0)return r[0].example_message||"Alert notification";const U=r.find(G=>j.includes(G.id));return(U==null?void 0:U.example_message)||"Alert notification"},E=()=>{var U,G,V,Y,K,ee,le,he;const j=[];if(e.trigger_type==="schedule"){const Re=((U=_.find(ne=>ne.value===e.schedule_frequency))==null?void 0:U.label)||e.schedule_frequency,ge=((G=b.find(ne=>ne.value===e.message_type))==null?void 0:G.label)||e.message_type;j.push(`${Re} at ${e.schedule_time||"??:??"}`),j.push(ge)}else{const Re=((V=e.categories)==null?void 0:V.length)||0,ge=Re===0?"All":r.filter(fe=>{var ue;return(ue=e.categories)==null?void 0:ue.includes(fe.id)}).map(fe=>fe.name).slice(0,2).join(", ")+(Re>2?` +${Re-2}`:""),ne=((Y=Tb.find(fe=>fe.value===e.min_severity))==null?void 0:Y.label)||e.min_severity;j.push(`${ge} at ${ne}+`)}if(!e.delivery_type)j.push("No delivery");else{const Re=((K=x.find(ne=>ne.value===e.delivery_type))==null?void 0:K.label)||e.delivery_type;let ge="";if(e.delivery_type==="mesh_broadcast")ge=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")ge=`${((ee=e.node_ids)==null?void 0:ee.length)||0} nodes`;else if(e.delivery_type==="email")ge=(le=e.recipients)!=null&&le.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{ge=new URL(e.webhook_url).hostname}catch{ge=((he=e.webhook_url)==null?void 0:he.slice(0,20))||"no URL"}j.push(`${Re}${ge?` (${ge})`:""}`)}return j.join(" -> ")},D=()=>{var U;if(!g||!((U=e.categories)!=null&&U.length))return null;const j=new Map;for(const[,G]of Object.entries(g)){const V=j.get(G.source);V?(V.events+=G.active_events,V.enabled=V.enabled&&G.enabled):j.set(G.source,{enabled:G.enabled,events:G.active_events})}return Array.from(j.entries()).map(([G,{enabled:V,events:Y}])=>y.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs ${V?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,title:V?`${Y} active`:"Not enabled",children:[V?y.jsx(jS,{size:10}):y.jsx(VZ,{size:10}),G.toUpperCase(),V&&Y>0&&` (${Y})`]},G))};return y.jsxs("div",{className:`border rounded-lg overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[y.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>c(!u),children:[y.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[u?y.jsx(yu,{size:16,className:"text-slate-500 flex-shrink-0"}):y.jsx(au,{size:16,className:"text-slate-500 flex-shrink-0"}),y.jsx("button",{onClick:j=>{j.stopPropagation(),a({...e,enabled:!e.enabled})},className:`w-2 h-2 rounded-full flex-shrink-0 ${e.enabled?"bg-green-500":"bg-slate-500"}`,title:e.enabled?"Enabled":"Disabled"}),e.trigger_type==="schedule"?y.jsx(Td,{size:14,className:"text-blue-400 flex-shrink-0"}):y.jsx(Lm,{size:14,className:"text-yellow-400 flex-shrink-0"}),y.jsx("span",{className:"font-medium text-slate-200 truncate",title:e.name||void 0,children:e.name||"New Rule"}),!u&&y.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:E()})]}),y.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!u&&(()=>{const j="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs mr-2";if(!e.enabled)return y.jsx("span",{className:`${j} bg-slate-800 text-slate-500`,children:"Disabled"});if(!d)return null;const U=d.fire_count||0,G=d.last_fired,V=Date.now()/1e3-7*86400;return U>0&&G&&G>=V?y.jsx("span",{className:`${j} bg-green-500/10 text-green-400`,title:`Last fired ${G_(G)}`,children:"Active"}):U>0&&G?y.jsx("span",{className:`${j} bg-yellow-500/10 text-yellow-400`,title:`Last fired ${G_(G)}`,children:"Idle (no recent activity)"}):y.jsx("span",{className:`${j} bg-slate-800 text-slate-400`,children:"No activity yet"})})(),!u&&y.jsx("div",{className:"hidden md:flex items-center gap-1 mr-2",children:D()}),y.jsx("button",{onClick:j=>{j.stopPropagation(),I()},disabled:f||!e.name,className:"p-1.5 text-blue-400 hover:text-blue-300 hover:bg-blue-500/10 rounded disabled:opacity-50",title:"Test rule",children:y.jsx(bB,{size:14})}),y.jsx("button",{onClick:j=>{j.stopPropagation(),s()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:y.jsx(hce,{size:14})}),y.jsx("button",{onClick:j=>{j.stopPropagation(),o()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:y.jsx(Jy,{size:14})})]})]}),!u&&e.name&&y.jsxs("div",{className:"px-3 pb-2 pt-0 bg-[#0a0e17] flex items-center gap-2 flex-wrap text-xs",children:[!e.delivery_type&&y.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-500/10 text-amber-400 rounded",children:[y.jsx(ou,{size:10}),"No delivery method"]}),(d==null?void 0:d.fire_count)!==void 0&&d.fire_count>0&&y.jsxs("span",{className:"text-slate-500",children:["Fired ",d.fire_count,"x"]})]}),u&&y.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[y.jsx(Sl,{label:"Rule Name",value:e.name,onChange:j=>a({...e,name:j}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),y.jsxs("div",{className:"flex gap-2",children:[y.jsxs("button",{type:"button",onClick:()=>a({...e,trigger_type:"condition"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors ${e.trigger_type!=="schedule"?"bg-accent/10 border-accent text-accent":"bg-[#0a0e17] border-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:[y.jsx(Lm,{size:16}),y.jsx("span",{children:"Condition"})]}),y.jsxs("button",{type:"button",onClick:()=>a({...e,trigger_type:"schedule"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors ${e.trigger_type==="schedule"?"bg-accent/10 border-accent text-accent":"bg-[#0a0e17] border-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:[y.jsx(Td,{size:16}),y.jsx("span",{children:"Schedule"})]})]}),y.jsx("p",{className:"text-xs text-slate-600",children:e.trigger_type==="schedule"?"Send reports on a schedule (daily briefings, weekly digests)":"React to alert conditions (fires, outages, weather warnings)"})]}),e.trigger_type!=="schedule"&&y.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[y.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[y.jsx(lu,{size:14}),"WHEN (Condition)"]}),y.jsx(nae,{value:e.min_severity,onChange:j=>a({...e,min_severity:j})}),y.jsxs("div",{className:"space-y-2",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",y.jsx(ia,{info:"Select which types of alerts trigger this rule. Leave all unchecked to match ALL categories. Categories are grouped by family — use the 'All' / 'Clear' buttons in each header to bulk-toggle."})]}),y.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((N=e.categories)==null?void 0:N.length)||0)===0?"All categories (none selected)":`${(z=e.categories)==null?void 0:z.length} selected`}),y.jsx(het,{categories:r,selected:e.categories||[],onToggle:T,onSelectMany:C})]}),g&&Object.keys(g).length>0&&y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Data Sources"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:D()})]})]}),e.trigger_type==="schedule"&&y.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[y.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[y.jsx(sce,{size:14}),"WHEN (Schedule)"]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),y.jsx("select",{value:e.schedule_frequency||"daily",onChange:j=>a({...e,schedule_frequency:j.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:_.map(j=>y.jsx("option",{value:j.value,children:j.label},j.value))})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(Sc,{label:"Time",value:e.schedule_time||"07:00",onChange:j=>a({...e,schedule_time:j})}),e.schedule_frequency==="twice_daily"&&y.jsx(Sc,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:j=>a({...e,schedule_time_2:j})})]}),e.schedule_frequency==="weekly"&&y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:S.map(j=>{var U;return y.jsx("button",{type:"button",onClick:()=>P(j),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(U=e.schedule_days)!=null&&U.includes(j)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:j.slice(0,3)},j)})})]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),y.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:j=>a({...e,message_type:j.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:b.map(j=>y.jsx("option",{value:j.value,children:j.label},j.value))}),y.jsx("p",{className:"text-xs text-slate-600",children:(F=b.find(j=>j.value===e.message_type))==null?void 0:F.description})]}),e.message_type==="custom"&&y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",y.jsx(ia,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),y.jsx("textarea",{value:e.custom_message||"",onChange:j=>a({...e,custom_message:j.target.value}),rows:4,placeholder:"Good morning! Mesh health: {MESH_SCORE}/100 with {NODE_COUNT} nodes online.",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"})]})]}),y.jsxs("div",{className:"space-y-2 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[y.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[y.jsx(xv,{size:14}),"REGIONS",y.jsx(ia,{info:"Limit this rule to alerts from specific regions. Empty selection = all regions (backward compatible). Region names come from /api/regions."})]}),y.jsx("div",{className:"text-xs text-slate-500",children:((($=e.region_scope)==null?void 0:$.length)||0)===0?"All regions (none selected)":`${e.region_scope.length} of ${n.length} selected`}),n.length===0?y.jsx("div",{className:"text-xs text-slate-600 italic",children:"No regions configured."}):y.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(j=>{const U=(e.region_scope||[]).includes(j.name);return y.jsx("button",{type:"button",onClick:()=>A(j.name),className:`px-3 py-1.5 rounded text-sm transition-colors ${U?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,title:j.local_name||j.name,children:j.local_name||j.name},j.name)})})]}),y.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[y.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[y.jsx(bB,{size:14}),"SEND VIA"]}),y.jsxs("div",{className:"space-y-1",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",y.jsx(ia,{info:"Where this notification gets delivered. Select (None) to save the rule without delivery - it will match conditions but won't send until you configure a delivery method."})]}),y.jsx("select",{value:e.delivery_type||"",onChange:j=>a({...e,delivery_type:j.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:x.map(j=>y.jsx("option",{value:j.value,children:j.label},j.value))}),y.jsx("p",{className:"text-xs text-slate-600",children:(Z=x.find(j=>j.value===(e.delivery_type||"")))==null?void 0:Z.description})]}),!e.delivery_type&&y.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[y.jsx(ou,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),y.jsx("div",{className:"text-sm text-amber-300",children:"Rule will log matches but not deliver until a delivery method is configured."})]}),e.delivery_type==="mesh_broadcast"&&y.jsxs(y.Fragment,{children:[y.jsx(JR,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:j=>a({...e,broadcast_channel:j}),helper:"Select the mesh radio channel",mode:"single"}),y.jsx(W_,{rule:e})]}),e.delivery_type==="mesh_dm"&&y.jsxs(y.Fragment,{children:[y.jsx(KR,{label:"Recipient Nodes",value:e.node_ids||[],onChange:j=>a({...e,node_ids:j}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),y.jsx(W_,{rule:e})]}),e.delivery_type==="email"&&y.jsxs("div",{className:"space-y-4",children:[y.jsx(Cb,{label:"Recipients",value:e.recipients||[],onChange:j=>a({...e,recipients:j}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),y.jsxs("details",{className:"group",children:[y.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[y.jsx(au,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),y.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(Sl,{label:"SMTP Host",value:e.smtp_host||"",onChange:j=>a({...e,smtp_host:j}),placeholder:"smtp.gmail.com"}),y.jsx(Hy,{label:"SMTP Port",value:e.smtp_port??587,onChange:j=>a({...e,smtp_port:j}),min:1,max:65535})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(Sl,{label:"Username",value:e.smtp_user||"",onChange:j=>a({...e,smtp_user:j})}),y.jsx(Sl,{label:"Password",value:e.smtp_password||"",onChange:j=>a({...e,smtp_password:j}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),y.jsx(Jc,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:j=>a({...e,smtp_tls:j})}),y.jsx(Sl,{label:"From Address",value:e.from_address||"",onChange:j=>a({...e,from_address:j}),placeholder:"alerts@yourdomain.com"})]})]}),y.jsx(W_,{rule:e})]}),e.delivery_type==="webhook"&&y.jsxs(y.Fragment,{children:[y.jsx(Sl,{label:"Webhook URL",value:e.webhook_url||"",onChange:j=>a({...e,webhook_url:j}),placeholder:"https://discord.com/api/webhooks/...",helper:"POST alert as JSON",info:"Works with Discord webhooks, ntfy.sh, Slack, Home Assistant, Pushover, or any HTTP POST endpoint."}),y.jsx(W_,{rule:e})]})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(Hy,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:j=>a({...e,cooldown_minutes:j}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."}),i&&y.jsx("div",{className:"flex items-end pb-1",children:y.jsx(Jc,{label:"Override Quiet Hours",checked:e.override_quiet??!1,onChange:j=>a({...e,override_quiet:j}),helper:"Deliver during quiet hours"})})]}),d&&y.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[y.jsxs("span",{children:["Last fired: ",G_(d.last_fired)]}),y.jsxs("span",{children:["Last tested: ",G_(d.last_test)]}),y.jsxs("span",{children:["Total fires: ",d.fire_count]})]}),e.trigger_type!=="schedule"&&y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),y.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 rounded-lg border border-[#1e2a3a]",children:y.jsx("p",{className:"text-sm text-slate-300 font-mono",children:k()})}),y.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}const Ab=[{key:"mesh_health",label:"Mesh Health",Icon:yv},{key:"weather",label:"Weather",Icon:su},{key:"fire",label:"Fire",Icon:LS},{key:"rf_propagation",label:"RF Propagation",Icon:Ya},{key:"roads",label:"Roads",Icon:PS},{key:"avalanche",label:"Avalanche",Icon:xce},{key:"seismic",label:"Seismic",Icon:ES},{key:"tracking",label:"Tracking",Icon:xv}];function het({categories:e,selected:t,onToggle:r,onSelectMany:n}){const i=new Set(Ab.map(h=>h.key)),a=new Map;Ab.forEach(h=>a.set(h.key,[]));const o=[];for(const h of e){const d=h.toggle;d&&i.has(d)?a.get(d).push(h):o.push(h)}const s=new Set;for(const[h,d]of a)d.some(v=>t.includes(v.id))&&s.add(h);o.some(h=>t.includes(h.id))&&s.add("other");const[l,u]=W.useState(s),c=h=>{u(d=>{const v=new Set(d);return v.has(h)?v.delete(h):v.add(h),v})},f=(h,d,v,g)=>{if(!g.length)return null;const m=l.has(h),x=g.map(b=>b.id),_=x.filter(b=>t.includes(b)).length;return y.jsxs("div",{className:"border border-[#1e2a3a] rounded",children:[y.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-[#0d1420]",children:[y.jsxs("button",{type:"button",onClick:()=>c(h),className:"flex items-center gap-2 text-sm text-slate-200 flex-1 min-w-0",children:[m?y.jsx(yu,{size:14,className:"text-slate-500 flex-shrink-0"}):y.jsx(au,{size:14,className:"text-slate-500 flex-shrink-0"}),v&&y.jsx(v,{size:14,className:"text-slate-400 flex-shrink-0"}),y.jsxs("span",{className:"truncate",children:[d," (",g.length,")"]}),_>0&&y.jsxs("span",{className:"ml-1 text-xs text-accent",children:[_," selected"]})]}),y.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),n(x,"add")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-accent hover:bg-accent/10",title:"Select all in family",children:"All"}),y.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),n(x,"remove")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-red-400 hover:bg-red-500/10",title:"Clear family",children:"Clear"})]})]}),m&&y.jsx("div",{className:"p-1 space-y-1",children:g.map(b=>y.jsxs("label",{onClick:()=>r(b.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[y.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${t.includes(b.id)?"bg-accent border-accent":"border-slate-600"}`,children:t.includes(b.id)&&y.jsx(Bo,{size:12,className:"text-white"})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"text-sm text-slate-200",children:b.name}),y.jsx("div",{className:"text-xs text-slate-500",children:b.description})]})]},b.id))})]},h)};return y.jsxs("div",{className:"max-h-96 overflow-y-auto border border-[#1e2a3a] rounded-lg p-2 space-y-2",children:[Ab.map(h=>f(h.key,h.label,h.Icon,a.get(h.key)||[])),f("other","Other",null,o)]})}const t7=["digest","mesh_broadcast","mesh_dm","email","webhook"],det=["routine","priority","immediate"];function vet({toggles:e,onChange:t}){const[r,n]=W.useState(null),i=(a,o)=>t({...e,[a]:{...e[a]||{},name:a,...o}});return y.jsxs("div",{className:"space-y-3 mb-8",children:[y.jsxs("div",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Master Toggles",y.jsx(ia,{info:"Per-family notification policy: enable a family, set its severity threshold, choose which channels fire at each severity, and scope to regions (PagerDuty/Grafana-style)."})]}),y.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Ab.map(({key:a,label:o,Icon:s})=>{const l=e[a]||{},u=r===a,c=Object.values(l.severity_channels||{}).reduce((h,d)=>h+((d==null?void 0:d.length)||0),0),f=(l.regions||[]).length;return y.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("button",{type:"button",onClick:()=>n(u?null:a),className:"flex items-center gap-2 text-sm text-slate-200",children:[y.jsx(s,{size:15})," ",o,u?y.jsx(yu,{size:14}):y.jsx(au,{size:14})]}),y.jsx(Jc,{label:"",checked:!!l.enabled,onChange:h=>i(a,{enabled:h})})]}),!u&&y.jsx("div",{className:"text-xs text-slate-600 mt-1",children:l.enabled?`${f||"all"} region${f===1?"":"s"}, ${c} channel${c===1?"":"s"} at ${l.min_severity||"priority"}+`:"OFF"}),u&&y.jsxs("div",{className:`mt-3 space-y-3 ${l.enabled?"":"opacity-40 pointer-events-none select-none"}`,children:[y.jsx(nae,{value:l.min_severity||"priority",onChange:h=>i(a,{min_severity:h})}),y.jsx("div",{className:"text-xs text-slate-500",children:"Severity → channels"}),y.jsxs("table",{className:"text-xs w-full",children:[y.jsx("thead",{children:y.jsxs("tr",{children:[y.jsx("th",{}),t7.map(h=>y.jsx("th",{className:"text-slate-500 font-normal px-1",children:h.replace("_"," ")},h))]})}),y.jsx("tbody",{children:det.map(h=>y.jsxs("tr",{children:[y.jsx("td",{className:"text-slate-400 pr-2",children:h}),t7.map(d=>{var g;const v=(((g=l.severity_channels)==null?void 0:g[h])||[]).includes(d);return y.jsx("td",{className:"text-center",children:y.jsx("input",{type:"checkbox",checked:v,onChange:m=>{const x={...l.severity_channels||{}},_=new Set(x[h]||[]);m.target.checked?_.add(d):_.delete(d),x[h]=Array.from(_),i(a,{severity_channels:x})}})},d)})]},h))})]}),y.jsx(Cb,{label:"Regions (empty = all)",value:l.regions||[],onChange:h=>i(a,{regions:h}),placeholder:"Add region..."}),y.jsx(Jc,{label:"Quiet-hours override (immediate only)",checked:!!l.quiet_hours_override,onChange:h=>i(a,{quiet_hours_override:h})}),y.jsx("div",{className:"text-xs text-slate-500 pt-1",children:"Channel config"}),y.jsx(Hy,{label:"Broadcast channel",value:l.broadcast_channel??0,onChange:h=>i(a,{broadcast_channel:h})}),y.jsx(Cb,{label:"DM node IDs",value:l.node_ids||[],onChange:h=>i(a,{node_ids:h}),placeholder:"!nodeid"}),y.jsx(Cb,{label:"Email recipients",value:l.recipients||[],onChange:h=>i(a,{recipients:h}),placeholder:"ops@example.com"}),y.jsx(Sl,{label:"SMTP host",value:l.smtp_host||"",onChange:h=>i(a,{smtp_host:h}),placeholder:"smtp.example.com"}),y.jsx(Hy,{label:"SMTP port",value:l.smtp_port??587,onChange:h=>i(a,{smtp_port:h})}),y.jsx(Sl,{label:"Webhook URL",value:l.webhook_url||"",onChange:h=>i(a,{webhook_url:h}),placeholder:"https://..."})]})]},a)})})]})}function pet(){var j,U,G;const[e,t]=W.useState(null),[r,n]=W.useState(null),[i,a]=W.useState([]),[o,s]=W.useState([]),[l,u]=W.useState(!0),[c,f]=W.useState(!1),[h,d]=W.useState(null),[v,g]=W.useState(null),[m,x]=W.useState(null),[_,b]=W.useState({open:!1,ruleIndex:-1,loading:!1,action:""}),[S,T]=W.useState(!1),[C,A]=W.useState(!1),P=W.useCallback(async()=>{try{const[V,Y,K]=await Promise.all([fetch("/api/config/notifications"),fetch("/api/notifications/categories"),fetch("/api/regions")]);if(!V.ok)throw new Error("Failed to fetch notifications config");const ee=await V.json(),le=await Y.json(),he=K.ok?await K.json():[];t(ee),n(JSON.parse(JSON.stringify(ee))),a(le),s(Array.isArray(he)?he:[]),A(!1),d(null)}catch(V){d(V instanceof Error?V.message:"Unknown error")}finally{u(!1)}},[]);W.useEffect(()=>{document.title="Notifications - MeshAI",P()},[P]),W.useEffect(()=>{e&&r&&A(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const I=async()=>{if(e){f(!0),d(null),g(null);try{const V=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Y=await V.json();if(!V.ok)throw new Error(Y.detail||"Save failed");g("Notifications config saved successfully"),n(JSON.parse(JSON.stringify(e))),A(!1),setTimeout(()=>g(null),3e3)}catch(V){d(V instanceof Error?V.message:"Save failed")}finally{f(!1)}}},k=()=>{r&&(t(JSON.parse(JSON.stringify(r))),A(!1))},E=()=>({name:"",enabled:!0,trigger_type:"condition",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"19:00",schedule_days:["monday"],message_type:"mesh_health_summary",custom_message:"",delivery_type:"",broadcast_channel:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{},cooldown_minutes:10,override_quiet:!1,region_scope:[]}),D=()=>{e&&t({...e,rules:[...e.rules||[],E()]})},N=V=>{if(!e)return;const Y=e7.find(K=>K.id===V);Y&&(t({...e,rules:[...e.rules||[],{...E(),...Y.rule}]}),T(!1))},z=V=>{if(!e)return;const Y=e.rules[V],K={...JSON.parse(JSON.stringify(Y)),name:`${Y.name} (copy)`},ee=[...e.rules];ee.splice(V+1,0,K),t({...e,rules:ee})},F=async V=>{b({open:!0,ruleIndex:V,loading:!0,action:""});try{const K=await(await fetch(`/api/notifications/rules/${V}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview"})})).json();x(K),b(ee=>({...ee,loading:!1}))}catch{x({success:!1,message:"Failed to get preview"}),b(Y=>({...Y,loading:!1}))}},$=async V=>{const Y=_.ruleIndex;b(K=>({...K,loading:!0,action:V}));try{const ee=await(await fetch(`/api/notifications/rules/${Y}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:V})})).json();x(ee),b(le=>({...le,loading:!1}))}catch{x({success:!1,message:`Failed to ${V}`}),b(K=>({...K,loading:!1}))}},Z=()=>{b({open:!1,ruleIndex:-1,loading:!1,action:""}),x(null)};return l?y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?y.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[_.open&&y.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:y.jsxs("div",{className:"bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[85vh] overflow-auto",children:[y.jsxs("div",{className:"p-4 border-b border-[#2a3a4a] flex items-center justify-between sticky top-0 bg-[#1a2332]",children:[y.jsx("h3",{className:"text-lg font-semibold",children:"Test Notification Rule"}),y.jsx("button",{onClick:Z,className:"text-slate-500 hover:text-slate-300",children:y.jsx(zo,{size:20})})]}),y.jsx("div",{className:"p-4 space-y-4",children:_.loading?y.jsxs("div",{className:"flex items-center justify-center py-8",children:[y.jsx(km,{size:20,className:"animate-spin text-slate-400 mr-2"}),y.jsx("div",{className:"text-slate-400",children:_.action?`${_.action.replace("_"," ").replace("send ","Sending ")}...`:"Loading current data..."})]}):m?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Current Data"}),m.live_data_summary&&m.live_data_summary.length>0?y.jsx("div",{className:"p-3 bg-slate-800/50 rounded space-y-1",children:m.live_data_summary.map((V,Y)=>y.jsx("div",{className:`text-sm font-mono ${V.startsWith("[!]")?"text-amber-400":""}`,children:V},Y))}):y.jsx("div",{className:"p-3 bg-slate-800/50 rounded text-sm text-slate-500",children:"No live data available for this rule's categories"})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Rule Matching"}),y.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[m.conditions_matched&&m.conditions_matched>0?y.jsxs("span",{className:"px-2 py-1 bg-green-500/20 text-green-400 rounded text-sm",children:[m.conditions_matched," condition",m.conditions_matched!==1?"s":""," match - this rule WOULD fire"]}):y.jsx("span",{className:"px-2 py-1 bg-slate-700 text-slate-400 rounded text-sm",children:"No conditions trigger this rule right now"}),m.conditions_below_threshold&&m.conditions_below_threshold>0&&y.jsxs("span",{className:"px-2 py-1 bg-yellow-500/20 text-yellow-400 rounded text-sm",children:[m.conditions_below_threshold," below threshold"]})]}),m.conditions_below_threshold&&m.conditions_below_threshold>0&&y.jsxs("div",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm space-y-2",children:[y.jsx("div",{className:"text-yellow-300",children:m.below_threshold_summary}),m.below_threshold_events&&m.below_threshold_events.length>0&&y.jsx("div",{className:"space-y-1 text-yellow-200/80",children:m.below_threshold_events.slice(0,3).map((V,Y)=>y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-500/20 rounded",children:V.severity}),y.jsx("span",{children:V.headline})]},Y))}),m.suggestion&&y.jsxs("div",{className:"text-yellow-400 text-xs mt-2",children:["Tip: ",m.suggestion]})]})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:m.is_example?"Example Messages":"Messages That Would Fire"}),(j=m.preview_messages)==null?void 0:j.map((V,Y)=>y.jsx("div",{className:"p-3 bg-slate-800 rounded text-sm font-mono break-words",children:V},Y))]}),m.delivered!==void 0&&m.delivery_result&&y.jsx("div",{className:`p-3 rounded text-sm ${m.delivered?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:y.jsxs("div",{className:"flex items-start gap-2",children:[m.delivered?y.jsx(Bo,{size:16,className:"mt-0.5"}):y.jsx(zo,{size:16,className:"mt-0.5"}),y.jsxs("div",{children:[y.jsx("div",{children:m.delivery_result}),m.delivery_error&&y.jsx("div",{className:"mt-1 text-red-300",children:m.delivery_error})]})]})}),m.message&&!m.preview_messages&&y.jsx("div",{className:`p-3 rounded text-sm ${m.success?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:m.message})]}):null}),y.jsxs("div",{className:"p-4 border-t border-[#2a3a4a] flex justify-between sticky bottom-0 bg-[#1a2332]",children:[y.jsx("button",{onClick:Z,className:"px-4 py-2 text-slate-400 hover:text-slate-200",children:"Close"}),m&&!m.delivered&&y.jsx("div",{className:"flex gap-2",children:m.delivery_method?y.jsxs(y.Fragment,{children:[m.live_data_summary&&m.live_data_summary.length>0&&y.jsx("button",{onClick:()=>$("send_status"),disabled:_.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send current conditions summary",children:"Send Current Conditions"}),y.jsx("button",{onClick:()=>$("send_test"),disabled:_.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send example alert message",children:"Send Example Alert"}),m.can_send_live&&y.jsx("button",{onClick:()=>$("send_live"),disabled:_.loading,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm disabled:opacity-50",title:"Send actual live alert",children:"Send Live Alert"})]}):y.jsx("span",{className:"px-3 py-2 text-amber-400 text-sm",children:"Configure a delivery method to send test messages"})})]})]})}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("div",{children:y.jsx("p",{className:"text-sm text-slate-500",children:"Alert delivery and scheduled reports. Rules define what triggers a notification and where it gets sent."})}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{onClick:P,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:y.jsx(km,{size:18})}),y.jsxs("button",{onClick:k,disabled:!C,className:"flex items-center gap-2 px-3 py-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[y.jsx(DS,{size:16}),"Discard"]}),y.jsxs("button",{onClick:I,disabled:c||!C,className:"flex items-center gap-2 px-4 py-2 bg-accent hover:bg-accent/80 disabled:bg-slate-700 disabled:cursor-not-allowed rounded text-white transition-colors",children:[y.jsx(oD,{size:16}),c?"Saving...":"Save"]})]})]}),h&&y.jsx("div",{className:"p-3 rounded-lg text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:h}),v&&y.jsxs("div",{className:"p-3 rounded-lg text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[y.jsx(Bo,{size:14,className:"inline mr-2"}),v]}),y.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6 space-y-6",children:[y.jsx(Jc,{label:"Enable Notifications",checked:e.enabled,onChange:V=>t({...e,enabled:V}),helper:"Master switch for all notification delivery",info:"When disabled, no alerts or scheduled messages will be delivered. Alerts still get recorded to history."}),e.enabled&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(mce,{size:14,className:"text-slate-400"}),y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Quiet Hours"})]}),y.jsx(Jc,{label:"Enable Quiet Hours",checked:e.quiet_hours_enabled??!0,onChange:V=>t({...e,quiet_hours_enabled:V}),helper:"Suppress non-emergency alerts during sleeping hours",info:"When enabled, ROUTINE alerts are suppressed during quiet hours. PRIORITY and IMMEDIATE always deliver."}),e.quiet_hours_enabled&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[y.jsx(Sc,{label:"Start Time",value:e.quiet_hours_start||"22:00",onChange:V=>t({...e,quiet_hours_start:V}),helper:"When quiet hours begin"}),y.jsx(Sc,{label:"End Time",value:e.quiet_hours_end||"06:00",onChange:V=>t({...e,quiet_hours_end:V}),helper:"When quiet hours end"})]}),y.jsx("p",{className:"text-xs text-slate-600",children:'Emergency alerts and rules with "Override Quiet Hours" enabled always deliver.'})]})]}),y.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[y.jsx("div",{className:"flex items-center gap-2",children:y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cold-start grace"})}),y.jsx(Hy,{label:"Grace period (seconds)",value:e.cold_start_grace_seconds??60,onChange:V=>t({...e,cold_start_grace_seconds:V}),min:0,max:600,helper:"Suppress broadcasts for this many seconds after the first event arrives",info:"When meshai starts seeing events for the first time, suppress mesh broadcasts for this many seconds to absorb any JetStream backlog. Persistence rows still get written; only broadcasts are suppressed."})]}),y.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[y.jsx("div",{className:"flex items-center gap-2",children:y.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Band Conditions (HF propagation)"})}),y.jsx(Jc,{label:"Enable scheduled band-conditions broadcasts",checked:e.band_conditions_enabled??!0,onChange:V=>t({...e,band_conditions_enabled:V}),helper:"3x/day HF propagation summary (Day/Night ratings per band group)",info:"Source priority: (1) recent SWPC readings persisted locally; (2) HamQSL.com fallback; (3) silent skip if both fail. Persistence rows are written either way for an audit trail."}),(e.band_conditions_enabled??!0)&&y.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[y.jsx(Sc,{label:"Slot 1",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[0]||"06:00",onChange:V=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[0]=V,t({...e,band_conditions_schedule:Y})},helper:"Morning (default 06:00 MT)"}),y.jsx(Sc,{label:"Slot 2",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[1]||"14:00",onChange:V=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[1]=V,t({...e,band_conditions_schedule:Y})},helper:"Afternoon (default 14:00 MT)"}),y.jsx(Sc,{label:"Slot 3",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[2]||"22:00",onChange:V=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[2]=V,t({...e,band_conditions_schedule:Y})},helper:"Night (default 22:00 MT)"})]}),y.jsx("p",{className:"text-xs text-slate-600",children:"All times are Mountain Time (America/Boise). DST handled automatically."})]}),e.toggles&&y.jsx(vet,{toggles:e.toggles,onChange:V=>t({...e,toggles:V})}),y.jsxs("div",{className:"space-y-3",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",y.jsx(ia,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),y.jsxs("span",{className:"text-xs text-slate-500",children:[((U=e.rules)==null?void 0:U.length)||0," rule",(((G=e.rules)==null?void 0:G.length)||0)!==1?"s":""]})]}),(e.rules||[]).map((V,Y)=>y.jsx(fet,{rule:V,ruleIndex:Y,categories:i,regions:o,quietHoursEnabled:e.quiet_hours_enabled??!0,onChange:K=>{const ee=[...e.rules||[]];ee[Y]=K,t({...e,rules:ee})},onDelete:()=>{confirm(`Delete rule "${V.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((K,ee)=>ee!==Y)})},onDuplicate:()=>z(Y),onTest:()=>F(Y)},Y)),y.jsxs("div",{className:"flex gap-2",children:[y.jsxs("button",{onClick:D,className:"flex-1 py-3 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[y.jsx(_v,{size:16})," Add Rule"]}),y.jsxs("div",{className:"relative",children:[y.jsxs("button",{onClick:()=>T(!S),className:"py-3 px-4 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center gap-2 transition-colors",children:[y.jsx(NZ,{size:16})," Add from Template"]}),S&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(!1)}),y.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 w-80 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl overflow-hidden",children:[y.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),e7.map(V=>y.jsxs("button",{onClick:()=>N(V.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[y.jsx("div",{className:"font-medium text-slate-200",children:V.name}),y.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:V.description})]},V.id))]})]})]})]})]})]})]})]}):y.jsx("div",{className:"flex items-center justify-center h-64",children:y.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const r7=[{id:"stream-gauges",label:"Stream Gauges",icon:kS},{id:"wildfire",label:"Wildfire",icon:LS},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:NS},{id:"weather-alerts",label:"Weather Alerts",icon:cce},{id:"solar",label:"Solar & Geomagnetic",icon:$Z},{id:"ducting",label:"Tropospheric Ducting",icon:Ya},{id:"avalanche",label:"Avalanche Danger",icon:ES},{id:"traffic",label:"Traffic Flow",icon:PS},{id:"roads-511",label:"Road Conditions (511)",icon:OZ},{id:"mesh-health",label:"Mesh Health",icon:yv},{id:"notifications",label:"Notifications",icon:Pm},{id:"commands",label:"Commands",icon:FZ},{id:"api",label:"API Reference",icon:fce}];function ir({color:e}){const t={green:"bg-green-500",yellow:"bg-yellow-500",orange:"bg-orange-500",red:"bg-red-500",black:"bg-slate-800 border border-slate-600"};return y.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function jt({headers:e,rows:t}){return y.jsx("div",{className:"overflow-x-auto my-4",children:y.jsxs("table",{className:"w-full text-sm",children:[y.jsx("thead",{children:y.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>y.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),y.jsx("tbody",{children:t.map((r,n)=>y.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>y.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function Rt({href:e,children:t}){return y.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",y.jsx(Cd,{size:12})]})}function Te({children:e}){return y.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function vl({children:e}){return y.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function $e({children:e}){return y.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function vi({id:e,title:t,children:r}){return y.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[y.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),y.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function get(){const e=mv(),[t,r]=W.useState(""),[n,i]=W.useState("stream-gauges"),a=W.useRef(null);W.useEffect(()=>{const l=e.hash.replace("#","");if(l&&r7.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=r7.filter(l=>l.label.toLowerCase().includes(t.toLowerCase())),s=l=>{i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"}),window.history.replaceState(null,"",`#${l}`)};return y.jsxs("div",{className:"flex h-full -m-6",children:[y.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[y.jsx("div",{className:"p-4 border-b border-border",children:y.jsxs("div",{className:"relative",children:[y.jsx(sD,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),y.jsx("input",{type:"text",value:t,onChange:l=>r(l.target.value),placeholder:"Search topics...",className:"w-full pl-9 pr-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent placeholder-slate-600"})]})}),y.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return y.jsxs("button",{onClick:()=>s(l.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm text-left transition-colors ${c?"text-accent bg-accent/10 border-l-2 border-accent":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover border-l-2 border-transparent"}`,children:[y.jsx(u,{size:16}),l.label]},l.id)})})]}),y.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:y.jsxs("div",{className:"max-w-4xl",children:[y.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),y.jsxs(vi,{id:"stream-gauges",title:"Stream Gauges",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),y.jsxs("p",{children:[y.jsx("strong",{children:"Water Level (Gage Height)"}),` — how high the water is, measured in feet. Important: this is NOT the depth of the river. It's the height above a fixed measuring point that's different at every gauge. A reading of "10 feet" at one gauge means something completely different than "10 feet" at another. You can only compare readings from the SAME gauge over time.`]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Flow (Discharge)"}),` — how much water is moving past the gauge, in cubic feet per second (CFS). Think of it as the river's "throughput." For scale:`]}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsx("li",{children:"A small creek: 50-200 CFS"}),y.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),y.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),y.jsx(Te,{children:"When Does It Flood?"}),y.jsxs("p",{children:["Flood levels are set by the ",y.jsx("strong",{children:"National Weather Service"}),', not USGS. NWS looks at each specific gauge location and decides "at what water level does the road flood? At what level do buildings get water?" Those levels are different everywhere.']}),y.jsxs("p",{children:[y.jsx("strong",{children:"Action Stage"})," — water is rising, time to start paying attention. Usually still inside the riverbanks."]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Minor Flood"})," — low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Moderate Flood"})," — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Major Flood"})," — widespread flooding. Many people evacuating. Serious property damage."]}),y.jsx("p",{children:"MeshAI automatically looks up the flood levels for your gauge from NWS when you add a site. Some remote gauges don't have flood levels assigned — for those, you set them manually if you know what water levels cause problems in your area."}),y.jsx(Te,{children:"Low Water / Drought"}),y.jsx("p",{children:`There's no official "drought stage" for most gauges. If you need to monitor low water (irrigation, fish habitat), set a manual low-water threshold based on what you know about your local river.`}),y.jsx(Te,{children:"Setting It Up"}),y.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:["Find your gauge at ",y.jsx(Rt,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),y.jsxs("li",{children:["Copy the site number (like ",y.jsx($e,{children:"13090500"}),")"]}),y.jsx("li",{children:"Add it in Config → Environmental → USGS"}),y.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),y.jsx("p",{children:"If NWS flood levels don't populate, your gauge may not have them. Set manual thresholds if you know your local conditions."}),y.jsx(Te,{children:"Learn More"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx(Rt,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," — find gauges near you"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," — flood forecasts and thresholds"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," — USGS explainer"]})]})]}),y.jsxs(vi,{id:"wildfire",title:"Wildfire",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:"MeshAI tracks active wildfire perimeters from the National Interagency Fire Center (NIFC). For each fire, you see the name, size, how much is contained, and how far it is from your mesh nodes."}),y.jsx(Te,{children:"Fire Size — How Big Is It?"}),y.jsx(jt,{headers:["Size","What That Means"],rows:[["10 acres","Small fire. Usually handled quickly by initial crews."],["100 acres","Notable fire. Active firefighting effort."],["1,000 acres","Large fire. Major resources being deployed."],["10,000+ acres","Very large fire. Multiple teams, aircraft, heavy equipment."],["100,000+ acres","Mega-fire. These make the national news."]]}),y.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),y.jsx(Te,{children:"Containment — Is It Under Control?"}),y.jsx("p",{children:"Containment means the percentage of the fire's edge where firefighters have built a control line (a cleared strip to stop the fire from spreading further). It does NOT mean the fire is out inside that line."}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx("strong",{children:"0-30%"})," — Essentially uncontrolled. The fire goes where it wants."]}),y.jsxs("li",{children:[y.jsx("strong",{children:"50%"})," — Good progress, but half the edge can still grow."]}),y.jsxs("li",{children:[y.jsx("strong",{children:"80%+"})," — Well controlled. Major growth unlikely."]}),y.jsxs("li",{children:[y.jsx("strong",{children:"100%"}),' — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),y.jsx(Te,{children:"How Far Away Should I Worry?"}),y.jsx(jt,{headers:["Distance","What To Do"],rows:[[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"red"})," Under 5 km (3 miles)"]}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"orange"})," 5-15 km (3-10 miles)"]}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"yellow"})," 15-30 km (10-20 miles)"]}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"green"})," Over 30 km (20 miles)"]}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),y.jsx("p",{children:"How fast can a fire travel? In grass with wind: up to 14 mph. In heavy timber: 1-6 mph. A fire 10 miles away could theoretically reach you in 1-2 hours under worst-case conditions, but typical spread is much slower."}),y.jsx(Te,{children:"Which Matters More — Size or Distance?"}),y.jsxs("p",{children:[y.jsx("strong",{children:"Distance is the immediate concern."})," A small uncontained fire 10 km away is more dangerous right now than a huge fire 50 km away. But big fires have more energy and can grow fast under wind shifts — keep watching them."]}),y.jsx(Te,{children:"Setting It Up"}),y.jsxs("p",{children:["Just configure your state code (like ",y.jsx($e,{children:"US-ID"})," for Idaho) in Config → Environmental → Fires. MeshAI polls NIFC every 10 minutes for active fires in that state and computes the distance to your mesh nodes automatically."]}),y.jsx(Te,{children:"Learn More"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx(Rt,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," — detailed incident information"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," — raw perimeter data"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," — preparedness guide"]})]})]}),y.jsxs(vi,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:`NASA's VIIRS satellites orbit the Earth and look for heat signatures on the ground. When they see something hot — a fire, a factory, a sunlit building — they flag it as a "hotspot." MeshAI checks these detections for your area.`}),y.jsxs("p",{children:[y.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",y.jsx("strong",{children:"hours before"})," official fire perimeters are mapped. If a new fire starts near your mesh, the satellite might see it before anyone on the ground reports it."]}),y.jsx(Te,{children:"Confidence — Is It Really a Fire?"}),y.jsx("p",{children:"Each detection gets a confidence rating:"}),y.jsx(jt,{headers:["Confidence","What It Means"],rows:[["High","Almost certainly a real fire. Strong heat signature."],["Nominal","Probably a real fire. Most actual fires get this rating."],["Low","Maybe a fire, maybe not. Could be a hot roof, sun reflecting off water, a factory, or a gas flare. Lots of false alarms."]]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Recommendation"}),`: Set the filter to "Nominal + High." If you include "Low" you'll get alerts for every hot parking lot on a summer day.`]}),y.jsx(Te,{children:"FRP — How Intense Is It?"}),y.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),y.jsx(jt,{headers:["FRP","What It Probably Is"],rows:[["Under 5 MW","Hot surface, small agricultural burn, gas flare, or warm ground"],["5-50 MW","An actual fire — brush fire, grass fire, typical wildfire"],["50-300 MW","Intense fire — trees fully burning, active fire front"],["Over 300 MW","Extreme fire — major wildfire in full force"]]}),y.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),y.jsx(Te,{children:"New Ignition Detection"}),y.jsxs("p",{children:["MeshAI cross-references satellite hotspots against known NIFC fire perimeters. If a hotspot is NOT near any known fire, it gets flagged as a ",y.jsx("strong",{children:"potential new ignition"})," — maybe a new fire just started. These get elevated priority regardless of confidence level."]}),y.jsx(Te,{children:"Timing"}),y.jsxs("p",{children:["Satellite data arrives ",y.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",y.jsx("strong",{children:"6 times per day"}),` across all satellites, so there are multi-hour gaps. This is not real-time — it's "pretty recent."`]}),y.jsx(Te,{children:"Getting an API Key"}),y.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:["Go to ",y.jsx(Rt,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),y.jsx("li",{children:'Click "Get MAP_KEY"'}),y.jsx("li",{children:"Register for a free Earthdata account"}),y.jsx("li",{children:"Your key arrives by email"}),y.jsx("li",{children:"Enter it in Config → Environmental → FIRMS"})]}),y.jsx(Te,{children:"Learn More"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx(Rt,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," — see hotspots on a map"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," — how it works"]})]})]}),y.jsxs(vi,{id:"weather-alerts",title:"Weather Alerts",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories."}),y.jsx(Te,{children:"Alert Severity — How Serious Is It?"}),y.jsx(jt,{headers:["Severity","What It Means","Example"],rows:[["Extreme","Life-threatening. The most serious events.","Tornado Emergency, Hurricane Warning, Tsunami Warning"],["Severe","Dangerous. Take protective action.","Tornado Warning, Flash Flood Warning, Blizzard Warning, Red Flag Warning"],["Moderate","Be prepared. Could become dangerous.","Winter Weather Advisory, Wind Advisory, Flood Watch, Heat Advisory"],["Minor","Good to know. Probably won't hurt anyone.","Special Weather Statement, Air Quality Alert"]]}),y.jsx(Te,{children:"When Should I Act? (Urgency)"}),y.jsx(jt,{headers:["Urgency","What It Means"],rows:[["Immediate","Do something NOW"],["Expected","Do something within the hour"],["Future","Coming in the next several hours"],["Past","It's over — NWS is clearing the alert"]]}),y.jsx(Te,{children:"How Sure Are They? (Certainty)"}),y.jsx(jt,{headers:["Certainty","What It Means"],rows:[["Observed","It's happening right now. Verified."],["Likely","More than 50% chance"],["Possible","Could happen, but less than 50%"],["Unlikely","Probably won't, but mentioned for awareness"]]}),y.jsx(Te,{children:"These Are Separate Scales"}),y.jsx("p",{children:'A single alert has all three. A hurricane warning for next week is "Severe + Future + Likely." A tornado spotted on the ground is "Extreme + Immediate + Observed." An air quality advisory is "Minor + Expected + Possible."'}),y.jsx(Te,{children:"What Minimum Severity Should I Set?"}),y.jsx(jt,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything — high volume","Nothing"],[y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Moderate"})," ✓"]}),"Watches, Advisories, and Warnings","Special Weather Statements"],["Severe","Only Warnings — things happening NOW","Watches (which give you hours of advance warning)"],["Extreme","Only the rarest events","Most Tornado and Severe Thunderstorm Warnings"]]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Moderate is recommended."})," It catches Watches (advance warning that conditions may worsen) and Advisories (conditions exist but aren't severe) while filtering out the informational stuff."]}),y.jsx(Te,{children:"Finding Your NWS Zone"}),y.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:["Go to ",y.jsx(Rt,{href:"https://www.weather.gov",children:"weather.gov"})]}),y.jsx("li",{children:"Enter your location"}),y.jsxs("li",{children:["Find your zone code at ",y.jsx(Rt,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),y.jsxs("li",{children:["Zone codes look like: ",y.jsx($e,{children:"IDZ016"}),", ",y.jsx($e,{children:"UTZ040"}),", etc."]})]}),y.jsx(Te,{children:"The User-Agent Field"}),y.jsx("p",{children:"NWS wants to know who's using their API — not for approval, just so they can contact you if something breaks. You make it up:"}),y.jsx("p",{children:y.jsx($e,{children:"(meshai, you@email.com)"})}),y.jsx("p",{children:"No registration. No waiting. Just type it in."}),y.jsx(Te,{children:"Learn More"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx(Rt,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," — see current alerts"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," — technical details"]})]})]}),y.jsxs(vi,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:"MeshAI tracks space weather — solar activity and its effects on Earth's magnetic field. This matters for radio operators because the sun directly controls how well HF radio works, and major solar events can affect all radio communications."}),y.jsx(Te,{children:"Solar Flux Index (SFI)"}),y.jsx("p",{children:'Think of SFI as a "how active is the sun" number. Higher = better for HF radio, but also higher risk of solar flares.'}),y.jsx(jt,{headers:["SFI","What It Means for You"],rows:[["Below 70","Quiet sun. Higher HF bands (10m, 15m) are probably dead. Stick to lower bands."],["70-90","Getting better. Some openings on 15m and above, but inconsistent."],["90-120","Good. Most HF bands work. Reliable contacts on 20m and 15m."],["120-170","Great. All HF bands open. 10m works for worldwide contacts."],["Above 170","Excellent. Best HF conditions — but watch for flares."]]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),y.jsx(Te,{children:"Kp Index"}),y.jsx("p",{children:"Kp measures how disturbed Earth's magnetic field is, on a 0-9 scale. Higher = more disturbance = worse for HF radio but better for aurora viewing."}),y.jsx(jt,{headers:["Kp","What It Means for You"],rows:[["0-2","Quiet. Best HF conditions."],["3","Slightly unsettled. You probably won't notice."],["4","Active. Some noise and fading on HF, especially if you're at higher latitudes."],[y.jsx("strong",{children:"5"}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60°N)."]})],[y.jsx("strong",{children:"6"}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55°N)."]})],[y.jsx("strong",{children:"7"}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[y.jsx("strong",{children:"8-9"}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),y.jsx(Te,{children:"R / S / G Scales"}),y.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),y.jsx(vl,{children:"R (Radio Blackouts) — from solar flares:"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),y.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),y.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),y.jsx(vl,{children:"S (Solar Radiation Storms) — from energetic particles:"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsx("li",{children:"Mostly affects polar regions and satellites"}),y.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),y.jsx(vl,{children:"G (Geomagnetic Storms) — from solar wind disturbances:"}),y.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:y.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),y.jsx(Te,{children:"Bz — The Storm Predictor"}),y.jsx("p",{children:"Bz measures the direction of the solar wind's magnetic field. When it points south (negative values), the solar wind can dump energy into Earth's magnetic field, causing storms."}),y.jsx(jt,{headers:["Bz","What It Means"],rows:[["Positive","All good. Solar wind bouncing off."],["0 to -5","Slight coupling. Nothing dramatic."],["-5 to -10","Things starting to pick up. Storm possible."],["Below -10","Storm likely. Kp will start climbing."],["Below -20","Severe storm probable."]]}),y.jsx("p",{children:"Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips."}),y.jsx(Te,{children:"Learn More"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx(Rt,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," — live data"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," — what R/S/G mean"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," — ham-friendly display"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," — live Kp"]})]})]}),y.jsxs(vi,{id:"ducting",title:"Tropospheric Ducting",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:'Sometimes the atmosphere creates an invisible "pipe" that traps radio signals and carries them much farther than normal. This is called tropospheric ducting. It mostly affects VHF and UHF frequencies.'}),y.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),y.jsx(Te,{children:"How Do I Know If Ducting Is Happening?"}),y.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),y.jsx(jt,{headers:["Condition","What It Means"],rows:[["Normal","Standard propagation. Nothing unusual."],["Super-refraction","Slightly enhanced range. You might hear a few more distant stations than usual."],["Surface Duct","Radio signals trapped near the ground. You may hear stations hundreds of km away that you've never heard before."],["Elevated Duct",'Same effect but the "pipe" is up in the atmosphere. Affects signals passing through that altitude.']]}),y.jsx(Te,{children:"What You'll Actually Notice"}),y.jsx("p",{children:"When ducting happens on your mesh:"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),y.jsx("li",{children:"Nodes appear from far outside your normal range"}),y.jsx("li",{children:"You hear FM radio stations from other cities"}),y.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),y.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),y.jsx(Te,{children:"The dM/dz Number"}),y.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:`}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Below -50"})," = strong ducting — classic VHF/UHF DX event"]})]}),y.jsx(Te,{children:"When Does Ducting Happen?"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),y.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),y.jsx("li",{children:"Most common in late summer and early fall"}),y.jsx("li",{children:"Strongest along coastlines and over water"}),y.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),y.jsx(Te,{children:"Setting It Up"}),y.jsx("p",{children:"Just configure the latitude and longitude of the center of your mesh area in Config → Environmental → Ducting. MeshAI checks the atmospheric conditions there every 3 hours using free weather model data. No API key needed."}),y.jsx(Te,{children:"Learn More"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx(Rt,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," — 6-day tropo prediction"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://dxmaps.com",children:"DX Maps"})," — real-time VHF/UHF propagation reports"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," — background"]})]})]}),y.jsxs(vi,{id:"avalanche",title:"Avalanche Danger",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:"MeshAI pulls avalanche forecasts from your regional avalanche center during winter months. The danger scale has 5 levels and it's the same across all of North America."}),y.jsx(Te,{children:"The Danger Scale"}),y.jsx(jt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",y.jsx(ir,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",y.jsx(ir,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",y.jsx(ir,{color:"orange"}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"DANGEROUS."}),` This is where most people die in avalanches — they see "3 out of 5" and think it's fine. It's not. Use extreme caution.`]})],["4","High",y.jsx(ir,{color:"red"}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",y.jsx(ir,{color:"black"}),y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),y.jsx(Te,{children:"The Most Important Thing to Know"}),y.jsxs("p",{children:[y.jsx("strong",{children:"Level 3 (Considerable) kills more people than any other level."}),' People look at "3 out of 5" and think "middle of the road, probably okay." In reality, the risk roughly doubles at each step up the scale. Level 3 is where dangerous conditions overlap with people thinking they can handle it.']}),y.jsx(Te,{children:"Seasonal"}),y.jsx("p",{children:'MeshAI only checks avalanche conditions during winter months (configurable, default December through April). Outside season, it shows "off season" and saves API calls.'}),y.jsx(Te,{children:"Finding Your Avalanche Center"}),y.jsxs("p",{children:["Go to ",y.jsx(Rt,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx($e,{children:"SNFAC"})," — Sawtooth (central Idaho)"]}),y.jsxs("li",{children:[y.jsx($e,{children:"UAC"})," — Utah"]}),y.jsxs("li",{children:[y.jsx($e,{children:"NWAC"})," — Cascades/Olympics (WA/OR)"]}),y.jsxs("li",{children:[y.jsx($e,{children:"CAIC"})," — Colorado"]}),y.jsxs("li",{children:[y.jsx($e,{children:"SAC"})," — Sierra Nevada (CA)"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GNFAC"})," — Gallatin (SW Montana)"]})]}),y.jsx(Te,{children:"Learn More"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx(Rt,{href:"https://avalanche.org",children:"Avalanche.org"})," — US forecasts"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," — full scale explanation"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://kbyg.org",children:"Know Before You Go"})," — avalanche awareness"]})]})]}),y.jsxs(vi,{id:"traffic",title:"Traffic Flow",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),y.jsx(Te,{children:"Speed Ratio — The Key Number"}),y.jsx("p",{children:'MeshAI compares current speed to "free-flow speed" (what traffic normally does when the road is empty). The ratio tells you how congested it is:'}),y.jsx(jt,{headers:["Ratio","What It Means"],rows:[[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Note"}),`: "free-flow speed" is NOT the speed limit. It's what traffic actually does on that road when nobody's in the way. Drivers often exceed speed limits on open highways.`]}),y.jsx(Te,{children:"Confidence — Can You Trust the Data?"}),y.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),y.jsx(jt,{headers:["Confidence","What It Means"],rows:[["Above 0.9","Very reliable — lots of real-time probe data"],["0.7-0.9","Good — mix of real-time and historical"],["Below 0.7",y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Unreliable"})," — mostly guessing from historical patterns. Don't alert on this."]})]]}),y.jsx("p",{children:"Set minimum confidence to 0.7 to avoid false congestion alerts at night or on rural roads where few probe vehicles drive."}),y.jsx(Te,{children:"Setting Up Corridors"}),y.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),y.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[y.jsx("li",{children:"Go to Google Maps, find the road"}),y.jsx("li",{children:`Right-click the road → "What's here?" → copy the coordinates`}),y.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),y.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),y.jsx(Te,{children:"Getting an API Key"}),y.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:["Sign up at ",y.jsx(Rt,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),y.jsx("li",{children:"Create an app → get your API key"}),y.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),y.jsx(Te,{children:"Learn More"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx(Rt,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," — API docs and key signup"]}),y.jsxs("li",{children:[y.jsx(Rt,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," — city congestion rankings"]})]})]}),y.jsxs(vi,{id:"roads-511",title:"Road Conditions (511)",children:[y.jsx(Te,{children:"What You're Looking At"}),y.jsx("p",{children:"511 systems report road closures, construction, weather events, mountain pass conditions, and incidents. Every state runs their own 511 system — there is no national API."}),y.jsx(Te,{children:"Setting It Up"}),y.jsx("p",{children:"You need to find YOUR state's 511 developer API. MeshAI does not include a default URL because every state is different. Some states have free public APIs, some require registration, and some don't have developer APIs at all."}),y.jsx("p",{children:"Configure in Config → Environmental → 511:"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx("strong",{children:"Base URL"})," — your state's API endpoint"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"API Key"})," — if required by your state"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Endpoints"})," — which data feeds to poll (varies by state)"]})]}),y.jsx(Te,{children:"Learn More"}),y.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),y.jsxs(vi,{id:"mesh-health",title:"Mesh Health",children:[y.jsx(Te,{children:"Health Score"}),y.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:"}),y.jsx(jt,{headers:["Pillar","Weight","What It Measures"],rows:[[y.jsx("strong",{children:"Infrastructure"}),"30%","Are your routers online?"],[y.jsx("strong",{children:"Utilization"}),"25%","Is the radio channel congested?"],[y.jsx("strong",{children:"Coverage"}),"20%","Do nodes have redundant paths to gateways?"],[y.jsx("strong",{children:"Behavior"}),"15%","Are any nodes flooding the channel?"],[y.jsx("strong",{children:"Power"}),"10%","Are battery-powered nodes running low?"]]}),y.jsx("p",{children:"The overall score is the weighted sum:"}),y.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"Score = (Infrastructure × 30%) + (Utilization × 25%) + (Coverage × 20%) + (Behavior × 15%) + (Power × 10%)"}),y.jsx(Te,{children:"How Each Pillar Is Calculated"}),y.jsx(vl,{children:"Infrastructure (30%)"}),y.jsx("p",{children:"This is the simplest pillar — what percentage of your infrastructure nodes are currently online?"}),y.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"(routers online ÷ total routers) × 100"}),y.jsxs("p",{children:["Only nodes with the ",y.jsx($e,{children:"ROUTER"}),", ",y.jsx($e,{children:"ROUTER_LATE"}),", or ",y.jsx($e,{children:"ROUTER_CLIENT"})," role count as infrastructure. Regular client nodes going offline doesn't affect this score. If you have 5 routers and 3 are online, infrastructure scores 60."]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Special case:"})," If you have no routers at all (all clients), this pillar scores 100. You're not penalized for not having infrastructure — you just don't have any to track."]}),y.jsx(vl,{children:"Utilization (25%)"}),y.jsxs("p",{children:["MeshAI reads the channel utilization that each router reports in its telemetry — this is the firmware's own measurement of how busy the radio channel is. MeshAI uses the ",y.jsx("strong",{children:"highest"})," value from any infrastructure node because the busiest router is the bottleneck for the whole mesh."]}),y.jsx("p",{children:y.jsx("strong",{children:"How it works:"})}),y.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-4",children:[y.jsxs("li",{children:["Collect ",y.jsx($e,{children:"channel_utilization"})," from all infrastructure nodes that report it"]}),y.jsx("li",{children:"If no infra nodes have telemetry, try all nodes"}),y.jsxs("li",{children:["Use the ",y.jsx("strong",{children:"maximum"})," value for scoring (busiest node = bottleneck)"]}),y.jsx("li",{children:"If no nodes report utilization (older firmware), fall back to packet count estimate"})]}),y.jsxs("p",{className:"mt-4",children:[y.jsx("strong",{children:"Fallback method"})," (when telemetry unavailable): estimates from packet counts using 200ms/packet airtime. This is less accurate — it assumes MediumFast preset and sums packets across all nodes."]}),y.jsx(jt,{headers:["Channel Utilization","Score","What It Means"],rows:[["Under 20%","100","Channel is clear — this is the goal"],["20-25%","75-100","Slight degradation, occasional collisions"],["25-35%","50-75","Severe degradation — firmware throttling active"],["35-45%","25-50","Mesh struggling badly — reliability dropping"],["Over 45%","0-25","Mesh is effectively unusable"]]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Special case:"})," If no utilization data is available (no telemetry and no packet data), this pillar scores 100. You're not penalized for missing data."]}),y.jsx(vl,{children:"Coverage (20%)"}),y.jsx("p",{children:'Measures gateway redundancy — how many of your data sources can "see" each node. A node reported by all 3 of your gateways has full coverage. A node only seen by 1 gateway is a single point of failure.'}),y.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["coverage_ratio = average_gateways_per_node ÷ total_sources",y.jsx("br",{}),"single_gw_penalty = (single_gateway_nodes ÷ total_nodes) × 40"]}),y.jsx("p",{children:"If a node is seen by 2 out of 3 sources, its coverage ratio is 0.67. Infrastructure nodes with only single-gateway coverage get an extra penalty — they're critical but have no backup path."}),y.jsx(jt,{headers:["Coverage Ratio","Base Score","After Penalty"],rows:[["100% (all sources)","100","100 minus single-gw penalty"],["70-99%","90","Minus penalties"],["50-69%","70","Minus penalties"],["Under 50%","50 or less","Heavy penalty"]]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Special case:"})," With only 1 data source, this pillar can't score well — there's no redundancy to measure. Coverage becomes meaningful when you have 2+ sources (MeshMonitor + MQTT, multiple gateways, etc.)."]}),y.jsx(vl,{children:"Behavior (15%)"}),y.jsx("p",{children:"Counts how many nodes are sending an unusually high number of non-text packets. This catches firmware bugs, stuck transmitters, and misconfigured nodes that are flooding the channel."}),y.jsxs("p",{children:[y.jsx("strong",{children:"What counts as flooding:"})," More than 500 non-text packets in 24 hours. Text messages don't count — the behavior pillar only flags telemetry, position, and routing packet floods."]}),y.jsx(jt,{headers:["Flagged Nodes","Score"],rows:[["0","100"],["1","80"],["2-3","60"],["4-5","40"],["6+","20"]]}),y.jsx("p",{children:"A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar."}),y.jsx(vl,{children:"Power (10%)"}),y.jsx("p",{children:"Measures what fraction of battery-powered nodes are below the warning threshold (default 20%)."}),y.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"100 × (1 − low_battery_nodes ÷ total_battery_nodes)"}),y.jsx("p",{children:"If 2 out of 10 battery nodes are below 20%, power scores 80."}),y.jsxs("p",{children:[y.jsx("strong",{children:"Important:"})," USB-powered nodes are excluded from this calculation. Many nodes report 100% battery even when running on wall power with no battery installed. Only nodes actually running on batteries affect this pillar."]}),y.jsx(Te,{children:"Health Tiers"}),y.jsx(jt,{headers:["Score","Tier","What It Means"],rows:[["90-100",y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),y.jsx(Te,{children:"Channel Utilization — Is the Radio Channel Full?"}),y.jsx("p",{children:"Meshtastic radios share one LoRa channel. If too many nodes are transmitting too often, they step on each other and messages get lost."}),y.jsx(jt,{headers:["Utilization","What's Happening"],rows:[[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target."],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[y.jsxs(y.Fragment,{children:[y.jsx(ir,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),y.jsx(Te,{children:"Packet Flooding"}),y.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:y.jsx("strong",{children:'⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),y.jsx("p",{children:"A normal Meshtastic node sends a packet every few minutes (announcing itself, reporting telemetry, updating position). If a node starts blasting packets every few seconds, something is wrong — firmware bug, stuck transmitter, or misconfiguration."}),y.jsx(jt,{headers:["Packets per Minute","What It Means"],rows:[["1-5","Normal"],["5-10","Elevated — might be someone chatting a lot"],["10-20","Suspicious — worth investigating"],["Over 30","Something is broken. This node is actively hurting the mesh."]]}),y.jsx(Te,{children:"Battery Levels"}),y.jsx("p",{children:"Most Meshtastic radios (T-Beam, RAK4631, Heltec V3) use a single lithium battery cell. The voltage tells you how much charge is left:"}),y.jsx(jt,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[y.jsx("strong",{children:"3.60V"}),y.jsx("strong",{children:"~30%"}),y.jsx(y.Fragment,{children:y.jsx("strong",{children:"⚠️ Warning — charge it soon"})})],[y.jsx("strong",{children:"3.50V"}),y.jsx("strong",{children:"~15%"}),y.jsx(y.Fragment,{children:y.jsx("strong",{children:"🔴 Low — charge it now"})})],[y.jsx("strong",{children:"3.40V"}),y.jsx("strong",{children:"~7%"}),y.jsx(y.Fragment,{children:y.jsx("strong",{children:"⚫ About to die"})})],["3.30V","~3%","Device shutting down"]]}),y.jsxs("p",{children:[y.jsx("strong",{children:"USB-powered nodes"})," report 100% battery even if there's no battery installed. Battery alerts only matter for nodes actually running on battery power."]}),y.jsx(Te,{children:"Node Offline Detection"}),y.jsx("p",{children:`MeshAI marks a node as "offline" when it hasn't been heard for a configurable time period. Different node types need different thresholds:`}),y.jsx(jt,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",y.jsx("strong",{children:"2 hours"}),"These should always be transmitting. 2 hours of silence means something is wrong."],["Fixed client (wall power)","2-4 hours","Same logic, slightly more lenient."],["Mobile / vehicle","4-8 hours","They go behind mountains, into garages, out of range. Normal."],["Solar-powered","12-24 hours","May shut down at night when solar stops charging."]]}),y.jsxs("p",{children:[y.jsx("strong",{children:"Rule of thumb"}),`: set the threshold to about 4× the node's beacon interval. Too tight and nodes will constantly flap "offline/online" from normal gaps. Too loose and real outages go unnoticed.`]})]}),y.jsxs(vi,{id:"notifications",title:"Notifications",children:[y.jsx(Te,{children:"How It Works"}),y.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx("strong",{children:"Something happens"})," — a fire is detected, weather warning issued, node goes offline, etc."]}),y.jsxs("li",{children:[y.jsx("strong",{children:"MeshAI checks your rules"})," — does this event match any of your notification rules? Is it severe enough? Are we in quiet hours?"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"If a rule matches"})," — MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),y.jsx(Te,{children:"Building Rules"}),y.jsx("p",{children:"Each rule answers three questions:"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),y.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),y.jsx(Te,{children:"Severity Levels — What Should I Set?"}),y.jsx(jt,{headers:["Level","When It's Used","Notification Volume"],rows:[["Info","Routine stuff (ducting detected, new router appeared)","High — lots of messages"],["Advisory","Worth knowing (weather advisory, slow traffic, battery declining)","Moderate"],["Watch","Pay attention (fire within 50km, weather watch, stream rising)","Low-moderate"],[y.jsxs(y.Fragment,{children:[y.jsx("strong",{children:"Warning"})," ✓"]}),"Take action (fire within 15km, severe weather, critical battery)","Low — recommended for most rules"],["Emergency","Life safety (extreme weather, fire at infrastructure, total blackout)","Very rare"]]}),y.jsxs("p",{children:[y.jsx("strong",{children:'"Warning" is the sweet spot for most rules.'})," You get alerted when something actually needs your attention without being overwhelmed by every minor event."]}),y.jsx(Te,{children:"Quiet Hours"}),y.jsx("p",{children:'When enabled, non-emergency notifications are held during sleeping hours (default 10pm-6am). Emergency alerts and rules marked "Override Quiet Hours" always get through.'}),y.jsx("p",{children:"You can turn quiet hours off entirely if you don't want them."}),y.jsx(Te,{children:"Webhook — The Swiss Army Knife"}),y.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx("strong",{children:"Discord"})," — use a Discord webhook URL"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Slack"})," — use a Slack incoming webhook URL"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"ntfy.sh"})," — POST to ",y.jsx($e,{children:"https://ntfy.sh/your-topic"})]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Pushover"})," — POST to the Pushover API"]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Home Assistant"})," — POST to an automation webhook URL"]}),y.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),y.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),y.jsxs(vi,{id:"commands",title:"Commands",children:[y.jsxs("p",{children:["All commands use the ",y.jsx($e,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),y.jsx(Te,{children:"Basic Commands"}),y.jsx(jt,{headers:["Command","What It Does"],rows:[[y.jsx($e,{children:"!help"}),"Shows all available commands"],[y.jsx($e,{children:"!ping"}),"Tests if the bot is alive"],[y.jsx($e,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[y.jsx($e,{children:"!health"}),"Detailed health report with pillar scores"],[y.jsx($e,{children:"!weather"}),"Current weather for your area"]]}),y.jsx(Te,{children:"Environmental Commands"}),y.jsx(jt,{headers:["Command","What It Does"],rows:[[y.jsx($e,{children:"!alerts"}),"Active NWS weather alerts for your area"],[y.jsxs(y.Fragment,{children:[y.jsx($e,{children:"!solar"})," (or ",y.jsx($e,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[y.jsx($e,{children:"!fire"}),"Active wildfires near your mesh"],[y.jsx($e,{children:"!avy"}),'Avalanche advisory (seasonal — shows "off season" in summer)'],[y.jsxs(y.Fragment,{children:[y.jsx($e,{children:"!streams"})," (or ",y.jsx($e,{children:"!gauges"}),")"]}),"Stream gauge readings"],[y.jsxs(y.Fragment,{children:[y.jsx($e,{children:"!roads"})," (or ",y.jsx($e,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[y.jsx($e,{children:"!hotspots"}),"Satellite fire detections"]]}),y.jsx(Te,{children:"Subscription Commands"}),y.jsx(jt,{headers:["Command","What It Does"],rows:[[y.jsx($e,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[y.jsx($e,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[y.jsx($e,{children:"!subscribe all"}),"Subscribe to everything"],[y.jsx($e,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[y.jsx($e,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),y.jsx(Te,{children:"Conversational"}),y.jsx("p",{children:`MeshAI isn't just commands — you can ask it questions in plain English. "How's the mesh doing?" "Is there any ducting?" "What's the fire situation?" "How's traffic on I-84?" It uses the live environmental data and mesh health data to answer.`})]}),y.jsxs(vi,{id:"api",title:"API Reference",children:[y.jsxs("p",{children:["MeshAI's REST API is available at ",y.jsx($e,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),y.jsx(Te,{children:"System"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/status"})," — version, uptime, node count"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/channels"})," — radio channel list"]}),y.jsxs("li",{children:[y.jsx($e,{children:"POST /api/restart"})," — restart the bot"]})]}),y.jsx(Te,{children:"Mesh Data"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/health"})," — health score and pillars"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/nodes"})," — all nodes with positions and telemetry"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/edges"})," — neighbor links with signal quality"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/regions"})," — region summaries"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/sources"})," — data source health"]})]}),y.jsx(Te,{children:"Configuration"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/config"})," — full config"]}),y.jsxs("li",{children:[y.jsxs($e,{children:["GET /api/config/","{section}"]})," — one section"]}),y.jsxs("li",{children:[y.jsxs($e,{children:["PUT /api/config/","{section}"]})," — update a section"]})]}),y.jsx(Te,{children:"Environmental"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/env/status"})," — per-feed health"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/env/active"})," — all active events"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/env/swpc"})," — solar/geomagnetic data"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/env/ducting"})," — atmospheric profile"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/env/fires"})," — wildfire perimeters"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/env/hotspots"})," — satellite fire detections"]})]}),y.jsx(Te,{children:"Alerts"}),y.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/alerts/active"})," — current alerts"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/alerts/history"})," — past alerts"]}),y.jsxs("li",{children:[y.jsx($e,{children:"GET /api/notifications/categories"})," — available alert categories"]})]}),y.jsx(Te,{children:"Real-time"}),y.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:y.jsxs("li",{children:[y.jsx($e,{children:"ws://your-host:8080/ws/live"})," — WebSocket for live updates"]})})]})]})})]})}const met=1500;function yet(){const[e,t]=W.useState({}),[r,n]=W.useState({}),[i,a]=W.useState(!0),[o,s]=W.useState(null),[l,u]=W.useState({}),[c,f]=W.useState({}),[h,d]=W.useState({}),v=W.useCallback(async()=>{a(!0),s(null);try{const[S,T]=await Promise.all([fetch("/api/adapter-config"),fetch("/api/adapter-meta")]);if(!S.ok)throw new Error(`GET /adapter-config: ${S.status}`);if(!T.ok)throw new Error(`GET /adapter-meta: ${T.status}`);t(await S.json()),n(await T.json())}catch(S){s(String(S))}finally{a(!1)}},[]);W.useEffect(()=>{v()},[v]);const g=W.useCallback((S,T,C)=>{f(A=>({...A,[S]:T})),C&&d(A=>({...A,[S]:C})),T==="saved"&&setTimeout(()=>{f(A=>A[S]==="saved"?{...A,[S]:"idle"}:A)},met)},[]),m=W.useCallback(async(S,T,C)=>{const A=`${S}.${T}`;g(A,"saving");try{const P=await fetch(`/api/adapter-config/${S}/${T}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:C})});if(!P.ok){const E=(await P.json().catch(()=>({}))).detail||P.statusText;g(A,"error",String(E));return}const I=await P.json();t(k=>({...k,[S]:(k[S]||[]).map(E=>E.key===T?I:E)})),g(A,"saved")}catch(P){g(A,"error",String(P))}},[g]),x=W.useCallback(async(S,T)=>{const C=`${S}.${T}`;g(C,"saving");try{const A=await fetch(`/api/adapter-config/${S}/${T}/reset`,{method:"POST"});if(!A.ok){g(C,"error",`reset failed (${A.status})`);return}const P=await A.json();t(I=>({...I,[S]:(I[S]||[]).map(k=>k.key===T?P:k)})),g(C,"saved")}catch(A){g(C,"error",String(A))}},[g]),_=W.useCallback(async(S,T)=>{const C=`meta:${S}`;g(C,"saving");try{const A=await fetch(`/api/adapter-meta/${S}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!A.ok){const I=await A.json().catch(()=>({}));g(C,"error",String(I.detail||A.statusText));return}const P=await A.json();n(I=>({...I,[S]:P})),g(C,"saved")}catch(A){g(C,"error",String(A))}},[g]);if(i)return y.jsxs("div",{className:"p-6 flex items-center gap-2 text-slate-400",children:[y.jsx(OS,{className:"w-5 h-5 animate-spin"})," Loading adapter config…"]});if(o)return y.jsxs("div",{className:"p-6 text-red-400",children:[y.jsx(ou,{className:"w-5 h-5 inline mr-2"}),"Failed to load: ",o]});const b=Array.from(new Set([...Object.keys(r),...Object.keys(e)])).sort();return y.jsxs("div",{className:"p-6 space-y-4",children:[y.jsxs("div",{className:"flex items-center gap-2 text-slate-200",children:[y.jsx(zZ,{className:"w-5 h-5"}),y.jsx("h1",{className:"text-xl font-semibold",children:"Adapter Config"}),y.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[Object.values(e).reduce((S,T)=>S+T.length,0)," settings across ",b.length," adapters"]})]}),y.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:"Per-adapter tunables (thresholds, freshness windows, toggles, curation lists). Changes take effect on the next handler call -- no container restart needed. Sentence templates, emoji, and translation maps live in code by design."}),b.map(S=>{const T=r[S]||{display_name:S,include_in_llm_context:!0,description:""},C=e[S]||[],A=l[S]??!1,P=`meta:${S}`,I=c[P]||"idle";return y.jsxs("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg",children:[y.jsxs("div",{className:"p-4 flex items-start gap-4",children:[y.jsx("button",{onClick:()=>u(k=>({...k,[S]:!k[S]})),className:"text-slate-400 hover:text-white","aria-label":"toggle expand",children:A?y.jsx(yu,{className:"w-5 h-5"}):y.jsx(au,{className:"w-5 h-5"})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("h2",{className:"text-base font-semibold text-slate-100",children:T.display_name}),y.jsx("code",{className:"text-xs text-slate-500",children:S}),C.length>0&&y.jsxs("span",{className:"text-xs text-slate-400 ml-1",children:["(",C.length," settings)"]}),C.length===0&&y.jsx("span",{className:"text-xs text-slate-500 ml-1 italic",children:"(meta only)"})]}),T.description&&y.jsx("p",{className:"text-xs text-slate-400 mt-1",children:T.description})]}),y.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-300 select-none",children:[y.jsx("input",{type:"checkbox",checked:T.include_in_llm_context,onChange:k=>_(S,{include_in_llm_context:k.target.checked}),className:"w-4 h-4 accent-cyan-500"}),"LLM context",y.jsx(iae,{status:I,error:h[P]})]})]}),A&&C.length>0&&y.jsx("div",{className:"border-t border-slate-700 divide-y divide-slate-700/60",children:C.map(k=>y.jsx(xet,{row:k,status:c[`${S}.${k.key}`]||"idle",error:h[`${S}.${k.key}`],onCommit:E=>m(S,k.key,E),onReset:()=>x(S,k.key)},k.key))})]},S)})]})}function xet({row:e,status:t,error:r,onCommit:n,onReset:i}){const[a,o]=W.useState(bP(e));W.useEffect(()=>{o(bP(e))},[e.value,e.type]);const s=a!==bP(e),l=JSON.stringify(e.value)===JSON.stringify(e.default),u=()=>{const c=_et(a,e.type);c.error||c.changed(e.value)&&n(c.value)};return y.jsxs("div",{className:"px-6 py-3 flex items-start gap-4",children:[y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("code",{className:"text-sm font-mono text-cyan-300",children:e.key}),y.jsxs("span",{className:"text-xs text-slate-500",children:["[",e.type,"]"]}),!l&&y.jsx("span",{className:"text-xs text-amber-400",children:"edited"})]}),e.description&&y.jsx("p",{className:"text-xs text-slate-400 mt-1",children:e.description})]}),y.jsxs("div",{className:"flex items-center gap-2 min-w-[280px] justify-end",children:[e.type==="bool"?y.jsx("input",{type:"checkbox",checked:e.value===!0,onChange:c=>n(c.target.checked),className:"w-5 h-5 accent-cyan-500"}):e.type==="json"?y.jsx("textarea",{className:"w-72 h-20 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-xs font-mono text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u}):y.jsx("input",{type:e.type==="int"||e.type==="float"?"number":"text",step:e.type==="float"?"any":"1",className:"w-48 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-sm text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()}}),y.jsx(iae,{status:t,error:r,dirty:s}),y.jsx("button",{onClick:i,disabled:l,className:"text-slate-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset to default",children:y.jsx(DS,{className:"w-4 h-4"})})]})]})}function iae({status:e,error:t,dirty:r}){return e==="saving"?y.jsx(OS,{className:"w-4 h-4 text-cyan-400 animate-spin"}):e==="saved"?y.jsx(Bo,{className:"w-4 h-4 text-emerald-400"}):e==="error"?y.jsx("span",{title:t,className:"text-red-400 cursor-help",children:y.jsx(ou,{className:"w-4 h-4"})}):r?y.jsx("span",{className:"w-2 h-2 bg-amber-400 rounded-full",title:"unsaved"}):y.jsx("span",{className:"w-4 h-4"})}function bP(e){return e.type==="bool"?String(e.value===!0):e.type==="json"?JSON.stringify(e.value,null,2):e.value===null||e.value===void 0?"":String(e.value)}function _et(e,t){if(t==="int"){const r=Number(e);return!Number.isFinite(r)||!Number.isInteger(r)?{error:"expected integer",value:null,changed:()=>!1}:{error:null,value:r,changed:n=>n!==r}}if(t==="float"){const r=Number(e);return Number.isFinite(r)?{error:null,value:r,changed:n=>n!==r}:{error:"expected number",value:null,changed:()=>!1}}if(t==="str")return{error:null,value:e,changed:r=>r!==e};if(t==="json")try{const r=JSON.parse(e);return{error:null,value:r,changed:n=>JSON.stringify(n)!==JSON.stringify(r)}}catch{return{error:"invalid JSON",value:null,changed:()=>!1}}return{error:null,value:e,changed:()=>!0}}const wP={site_id:"",gauge_name:"",lat:0,lon:0,action_ft:null,flood_minor_ft:null,flood_moderate_ft:null,flood_major_ft:null,enabled:!0,updated_at:0};function bet(){const[e,t]=W.useState([]),[r,n]=W.useState(!0),[i,a]=W.useState(null),[o,s]=W.useState(null),[l,u]=W.useState(wP),[c,f]=W.useState(!1),h=W.useCallback(async()=>{n(!0),a(null);try{const _=await fetch("/api/gauge-sites");if(!_.ok)throw new Error(`GET: ${_.status}`);t(await _.json())}catch(_){a(String(_))}finally{n(!1)}},[]);W.useEffect(()=>{h()},[h]);const d=_=>{s(_.site_id),u({..._}),f(!1)},v=()=>{f(!0),s(null),u({...wP})},g=()=>{s(null),f(!1),u(wP)},m=async()=>{try{const _=c?"/api/gauge-sites":`/api/gauge-sites/${o}`,S=await fetch(_,{method:c?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!S.ok){const T=await S.json().catch(()=>({}));alert(`save failed: ${T.detail||S.statusText}`);return}g(),h()}catch(_){alert(String(_))}},x=async _=>{if(!confirm(`Delete ${_}?`))return;const b=await fetch(`/api/gauge-sites/${_}`,{method:"DELETE"});if(!b.ok){alert(`delete failed: ${b.status}`);return}h()};return r?y.jsxs("div",{className:"p-6 text-slate-400",children:[y.jsx(OS,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?y.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):y.jsxs("div",{className:"p-6 space-y-4",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(kS,{className:"w-5 h-5 text-cyan-400"}),y.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Gauge Sites"}),y.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," sites"]}),y.jsxs("button",{onClick:v,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[y.jsx(_v,{className:"w-4 h-4"})," Add site"]})]}),y.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:"NWS-AHPS stream gauge thresholds curated for the nwis_handler. Disabled rows are ignored at envelope time. Changes propagate to the handler on the next event."}),c&&y.jsx(n7,{draft:l,setDraft:u,onSave:m,onCancel:g,adding:!0}),y.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:y.jsxs("table",{className:"w-full text-sm text-slate-200",children:[y.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:y.jsxs("tr",{children:[y.jsx("th",{className:"px-3 py-2 text-left",children:"Site ID"}),y.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),y.jsx("th",{className:"px-3 py-2 text-right",children:"Lat,Lon"}),y.jsx("th",{className:"px-3 py-2 text-right",children:"Action"}),y.jsx("th",{className:"px-3 py-2 text-right",children:"Minor"}),y.jsx("th",{className:"px-3 py-2 text-right",children:"Moderate"}),y.jsx("th",{className:"px-3 py-2 text-right",children:"Major"}),y.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),y.jsx("th",{className:"px-3 py-2"})]})}),y.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(_=>o===_.site_id?y.jsx("tr",{className:"bg-slate-900/40",children:y.jsx("td",{colSpan:9,className:"px-3 py-2",children:y.jsx(n7,{draft:l,setDraft:u,onSave:m,onCancel:g})})},_.site_id):y.jsxs("tr",{className:"hover:bg-slate-800/50",children:[y.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:_.site_id}),y.jsx("td",{className:"px-3 py-2",children:_.gauge_name}),y.jsxs("td",{className:"px-3 py-2 text-right text-xs",children:[_.lat.toFixed(3),",",_.lon.toFixed(3)]}),y.jsx("td",{className:"px-3 py-2 text-right",children:_.action_ft??"-"}),y.jsx("td",{className:"px-3 py-2 text-right",children:_.flood_minor_ft??"-"}),y.jsx("td",{className:"px-3 py-2 text-right",children:_.flood_moderate_ft??"-"}),y.jsx("td",{className:"px-3 py-2 text-right",children:_.flood_major_ft??"-"}),y.jsx("td",{className:"px-3 py-2 text-center",children:_.enabled?y.jsx(Bo,{className:"w-4 h-4 text-emerald-400 inline"}):y.jsx(zo,{className:"w-4 h-4 text-slate-500 inline"})}),y.jsxs("td",{className:"px-3 py-2 text-right",children:[y.jsx("button",{onClick:()=>d(_),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),y.jsx("button",{onClick:()=>x(_.site_id),className:"text-red-400 hover:text-red-300",children:y.jsx(Jy,{className:"w-4 h-4 inline"})})]})]},_.site_id))})]})})]})}function n7({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i}){const a=(o,s)=>t({...e,[o]:s});return y.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[y.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Site ID",y.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100 font-mono text-xs",value:e.site_id,onChange:o=>a("site_id",o.target.value),disabled:!i})]}),y.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Gauge name",y.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.gauge_name,onChange:o=>a("gauge_name",o.target.value)})]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",y.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:o=>a("lat",parseFloat(o.target.value))})]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",y.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:o=>a("lon",parseFloat(o.target.value))})]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["Action ft",y.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.action_ft??"",onChange:o=>a("action_ft",o.target.value===""?null:parseFloat(o.target.value))})]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["Minor flood ft",y.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_minor_ft??"",onChange:o=>a("flood_minor_ft",o.target.value===""?null:parseFloat(o.target.value))})]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["Moderate flood ft",y.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_moderate_ft??"",onChange:o=>a("flood_moderate_ft",o.target.value===""?null:parseFloat(o.target.value))})]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["Major flood ft",y.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_major_ft??"",onChange:o=>a("flood_major_ft",o.target.value===""?null:parseFloat(o.target.value))})]}),y.jsxs("label",{className:"text-xs text-slate-300 col-span-2 flex items-center gap-2 mt-2",children:[y.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>a("enabled",o.target.checked),className:"accent-cyan-500"}),"Enabled"]}),y.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[y.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),y.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}const SP={anchor_id:0,name:"",lat:0,lon:0,state:"ID",enabled:!0,updated_at:0};function wet(){const[e,t]=W.useState([]),[r,n]=W.useState(!0),[i,a]=W.useState(null),[o,s]=W.useState(null),[l,u]=W.useState(!1),[c,f]=W.useState(SP),h=W.useCallback(async()=>{n(!0),a(null);try{const _=await fetch("/api/town-anchors");if(!_.ok)throw new Error(`GET: ${_.status}`);t(await _.json())}catch(_){a(String(_))}finally{n(!1)}},[]);W.useEffect(()=>{h()},[h]);const d=_=>{s(_.anchor_id),f({..._}),u(!1)},v=()=>{u(!0),s(null),f({...SP})},g=()=>{s(null),u(!1),f(SP)},m=async()=>{const _=l?"/api/town-anchors":`/api/town-anchors/${o}`,S=await fetch(_,{method:l?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!S.ok){const T=await S.json().catch(()=>({}));alert(`save failed: ${T.detail||S.statusText}`);return}g(),h()},x=async _=>{if(!confirm(`Delete anchor ${_}?`))return;const b=await fetch(`/api/town-anchors/${_}`,{method:"DELETE"});if(!b.ok){alert(`delete failed: ${b.status}`);return}h()};return r?y.jsxs("div",{className:"p-6 text-slate-400",children:[y.jsx(OS,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?y.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):y.jsxs("div",{className:"p-6 space-y-4",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(xv,{className:"w-5 h-5 text-cyan-400"}),y.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Town Anchors"}),y.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," towns"]}),y.jsxs("button",{onClick:v,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[y.jsx(_v,{className:"w-4 h-4"})," Add town"]})]}),y.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:'Lookup table for the "X mi of " anchor in wire-string rendering. Disabled rows fall through to the generic anchor chain.'}),l&&y.jsx(i7,{draft:c,setDraft:f,onSave:m,onCancel:g,adding:!0}),y.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:y.jsxs("table",{className:"w-full text-sm text-slate-200",children:[y.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:y.jsxs("tr",{children:[y.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),y.jsx("th",{className:"px-3 py-2 text-right",children:"Lat"}),y.jsx("th",{className:"px-3 py-2 text-right",children:"Lon"}),y.jsx("th",{className:"px-3 py-2 text-center",children:"State"}),y.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),y.jsx("th",{className:"px-3 py-2"})]})}),y.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(_=>o===_.anchor_id?y.jsx("tr",{className:"bg-slate-900/40",children:y.jsx("td",{colSpan:6,className:"px-3 py-2",children:y.jsx(i7,{draft:c,setDraft:f,onSave:m,onCancel:g})})},_.anchor_id):y.jsxs("tr",{className:"hover:bg-slate-800/50",children:[y.jsx("td",{className:"px-3 py-2 capitalize",children:_.name}),y.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lat.toFixed(4)}),y.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lon.toFixed(4)}),y.jsx("td",{className:"px-3 py-2 text-center text-xs",children:_.state||"-"}),y.jsx("td",{className:"px-3 py-2 text-center",children:_.enabled?y.jsx(Bo,{className:"w-4 h-4 text-emerald-400 inline"}):y.jsx(zo,{className:"w-4 h-4 text-slate-500 inline"})}),y.jsxs("td",{className:"px-3 py-2 text-right",children:[y.jsx("button",{onClick:()=>d(_),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),y.jsx("button",{onClick:()=>x(_.anchor_id),className:"text-red-400 hover:text-red-300",children:y.jsx(Jy,{className:"w-4 h-4 inline"})})]})]},_.anchor_id))})]})})]})}function i7({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i}){const a=(o,s)=>t({...e,[o]:s});return y.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[y.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Name (lowercased on save)",y.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.name,onChange:o=>a("name",o.target.value),disabled:!i})]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["State",y.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.state??"",onChange:o=>a("state",o.target.value)})]}),y.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:[y.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>a("enabled",o.target.checked),className:"accent-cyan-500 mt-4"}),"Enabled"]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",y.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:o=>a("lat",parseFloat(o.target.value))})]}),y.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",y.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:o=>a("lon",parseFloat(o.target.value))})]}),y.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[y.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),y.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}function Tet(){return y.jsx(Oce,{children:y.jsx(Nce,{children:y.jsxs(Gue,{children:[y.jsx(Ma,{path:"/",element:y.jsx(vNe,{})}),y.jsx(Ma,{path:"/mesh",element:y.jsx(IQe,{})}),y.jsx(Ma,{path:"/environment",element:y.jsx(tet,{})}),y.jsx(Ma,{path:"/config",element:y.jsx(KQe,{})}),y.jsx(Ma,{path:"/alerts",element:y.jsx(cet,{})}),y.jsx(Ma,{path:"/notifications",element:y.jsx(pet,{})}),y.jsx(Ma,{path:"/reference",element:y.jsx(get,{})}),y.jsx(Ma,{path:"/adapter-config",element:y.jsx(yet,{})}),y.jsx(Ma,{path:"/gauge-sites",element:y.jsx(bet,{})}),y.jsx(Ma,{path:"/town-anchors",element:y.jsx(wet,{})})]})})})}TP.createRoot(document.getElementById("root")).render(y.jsx(Q.StrictMode,{children:y.jsx(que,{children:y.jsx(Tet,{})})})); diff --git a/meshai/dashboard/static/index.html b/meshai/dashboard/static/index.html index 11c2d20..21bbf35 100644 --- a/meshai/dashboard/static/index.html +++ b/meshai/dashboard/static/index.html @@ -8,8 +8,8 @@ - - + +
diff --git a/meshai/persistence/curation.py b/meshai/persistence/curation.py new file mode 100644 index 0000000..98e7346 --- /dev/null +++ b/meshai/persistence/curation.py @@ -0,0 +1,241 @@ +"""v0.6-4 curation accessors + seed routines. + +Both tables (gauge_sites, town_anchors) follow the same pattern as +adapter_config: created by a migration, seeded from Python data on first +boot, then runtime reads from SQLite via cached accessors. + +gauge_sites replaces idaho_gauge_sites.IDAHO_CURATED_SITES. +town_anchors replaces central_normalizer._TOWN_COORDS. +""" +from __future__ import annotations + +import logging +import sqlite3 +import threading +import time +from typing import Any, Optional + +logger = logging.getLogger(__name__) + + +# ============================================================================ +# Seed data (the dict that used to live in handler code) +# ============================================================================ + +# Idaho stream-gauge sites originally from +# meshai/central/idaho_gauge_sites.py:IDAHO_CURATED_SITES (v0.5.12). +_GAUGE_SITES_SEED: dict[str, dict[str, Any]] = { + "USGS-13139510": { + "gauge_name": "Big Lost River near Mackay", + "lat": 43.910, "lon": -113.620, + "action_ft": 5.5, "flood_minor_ft": 7.0, + "flood_moderate_ft": None, "flood_major_ft": None, + }, + "USGS-13186000": { + "gauge_name": "Snake River at Heise", + "lat": 43.612, "lon": -111.654, + "action_ft": 12.0, "flood_minor_ft": 14.0, + "flood_moderate_ft": 16.0, "flood_major_ft": None, + }, + "USGS-13037500": { + "gauge_name": "Snake River at Idaho Falls", + "lat": 43.500, "lon": -112.034, + "action_ft": 8.5, "flood_minor_ft": 10.0, + "flood_moderate_ft": None, "flood_major_ft": None, + }, + "USGS-13135500": { + "gauge_name": "Big Wood River near Hailey", + "lat": 43.533, "lon": -114.318, + "action_ft": 6.0, "flood_minor_ft": 7.5, + "flood_moderate_ft": None, "flood_major_ft": None, + }, + "USGS-13205000": { + "gauge_name": "Boise River near Boise", + "lat": 43.690, "lon": -116.200, + "action_ft": 8.0, "flood_minor_ft": 10.5, + "flood_moderate_ft": None, "flood_major_ft": None, + }, + "USGS-13247500": { + "gauge_name": "Payette River at Banks", + "lat": 44.080, "lon": -116.130, + "action_ft": 10.0, "flood_minor_ft": 12.0, + "flood_moderate_ft": None, "flood_major_ft": None, + }, + "USGS-13057000": { + "gauge_name": "Henrys Fork near Rexburg", + "lat": 43.831, "lon": -111.781, + "action_ft": 9.0, "flood_minor_ft": 10.5, + "flood_moderate_ft": None, "flood_major_ft": None, + }, + "USGS-13162225": { + "gauge_name": "Salmon Falls Creek near San Jacinto", + "lat": 42.180, "lon": -114.850, + "action_ft": 8.0, "flood_minor_ft": 10.0, + "flood_moderate_ft": None, "flood_major_ft": None, + }, + "USGS-13083000": { + "gauge_name": "Bear River near Border WY/ID", + "lat": 42.214, "lon": -111.045, + "action_ft": 6.0, "flood_minor_ft": 8.0, + "flood_moderate_ft": None, "flood_major_ft": None, + }, +} + +# Idaho + neighbor towns originally from central_normalizer._TOWN_COORDS. +_TOWN_ANCHORS_SEED: dict[str, dict[str, Any]] = { + "boise": {"lat": 43.6150, "lon": -116.2023, "state": "ID"}, + "meridian": {"lat": 43.6121, "lon": -116.3915, "state": "ID"}, + "nampa": {"lat": 43.5407, "lon": -116.5635, "state": "ID"}, + "caldwell": {"lat": 43.6629, "lon": -116.6874, "state": "ID"}, + "idaho falls": {"lat": 43.4666, "lon": -112.0340, "state": "ID"}, + "pocatello": {"lat": 42.8713, "lon": -112.4455, "state": "ID"}, + "twin falls": {"lat": 42.5630, "lon": -114.4609, "state": "ID"}, + "coeur d'alene": {"lat": 47.6777, "lon": -116.7805, "state": "ID"}, + "lewiston": {"lat": 46.4165, "lon": -117.0177, "state": "ID"}, + "moscow": {"lat": 46.7324, "lon": -117.0002, "state": "ID"}, + "sandpoint": {"lat": 48.2766, "lon": -116.5535, "state": "ID"}, + "post falls": {"lat": 47.7180, "lon": -116.9516, "state": "ID"}, + "hayden": {"lat": 47.7660, "lon": -116.7866, "state": "ID"}, + "rathdrum": {"lat": 47.8121, "lon": -116.8950, "state": "ID"}, + "plummer": {"lat": 47.3344, "lon": -116.8856, "state": "ID"}, + "kellogg": {"lat": 47.5380, "lon": -116.1352, "state": "ID"}, + "bonners ferry": {"lat": 48.6914, "lon": -116.3181, "state": "ID"}, + "rexburg": {"lat": 43.8260, "lon": -111.7897, "state": "ID"}, + "blackfoot": {"lat": 43.1905, "lon": -112.3447, "state": "ID"}, + "burley": {"lat": 42.5360, "lon": -113.7928, "state": "ID"}, + "jerome": {"lat": 42.7252, "lon": -114.5187, "state": "ID"}, + "mountain home": {"lat": 43.1330, "lon": -115.6912, "state": "ID"}, + "stanley": {"lat": 44.2160, "lon": -114.9311, "state": "ID"}, + "salmon": {"lat": 45.1758, "lon": -113.8957, "state": "ID"}, + "mccall": {"lat": 44.9111, "lon": -116.0987, "state": "ID"}, + "weiser": {"lat": 44.2510, "lon": -116.9690, "state": "ID"}, + "soda springs": {"lat": 42.6543, "lon": -111.6047, "state": "ID"}, + "preston": {"lat": 42.0963, "lon": -111.8766, "state": "ID"}, + "montpelier": {"lat": 42.3232, "lon": -111.2980, "state": "ID"}, +} + + +# ============================================================================ +# Caches +# ============================================================================ + +_LOCK = threading.Lock() +_gauge_cache: Optional[dict[str, dict[str, Any]]] = None +_town_cache: Optional[dict[str, tuple[float, float]]] = None + + +def invalidate_curation_cache() -> None: + """Drop the in-memory caches. Called by the REST API on POST/PUT/DELETE.""" + global _gauge_cache, _town_cache + with _LOCK: + _gauge_cache = None + _town_cache = None + + +def _load_gauge_cache() -> dict[str, dict[str, Any]]: + global _gauge_cache + if _gauge_cache is not None: + return _gauge_cache + try: + from meshai.persistence import get_db + conn = get_db() + rows = conn.execute( + "SELECT site_id, gauge_name, lat, lon, action_ft, flood_minor_ft, " + "flood_moderate_ft, flood_major_ft FROM gauge_sites WHERE enabled=1" + ).fetchall() + cache = {r["site_id"]: { + "gauge_name": r["gauge_name"], + "lat": r["lat"], "lon": r["lon"], + "action_ft": r["action_ft"], + "flood_minor_ft": r["flood_minor_ft"], + "flood_moderate_ft": r["flood_moderate_ft"], + "flood_major_ft": r["flood_major_ft"], + } for r in rows} + except Exception: + logger.exception("curation: gauge_sites cache load failed; using empty") + cache = {} + with _LOCK: + _gauge_cache = cache + return cache + + +def _load_town_cache() -> dict[str, tuple[float, float]]: + global _town_cache + if _town_cache is not None: + return _town_cache + try: + from meshai.persistence import get_db + conn = get_db() + rows = conn.execute( + "SELECT name, lat, lon FROM town_anchors WHERE enabled=1" + ).fetchall() + cache = {r["name"].lower(): (r["lat"], r["lon"]) for r in rows} + except Exception: + logger.exception("curation: town_anchors cache load failed; using empty") + cache = {} + with _LOCK: + _town_cache = cache + return cache + + +# ============================================================================ +# Lookups (called from handlers) +# ============================================================================ + + +def lookup_gauge_site(site_id: str) -> Optional[dict[str, Any]]: + """Return the row dict for `site_id` (canonical 'USGS-...' form) or None.""" + cache = _load_gauge_cache() + return cache.get(site_id) + + +def lookup_town_anchor(name: str) -> Optional[tuple[float, float]]: + """Return (lat, lon) for the lowercased town name, or None.""" + if not name: return None + cache = _load_town_cache() + return cache.get(name.strip().lower()) + + +# ============================================================================ +# Seed routines (called from init_db after migrations) +# ============================================================================ + + +def seed_gauge_sites(conn: sqlite3.Connection) -> int: + """INSERT OR IGNORE one row per _GAUGE_SITES_SEED entry. Idempotent.""" + now = time.time() + inserted = 0 + for site_id, spec in _GAUGE_SITES_SEED.items(): + cur = conn.execute( + "INSERT OR IGNORE INTO gauge_sites(" + "site_id, gauge_name, lat, lon, action_ft, flood_minor_ft, " + "flood_moderate_ft, flood_major_ft, enabled, updated_at) " + "VALUES (?,?,?,?,?,?,?,?,?,?)", + (site_id, spec["gauge_name"], spec["lat"], spec["lon"], + spec.get("action_ft"), spec.get("flood_minor_ft"), + spec.get("flood_moderate_ft"), spec.get("flood_major_ft"), + 1, now), + ) + if cur.rowcount > 0: + inserted += 1 + if inserted: + logger.info("curation: seeded %d gauge_sites rows", inserted) + return inserted + + +def seed_town_anchors(conn: sqlite3.Connection) -> int: + """INSERT OR IGNORE one row per _TOWN_ANCHORS_SEED entry. Idempotent.""" + now = time.time() + inserted = 0 + for name, spec in _TOWN_ANCHORS_SEED.items(): + cur = conn.execute( + "INSERT OR IGNORE INTO town_anchors(" + "name, lat, lon, state, enabled, updated_at) " + "VALUES (?,?,?,?,?,?)", + (name, spec["lat"], spec["lon"], spec.get("state"), 1, now), + ) + if cur.rowcount > 0: + inserted += 1 + if inserted: + logger.info("curation: seeded %d town_anchors rows", inserted) + return inserted diff --git a/meshai/persistence/db.py b/meshai/persistence/db.py index 4b480a7..06a76cc 100644 --- a/meshai/persistence/db.py +++ b/meshai/persistence/db.py @@ -30,7 +30,7 @@ logger = logging.getLogger(__name__) DEFAULT_DB_PATH = "/data/meshai.sqlite" MESHAI_DB_PATH_ENV = "MESHAI_DB_PATH" -SCHEMA_VERSION = 7 +SCHEMA_VERSION = 9 SCHEMA_META_TABLE = "schema_meta" MIGRATIONS_DIR = Path(__file__).parent / "migrations" @@ -134,6 +134,12 @@ def init_db(path: Optional[str] = None) -> sqlite3.Connection: prune_orphans(conn) except Exception: logger.exception("init_db: adapter_config seed/prune failed") + try: + from meshai.persistence.curation import seed_gauge_sites, seed_town_anchors + seed_gauge_sites(conn) + seed_town_anchors(conn) + except Exception: + logger.exception("init_db: curation seed failed") return conn diff --git a/meshai/persistence/migrations/v8.sql b/meshai/persistence/migrations/v8.sql new file mode 100644 index 0000000..2f83899 --- /dev/null +++ b/meshai/persistence/migrations/v8.sql @@ -0,0 +1,28 @@ +-- v0.6-4 gauge_sites curation table. +-- +-- Replaces the hardcoded IDAHO_CURATED_SITES dict in +-- meshai/central/idaho_gauge_sites.py with a GUI-editable SQLite table. +-- The Python dict is removed in this commit; the lookup helpers in +-- idaho_gauge_sites.py now read from this table via +-- meshai.persistence.curation.lookup_gauge_site(). +-- +-- Per-site NWS-AHPS thresholds (action / minor / moderate / major) are +-- nullable so sites without a published value for a band can sit on the +-- table without a fake value. Disabled rows (enabled=0) are skipped at +-- read time so the operator can pause a site without deleting it. + +CREATE TABLE IF NOT EXISTS gauge_sites ( + site_id TEXT PRIMARY KEY, -- 'USGS-13139510' canonical + gauge_name TEXT NOT NULL, + lat REAL NOT NULL, + lon REAL NOT NULL, + action_ft REAL, + flood_minor_ft REAL, + flood_moderate_ft REAL, + flood_major_ft REAL, + enabled INTEGER NOT NULL DEFAULT 1, + updated_at REAL NOT NULL +); + +CREATE INDEX IF NOT EXISTS idx_gauge_sites_enabled + ON gauge_sites(enabled); diff --git a/meshai/persistence/migrations/v9.sql b/meshai/persistence/migrations/v9.sql new file mode 100644 index 0000000..70564ab --- /dev/null +++ b/meshai/persistence/migrations/v9.sql @@ -0,0 +1,24 @@ +-- v0.6-4 town_anchors curation table. +-- +-- Replaces the hardcoded _TOWN_COORDS dict in central_normalizer.py. +-- The Python dict is removed in this commit; the lookup helpers in +-- central_normalizer.py now read from this table via +-- meshai.persistence.curation.lookup_town_anchor(). +-- +-- name TEXT is the canonical lookup key (lowercased) -- the existing +-- _compute_distance_bearing() already lowercases its town input. The +-- adapter accepting both 'Boise' and 'boise' is preserved because the +-- accessor lowercases before query. + +CREATE TABLE IF NOT EXISTS town_anchors ( + anchor_id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL UNIQUE, + lat REAL NOT NULL, + lon REAL NOT NULL, + state TEXT, + enabled INTEGER NOT NULL DEFAULT 1, + updated_at REAL NOT NULL +); + +CREATE INDEX IF NOT EXISTS idx_town_anchors_enabled + ON town_anchors(enabled); diff --git a/tests/test_adapter_config_foundation.py b/tests/test_adapter_config_foundation.py index f8817df..fc7bb5c 100644 --- a/tests/test_adapter_config_foundation.py +++ b/tests/test_adapter_config_foundation.py @@ -54,11 +54,11 @@ def test_v6_tables_exist(fresh_db): assert "adapter_meta" in tables -def test_schema_meta_at_v7(fresh_db): +def test_schema_meta_at_v9(fresh_db): v = fresh_db.execute( "SELECT value FROM schema_meta WHERE key='version'" ).fetchone()["value"] - assert int(v) == 7 + assert int(v) == 9 def test_adapter_config_type_check_constrains_vocabulary(fresh_db): diff --git a/tests/test_curation.py b/tests/test_curation.py new file mode 100644 index 0000000..ebf3f48 --- /dev/null +++ b/tests/test_curation.py @@ -0,0 +1,214 @@ +"""v0.6-4 curation tests: schema, seed, accessors, REST API.""" +from __future__ import annotations + +import pytest +from fastapi import FastAPI +from fastapi.testclient import TestClient + +from meshai.persistence.curation import ( + invalidate_curation_cache, + lookup_gauge_site, + lookup_town_anchor, + seed_gauge_sites, + seed_town_anchors, + _GAUGE_SITES_SEED, + _TOWN_ANCHORS_SEED, +) +from meshai.persistence import get_db +from meshai.dashboard.api.curation_routes import router as curation_router + + +# ============================================================================ +# Schema + seed +# ============================================================================ + + +def test_v8_v9_tables_present(): + conn = get_db() + tables = {r["name"] for r in conn.execute( + "SELECT name FROM sqlite_master WHERE type='table'" + ).fetchall()} + assert "gauge_sites" in tables + assert "town_anchors" in tables + + +def test_gauge_sites_seeded_at_init(): + conn = get_db() + n = conn.execute("SELECT COUNT(*) FROM gauge_sites").fetchone()[0] + assert n == len(_GAUGE_SITES_SEED) + + +def test_town_anchors_seeded_at_init(): + conn = get_db() + n = conn.execute("SELECT COUNT(*) FROM town_anchors").fetchone()[0] + assert n == len(_TOWN_ANCHORS_SEED) + + +def test_seed_idempotent(): + conn = get_db() + a = seed_gauge_sites(conn) + b = seed_town_anchors(conn) + assert a == 0 and b == 0 + + +def test_seed_does_not_overwrite_user_edits(): + conn = get_db() + conn.execute( + "UPDATE gauge_sites SET action_ft=99 WHERE site_id='USGS-13186000'" + ) + seed_gauge_sites(conn) + r = conn.execute( + "SELECT action_ft FROM gauge_sites WHERE site_id='USGS-13186000'" + ).fetchone() + assert r["action_ft"] == 99 + + +# ============================================================================ +# Accessors +# ============================================================================ + + +def test_lookup_gauge_site_hits(): + invalidate_curation_cache() + r = lookup_gauge_site("USGS-13186000") + assert r is not None + assert r["gauge_name"] == "Snake River at Heise" + assert r["action_ft"] == 12.0 + + +def test_lookup_gauge_site_miss(): + invalidate_curation_cache() + assert lookup_gauge_site("USGS-99999") is None + + +def test_lookup_gauge_disabled_row_invisible(): + conn = get_db() + conn.execute("UPDATE gauge_sites SET enabled=0 WHERE site_id='USGS-13186000'") + invalidate_curation_cache() + assert lookup_gauge_site("USGS-13186000") is None + + +def test_lookup_town_anchor_hits(): + invalidate_curation_cache() + coord = lookup_town_anchor("Boise") + assert coord is not None + assert coord[0] == pytest.approx(43.6150) + assert coord[1] == pytest.approx(-116.2023) + + +def test_lookup_town_anchor_case_insensitive(): + invalidate_curation_cache() + a = lookup_town_anchor("MERIDIAN") + b = lookup_town_anchor("meridian") + assert a == b + + +def test_lookup_town_anchor_miss(): + invalidate_curation_cache() + assert lookup_town_anchor("xxxx") is None + + +# ============================================================================ +# REST API: gauge_sites +# ============================================================================ + + +@pytest.fixture +def client(): + app = FastAPI() + app.include_router(curation_router, prefix="/api") + return TestClient(app) + + +def test_api_list_gauges(client): + r = client.get("/api/gauge-sites") + assert r.status_code == 200 + body = r.json() + assert len(body) == len(_GAUGE_SITES_SEED) + + +def test_api_get_one_gauge(client): + r = client.get("/api/gauge-sites/USGS-13186000") + assert r.status_code == 200 + assert r.json()["gauge_name"] == "Snake River at Heise" + + +def test_api_get_404(client): + r = client.get("/api/gauge-sites/USGS-99999") + assert r.status_code == 404 + + +def test_api_post_add_gauge(client): + r = client.post("/api/gauge-sites", json={ + "site_id": "USGS-NEW1", "gauge_name": "Test Gauge", + "lat": 44.0, "lon": -115.0, "action_ft": 5.0, + }) + assert r.status_code == 200, r.text + assert r.json()["site_id"] == "USGS-NEW1" + # Accessor sees it. + invalidate_curation_cache() + assert lookup_gauge_site("USGS-NEW1") is not None + + +def test_api_put_updates_gauge(client): + r = client.put("/api/gauge-sites/USGS-13186000", + json={"action_ft": 15.5}) + assert r.status_code == 200 + assert r.json()["action_ft"] == 15.5 + invalidate_curation_cache() + assert lookup_gauge_site("USGS-13186000")["action_ft"] == 15.5 + + +def test_api_delete_gauge(client): + r = client.delete("/api/gauge-sites/USGS-13186000") + assert r.status_code == 200 + invalidate_curation_cache() + assert lookup_gauge_site("USGS-13186000") is None + + +def test_api_post_missing_field_400(client): + r = client.post("/api/gauge-sites", json={"gauge_name": "X"}) + assert r.status_code == 400 + + +# ============================================================================ +# REST API: town_anchors +# ============================================================================ + + +def test_api_list_towns(client): + r = client.get("/api/town-anchors") + assert r.status_code == 200 + assert len(r.json()) == len(_TOWN_ANCHORS_SEED) + + +def test_api_post_add_town(client): + r = client.post("/api/town-anchors", json={ + "name": "Bellevue", "lat": 43.4670, "lon": -114.2557, "state": "ID", + }) + assert r.status_code == 200 + assert r.json()["name"] == "bellevue" + invalidate_curation_cache() + coord = lookup_town_anchor("bellevue") + assert coord is not None + + +def test_api_put_town(client): + # Find Boise's anchor_id first. + r = client.get("/api/town-anchors") + boise = next(t for t in r.json() if t["name"] == "boise") + r2 = client.put(f"/api/town-anchors/{boise['anchor_id']}", + json={"enabled": False}) + assert r2.status_code == 200 + assert r2.json()["enabled"] is False + invalidate_curation_cache() + assert lookup_town_anchor("boise") is None + + +def test_api_delete_town(client): + r = client.get("/api/town-anchors") + nampa = next(t for t in r.json() if t["name"] == "nampa") + r2 = client.delete(f"/api/town-anchors/{nampa['anchor_id']}") + assert r2.status_code == 200 + invalidate_curation_cache() + assert lookup_town_anchor("nampa") is None diff --git a/tests/test_nwis_handler.py b/tests/test_nwis_handler.py index 0470e48..25281dd 100644 --- a/tests/test_nwis_handler.py +++ b/tests/test_nwis_handler.py @@ -1,7 +1,9 @@ """Tests for v0.5.12 usgs_nwis handler.""" import pytest -from meshai.central.idaho_gauge_sites import IDAHO_CURATED_SITES +# v0.6-4: IDAHO_CURATED_SITES dict moved to gauge_sites SQLite table; +# import the seed data from the curation module as a back-compat alias. +from meshai.persistence.curation import _GAUGE_SITES_SEED as IDAHO_CURATED_SITES from meshai.central.nwis_handler import handle_nwis from meshai.persistence import close_thread_connection, init_db from meshai.persistence import db as persistence_db