From 4ed154770ded9c41960d5cc02c6ad5b2442f7dad Mon Sep 17 00:00:00 2001 From: K7ZVX Date: Wed, 13 May 2026 22:33:20 +0000 Subject: [PATCH] docs(dashboard): add detailed health pillar calculation explanations Reference page now explains HOW each health pillar is calculated: - Infrastructure: router online ratio - Utilization: airtime estimation from packet counts - Coverage: gateway redundancy with single-gw penalties - Behavior: flagged node thresholds - Power: battery warning ratio Includes actual formulas and special cases. Co-Authored-By: Claude Opus 4.5 --- dashboard-frontend/src/pages/Reference.tsx | 2048 +++++++++-------- .../{index-Dc67XxQ3.js => index-CmwrG05d.js} | 172 +- meshai/dashboard/static/index.html | 2 +- 3 files changed, 1163 insertions(+), 1059 deletions(-) rename meshai/dashboard/static/assets/{index-Dc67XxQ3.js => index-CmwrG05d.js} (66%) diff --git a/dashboard-frontend/src/pages/Reference.tsx b/dashboard-frontend/src/pages/Reference.tsx index 59db92b..1d47611 100644 --- a/dashboard-frontend/src/pages/Reference.tsx +++ b/dashboard-frontend/src/pages/Reference.tsx @@ -1,972 +1,1076 @@ -import { useState, useEffect, useRef } from 'react' -import { useLocation } from 'react-router-dom' -import { - Search, Droplets, Flame, Satellite, CloudLightning, Sun, - Radio, Mountain, Car, Construction, Activity, Bell, Terminal, - Code, ExternalLink -} from 'lucide-react' - -// Topic definitions -const TOPICS = [ - { id: 'stream-gauges', label: 'Stream Gauges', icon: Droplets }, - { id: 'wildfire', label: 'Wildfire', icon: Flame }, - { id: 'firms', label: 'Satellite Fire Detection (FIRMS)', icon: Satellite }, - { id: 'weather-alerts', label: 'Weather Alerts', icon: CloudLightning }, - { id: 'solar', label: 'Solar & Geomagnetic', icon: Sun }, - { id: 'ducting', label: 'Tropospheric Ducting', icon: Radio }, - { id: 'avalanche', label: 'Avalanche Danger', icon: Mountain }, - { id: 'traffic', label: 'Traffic Flow', icon: Car }, - { id: 'roads-511', label: 'Road Conditions (511)', icon: Construction }, - { id: 'mesh-health', label: 'Mesh Health', icon: Activity }, - { id: 'notifications', label: 'Notifications', icon: Bell }, - { id: 'commands', label: 'Commands', icon: Terminal }, - { id: 'api', label: 'API Reference', icon: Code }, -] - -// Status indicator component for colored dots -function StatusDot({ color }: { color: 'green' | 'yellow' | 'orange' | 'red' | 'black' }) { - const colorClasses = { - 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 -} - -// Table component styled for dark theme -function RefTable({ headers, rows }: { headers: string[]; rows: (string | React.ReactNode)[][] }) { - return ( -
- - - - {headers.map((h, i) => ( - - ))} - - - - {rows.map((row, i) => ( - - {row.map((cell, j) => ( - - ))} - - ))} - -
{h}
{cell}
-
- ) -} - -// External link component -function ExtLink({ href, children }: { href: string; children: React.ReactNode }) { - return ( - - {children} - - ) -} - -// Section header -function SectionHeader({ children }: { children: React.ReactNode }) { - return

{children}

-} - -// Sub-header -function SubHeader({ children }: { children: React.ReactNode }) { - return

{children}

-} - -// Monospace text -function Mono({ children }: { children: React.ReactNode }) { - return {children} -} - -// Topic section wrapper -function TopicSection({ id, title, children }: { id: string; title: string; children: React.ReactNode }) { - return ( -
-

{title}

-
- {children} -
-
- ) -} - -export default function Reference() { - const location = useLocation() - const [searchQuery, setSearchQuery] = useState('') - const [activeTopic, setActiveTopic] = useState('stream-gauges') - const contentRef = useRef(null) - - // Handle hash navigation - useEffect(() => { - const hash = location.hash.replace('#', '') - if (hash && TOPICS.find(t => t.id === hash)) { - setActiveTopic(hash) - const element = document.getElementById(hash) - if (element) { - element.scrollIntoView({ behavior: 'smooth' }) - } - } - }, [location.hash]) - - // Filter topics by search - const filteredTopics = TOPICS.filter(t => - t.label.toLowerCase().includes(searchQuery.toLowerCase()) - ) - - const scrollToTopic = (topicId: string) => { - setActiveTopic(topicId) - const element = document.getElementById(topicId) - if (element) { - element.scrollIntoView({ behavior: 'smooth' }) - } - window.history.replaceState(null, '', `#${topicId}`) - } - - return ( -
- {/* Topic sidebar */} - - - {/* Main content */} -
-
-

- Everything you need to understand and configure MeshAI's monitoring and alerting systems. -

- - {/* Stream Gauges */} - - What You're Looking At -

- MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things: -

-

- 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. -

-

- 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: -

-
    -
  • A small creek: 50-200 CFS
  • -
  • A mid-size river: 1,000-5,000 CFS
  • -
  • A big river in spring runoff: 10,000+ CFS
  • -
- - When Does It Flood? -

- Flood levels are set by the 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. -

-

Action Stage — water is rising, time to start paying attention. Usually still inside the riverbanks.

-

Minor Flood — low-lying roads start getting water on them. NWS issues a Flood Advisory.

-

Moderate Flood — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning.

-

Major Flood — widespread flooding. Many people evacuating. Serious property damage.

-

- 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. -

- - Low Water / Drought -

- 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. -

- - Setting It Up -
    -
  1. Find your gauge at waterdata.usgs.gov/nwis
  2. -
  3. Copy the site number (like 13090500)
  4. -
  5. Add it in Config → Environmental → USGS
  6. -
  7. MeshAI auto-fills the gauge name and flood levels from NWS
  8. -
-

If NWS flood levels don't populate, your gauge may not have them. Set manual thresholds if you know your local conditions.

- - Learn More -
    -
  • USGS Water Data — find gauges near you
  • -
  • NWS Water Prediction Service — flood forecasts and thresholds
  • -
  • Understanding Streamflow — USGS explainer
  • -
-
- - {/* Wildfire */} - - What You're Looking At -

- 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. -

- - Fire Size — How Big Is It? - -

For reference, 1,000 acres is about 1.5 square miles.

- - Containment — Is It Under Control? -

- 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. -

-
    -
  • 0-30% — Essentially uncontrolled. The fire goes where it wants.
  • -
  • 50% — Good progress, but half the edge can still grow.
  • -
  • 80%+ — Well controlled. Major growth unlikely.
  • -
  • 100% — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."
  • -
- - How Far Away Should I Worry? - Under 5 km (3 miles), <>Immediate threat. This is evacuation-order range. Embers can fly this far in wind.], - [<> 5-15 km (3-10 miles), <>Prepare. The fire could reach you in hours under bad conditions. Have a plan.], - [<> 15-30 km (10-20 miles), <>Watch. Smoke is likely. Wind shifts could change things fast.], - [<> Over 30 km (20 miles), <>Awareness. Keep an eye on it, but no immediate threat.], - ]} - /> -

- 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. -

- - Which Matters More — Size or Distance? -

- 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. -

- - Setting It Up -

- Just configure your state code (like 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. -

- - Learn More -
    -
  • InciWeb — detailed incident information
  • -
  • NIFC Fire Map — raw perimeter data
  • -
  • Ready.gov Wildfires — preparedness guide
  • -
-
- - {/* FIRMS */} - - What You're Looking At -

- 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. -

-

- Why this matters: satellite hotspots show up 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. -

- - Confidence — Is It Really a Fire? -

Each detection gets a confidence rating:

- -

- Recommendation: Set the filter to "Nominal + High." If you include "Low" you'll get alerts for every hot parking lot on a summer day. -

- - FRP — How Intense Is It? -

FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":

- -

Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms.

- - New Ignition Detection -

- MeshAI cross-references satellite hotspots against known NIFC fire perimeters. If a hotspot is NOT near any known fire, it gets flagged as a potential new ignition — maybe a new fire just started. These get elevated priority regardless of confidence level. -

- - Timing -

- Satellite data arrives 1-3 hours after the satellite passes overhead. Each location gets observed about 6 times per day across all satellites, so there are multi-hour gaps. This is not real-time — it's "pretty recent." -

- - Getting an API Key -
    -
  1. Go to FIRMS API page
  2. -
  3. Click "Get MAP_KEY"
  4. -
  5. Register for a free Earthdata account
  6. -
  7. Your key arrives by email
  8. -
  9. Enter it in Config → Environmental → FIRMS
  10. -
- - Learn More -
    -
  • FIRMS Fire Map — see hotspots on a map
  • -
  • FIRMS FAQ — how it works
  • -
-
- - {/* Weather Alerts */} - - What You're Looking At -

- MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories. -

- - Alert Severity — How Serious Is It? - - - When Should I Act? (Urgency) - - - How Sure Are They? (Certainty) - - - These Are Separate Scales -

- 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." -

- - What Minimum Severity Should I Set? - 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'], - ]} - /> -

- 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. -

- - Finding Your NWS Zone -
    -
  1. Go to weather.gov
  2. -
  3. Enter your location
  4. -
  5. Find your zone code at NWS Zone Map
  6. -
  7. Zone codes look like: IDZ016, UTZ040, etc.
  8. -
- - The User-Agent Field -

- 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: -

-

(meshai, you@email.com)

-

No registration. No waiting. Just type it in.

- - Learn More -
    -
  • NWS Active Alerts — see current alerts
  • -
  • NWS API Docs — technical details
  • -
-
- - {/* Solar & Geomagnetic */} - - What You're Looking At -

- 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. -

- - Solar Flux Index (SFI) -

Think of SFI as a "how active is the sun" number. Higher = better for HF radio, but also higher risk of solar flares.

- -

Quick rule: SFI above 90 and Kp below 4 = good day for HF radio.

- - Kp Index -

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.

- 5, <>Minor storm (G1). HF noticeably degraded. Aurora visible at high latitudes (~60°N).], - [6, <>Moderate storm (G2). HF getting rough. Aurora moving south (~55°N).], - [7, <>Strong storm (G3). HF unreliable for 1-2 days. Aurora at mid-latitudes.], - [8-9, <>Severe/Extreme storm. HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible.], - ]} - /> - - R / S / G Scales -

NOAA's shorthand for three types of space weather events:

- R (Radio Blackouts) — from solar flares: -
    -
  • R1-R2: Brief HF disruption. You might not notice.
  • -
  • R3: HF goes out for about an hour on the sunlit side of Earth.
  • -
  • R4-R5: HF dead for hours. Serious.
  • -
- S (Solar Radiation Storms) — from energetic particles: -
    -
  • Mostly affects polar regions and satellites
  • -
  • S3+: Polar HF goes out entirely
  • -
- G (Geomagnetic Storms) — from solar wind disturbances: -
    -
  • Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9
  • -
- - Bz — The Storm Predictor -

- 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. -

- -

Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips.

- - Learn More -
    -
  • SWPC Space Weather Dashboard — live data
  • -
  • NOAA Space Weather Scales — what R/S/G mean
  • -
  • HamQSL Solar Page — ham-friendly display
  • -
  • Planetary K-Index — live Kp
  • -
-
- - {/* Tropospheric Ducting */} - - What You're Looking At -

- 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. -

-

- MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area. -

- - How Do I Know If Ducting Is Happening? -

MeshAI reports a "condition" based on the atmospheric profile:

- - - What You'll Actually Notice -

When ducting happens on your mesh:

-
    -
  • Distant repeaters you've never heard suddenly come in
  • -
  • Nodes appear from far outside your normal range
  • -
  • You hear FM radio stations from other cities
  • -
  • ADS-B flight tracking range gets much longer
  • -
  • There might be interference from distant stations on your frequency
  • -
- - The dM/dz Number -

The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:

-
    -
  • Around 118 = normal atmosphere
  • -
  • Below 79 = enhanced propagation starting
  • -
  • Below 0 (negative) = ducting is happening
  • -
  • Below -50 = strong ducting — classic VHF/UHF DX event
  • -
- - When Does Ducting Happen? -
    -
  • Under high-pressure weather systems (clear, stable air)
  • -
  • When warm air sits on top of cool air (temperature inversion)
  • -
  • Most common in late summer and early fall
  • -
  • Strongest along coastlines and over water
  • -
  • In mountain valleys: cold air pooling in fall/winter can create surface ducts
  • -
- - Setting It Up -

- 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. -

- - Learn More -
    -
  • Tropo Forecast Maps (Hepburn) — 6-day tropo prediction
  • -
  • DX Maps — real-time VHF/UHF propagation reports
  • -
  • Wikipedia: Tropospheric Propagation — background
  • -
-
- - {/* Avalanche Danger */} - - What You're Looking At -

- 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. -

- - The Danger Scale - , 'Generally safe. Normal caution in steep terrain.'], - ['2', 'Moderate', , 'Be careful on specific terrain features. Evaluate conditions.'], - ['3', 'Considerable', , <>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', , <>Very dangerous. Stay off anything steep.], - ['5', 'Extreme', , <>Don't go out. Avalanches are happening on their own.], - ]} - /> - - The Most Important Thing to Know -

- 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. -

- - Seasonal -

- MeshAI only checks avalanche conditions during winter months (configurable, default December through April). Outside season, it shows "off season" and saves API calls. -

- - Finding Your Avalanche Center -

- Go to avalanche.org/avalanche-centers/ for a map. Common center codes: -

-
    -
  • SNFAC — Sawtooth (central Idaho)
  • -
  • UAC — Utah
  • -
  • NWAC — Cascades/Olympics (WA/OR)
  • -
  • CAIC — Colorado
  • -
  • SAC — Sierra Nevada (CA)
  • -
  • GNFAC — Gallatin (SW Montana)
  • -
- - Learn More -
    -
  • Avalanche.org — US forecasts
  • -
  • Avalanche Danger Scale — full scale explanation
  • -
  • Know Before You Go — avalanche awareness
  • -
-
- - {/* Traffic Flow */} - - What You're Looking At -

- MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed). -

- - Speed Ratio — The Key Number -

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:

- Above 85%, 'Normal. Traffic flowing fine.'], - [<> 65-85%, 'Slow. Heavier than usual but moving.'], - [<> 40-65%, 'Congested. Significant delays.'], - [<> Below 40%, 'Gridlock. Barely moving.'], - ]} - /> -

- 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. -

- - Confidence — Can You Trust the Data? -

TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:

- Unreliable — mostly guessing from historical patterns. Don't alert on this.], - ]} - /> -

Set minimum confidence to 0.7 to avoid false congestion alerts at night or on rural roads where few probe vehicles drive.

- - Setting Up Corridors -

Each "corridor" is a point on a road you want to monitor. To add one:

-
    -
  1. Go to Google Maps, find the road
  2. -
  3. Right-click the road → "What's here?" → copy the coordinates
  4. -
  5. Add the corridor in Config with a name and those coordinates
  6. -
  7. TomTom finds the nearest road segment automatically
  8. -
- - Getting an API Key -
    -
  1. Sign up at developer.tomtom.com (free)
  2. -
  3. Create an app → get your API key
  4. -
  5. Free tier: 2,500 requests/day (plenty for 5-10 corridors)
  6. -
- - Learn More -
    -
  • TomTom Developer Portal — API docs and key signup
  • -
  • TomTom Traffic Index — city congestion rankings
  • -
-
- - {/* 511 Road Conditions */} - - What You're Looking At -

- 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. -

- - Setting It Up -

- 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. -

-

Configure in Config → Environmental → 511:

-
    -
  • Base URL — your state's API endpoint
  • -
  • API Key — if required by your state
  • -
  • Endpoints — which data feeds to poll (varies by state)
  • -
- - Learn More -

Check your state's 511 or DOT website for developer information.

-
- - {/* Mesh Health */} - - Health Score -

MeshAI computes a 0-100 health score for your mesh network by looking at five areas:

- - - Health Tiers - Healthy, "Everything's working well."], - ['75-89', <> Slight degradation, 'Some issues but the mesh is functional.'], - ['50-74', <> Unhealthy, 'Multiple problems. Reliability is affected.'], - ['25-49', <> Warning, 'Significant issues. The mesh is struggling.'], - ['0-24', <> Critical, 'Major failures. Barely functional.'], - ]} - /> - - Channel Utilization — Is the Radio Channel Full? -

- Meshtastic radios share one LoRa channel. If too many nodes are transmitting too often, they step on each other and messages get lost. -

- Under 25%, 'Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target.'], - [<> 25-40%, 'Getting busy. Common on larger meshes. Worth watching.'], - [<> 40-50%, 'Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying.'], - [<> Over 50%, 'Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast.'], - [<> Over 65%, 'Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable.'], - ]} - /> - - Packet Flooding -

- ⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding. -

-

- 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. -

- - - Battery Levels -

- Most Meshtastic radios (T-Beam, RAK4631, Heltec V3) use a single lithium battery cell. The voltage tells you how much charge is left: -

- 3.60V, ~30%, <>⚠️ Warning — charge it soon], - [3.50V, ~15%, <>🔴 Low — charge it now], - [3.40V, ~7%, <>⚫ About to die], - ['3.30V', '~3%', 'Device shutting down'], - ]} - /> -

- USB-powered nodes report 100% battery even if there's no battery installed. Battery alerts only matter for nodes actually running on battery power. -

- - Node Offline Detection -

- MeshAI marks a node as "offline" when it hasn't been heard for a configurable time period. Different node types need different thresholds: -

- 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.'], - ]} - /> -

- 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. -

-
- - {/* Notifications */} - - How It Works -
    -
  1. Something happens — a fire is detected, weather warning issued, node goes offline, etc.
  2. -
  3. MeshAI checks your rules — does this event match any of your notification rules? Is it severe enough? Are we in quiet hours?
  4. -
  5. If a rule matches — MeshAI sends the notification through whatever delivery method that rule is configured for.
  6. -
- - Building Rules -

Each rule answers three questions:

-
    -
  • WHEN does it trigger? (which categories, what severity)
  • -
  • WHERE does it send? (mesh broadcast, email, webhook, etc.)
  • -
  • HOW OFTEN at most? (cooldown period)
  • -
-

- Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule." -

- - Severity Levels — What Should I Set? - 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'], - ]} - /> -

- "Warning" is the sweet spot for most rules. You get alerted when something actually needs your attention without being overwhelmed by every minor event. -

- - Quiet Hours -

- When enabled, non-emergency notifications are held during sleeping hours (default 10pm-6am). Emergency alerts and rules marked "Override Quiet Hours" always get through. -

-

You can turn quiet hours off entirely if you don't want them.

- - Webhook — The Swiss Army Knife -

- A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with: -

-
    -
  • Discord — use a Discord webhook URL
  • -
  • Slack — use a Slack incoming webhook URL
  • -
  • ntfy.sh — POST to https://ntfy.sh/your-topic
  • -
  • Pushover — POST to the Pushover API
  • -
  • Home Assistant — POST to an automation webhook URL
  • -
  • Anything else that accepts HTTP POST
  • -
-

- MeshAI doesn't need to know what's on the other end. Give it the URL and it works. -

-
- - {/* Commands */} - -

- All commands use the ! prefix (configurable). Send these as a direct message to MeshAI on your mesh. -

- - Basic Commands - !help, 'Shows all available commands'], - [!ping, 'Tests if the bot is alive'], - [!status, 'Quick mesh summary (nodes online, health score)'], - [!health, 'Detailed health report with pillar scores'], - [!weather, 'Current weather for your area'], - ]} - /> - - Environmental Commands - !alerts, 'Active NWS weather alerts for your area'], - [<>!solar (or !hf), 'Current solar indices and RF conditions'], - [!fire, 'Active wildfires near your mesh'], - [!avy, 'Avalanche advisory (seasonal — shows "off season" in summer)'], - [<>!streams (or !gauges), 'Stream gauge readings'], - [<>!roads (or !traffic), 'Road conditions and traffic flow'], - [!hotspots, 'Satellite fire detections'], - ]} - /> - - Subscription Commands - !subscribe, 'Lists all alert categories you can subscribe to'], - [!subscribe fire_proximity, 'Subscribe to a specific category'], - [!subscribe all, 'Subscribe to everything'], - [!unsubscribe fire_proximity, 'Unsubscribe from a category'], - [!subscriptions, "Shows what you're currently subscribed to"], - ]} - /> - - Conversational -

- 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. -

-
- - {/* API Reference */} - -

- MeshAI's REST API is available at http://your-host:8080. All endpoints return JSON. -

- - System -
    -
  • GET /api/status — version, uptime, node count
  • -
  • GET /api/channels — radio channel list
  • -
  • POST /api/restart — restart the bot
  • -
- - Mesh Data -
    -
  • GET /api/health — health score and pillars
  • -
  • GET /api/nodes — all nodes with positions and telemetry
  • -
  • GET /api/edges — neighbor links with signal quality
  • -
  • GET /api/regions — region summaries
  • -
  • GET /api/sources — data source health
  • -
- - Configuration -
    -
  • GET /api/config — full config
  • -
  • GET /api/config/{'{section}'} — one section
  • -
  • PUT /api/config/{'{section}'} — update a section
  • -
- - Environmental -
    -
  • GET /api/env/status — per-feed health
  • -
  • GET /api/env/active — all active events
  • -
  • GET /api/env/swpc — solar/geomagnetic data
  • -
  • GET /api/env/ducting — atmospheric profile
  • -
  • GET /api/env/fires — wildfire perimeters
  • -
  • GET /api/env/hotspots — satellite fire detections
  • -
- - Alerts -
    -
  • GET /api/alerts/active — current alerts
  • -
  • GET /api/alerts/history — past alerts
  • -
  • GET /api/notifications/categories — available alert categories
  • -
- - Real-time -
    -
  • ws://your-host:8080/ws/live — WebSocket for live updates
  • -
-
- -
-
-
- ) -} +import { useState, useEffect, useRef } from 'react' +import { useLocation } from 'react-router-dom' +import { + Search, Droplets, Flame, Satellite, CloudLightning, Sun, + Radio, Mountain, Car, Construction, Activity, Bell, Terminal, + Code, ExternalLink +} from 'lucide-react' + +// Topic definitions +const TOPICS = [ + { id: 'stream-gauges', label: 'Stream Gauges', icon: Droplets }, + { id: 'wildfire', label: 'Wildfire', icon: Flame }, + { id: 'firms', label: 'Satellite Fire Detection (FIRMS)', icon: Satellite }, + { id: 'weather-alerts', label: 'Weather Alerts', icon: CloudLightning }, + { id: 'solar', label: 'Solar & Geomagnetic', icon: Sun }, + { id: 'ducting', label: 'Tropospheric Ducting', icon: Radio }, + { id: 'avalanche', label: 'Avalanche Danger', icon: Mountain }, + { id: 'traffic', label: 'Traffic Flow', icon: Car }, + { id: 'roads-511', label: 'Road Conditions (511)', icon: Construction }, + { id: 'mesh-health', label: 'Mesh Health', icon: Activity }, + { id: 'notifications', label: 'Notifications', icon: Bell }, + { id: 'commands', label: 'Commands', icon: Terminal }, + { id: 'api', label: 'API Reference', icon: Code }, +] + +// Status indicator component for colored dots +function StatusDot({ color }: { color: 'green' | 'yellow' | 'orange' | 'red' | 'black' }) { + const colorClasses = { + 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 +} + +// Table component styled for dark theme +function RefTable({ headers, rows }: { headers: string[]; rows: (string | React.ReactNode)[][] }) { + return ( +
+ + + + {headers.map((h, i) => ( + + ))} + + + + {rows.map((row, i) => ( + + {row.map((cell, j) => ( + + ))} + + ))} + +
{h}
{cell}
+
+ ) +} + +// External link component +function ExtLink({ href, children }: { href: string; children: React.ReactNode }) { + return ( + + {children} + + ) +} + +// Section header +function SectionHeader({ children }: { children: React.ReactNode }) { + return

{children}

+} + +// Sub-header +function SubHeader({ children }: { children: React.ReactNode }) { + return

{children}

+} + +// Monospace text +function Mono({ children }: { children: React.ReactNode }) { + return {children} +} + +// Topic section wrapper +function TopicSection({ id, title, children }: { id: string; title: string; children: React.ReactNode }) { + return ( +
+

{title}

+
+ {children} +
+
+ ) +} + +export default function Reference() { + const location = useLocation() + const [searchQuery, setSearchQuery] = useState('') + const [activeTopic, setActiveTopic] = useState('stream-gauges') + const contentRef = useRef(null) + + // Handle hash navigation + useEffect(() => { + const hash = location.hash.replace('#', '') + if (hash && TOPICS.find(t => t.id === hash)) { + setActiveTopic(hash) + const element = document.getElementById(hash) + if (element) { + element.scrollIntoView({ behavior: 'smooth' }) + } + } + }, [location.hash]) + + // Filter topics by search + const filteredTopics = TOPICS.filter(t => + t.label.toLowerCase().includes(searchQuery.toLowerCase()) + ) + + const scrollToTopic = (topicId: string) => { + setActiveTopic(topicId) + const element = document.getElementById(topicId) + if (element) { + element.scrollIntoView({ behavior: 'smooth' }) + } + window.history.replaceState(null, '', `#${topicId}`) + } + + return ( +
+ {/* Topic sidebar */} + + + {/* Main content */} +
+
+

+ Everything you need to understand and configure MeshAI's monitoring and alerting systems. +

+ + {/* Stream Gauges */} + + What You're Looking At +

+ MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things: +

+

+ 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. +

+

+ 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: +

+
    +
  • A small creek: 50-200 CFS
  • +
  • A mid-size river: 1,000-5,000 CFS
  • +
  • A big river in spring runoff: 10,000+ CFS
  • +
+ + When Does It Flood? +

+ Flood levels are set by the 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. +

+

Action Stage — water is rising, time to start paying attention. Usually still inside the riverbanks.

+

Minor Flood — low-lying roads start getting water on them. NWS issues a Flood Advisory.

+

Moderate Flood — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning.

+

Major Flood — widespread flooding. Many people evacuating. Serious property damage.

+

+ 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. +

+ + Low Water / Drought +

+ 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. +

+ + Setting It Up +
    +
  1. Find your gauge at waterdata.usgs.gov/nwis
  2. +
  3. Copy the site number (like 13090500)
  4. +
  5. Add it in Config → Environmental → USGS
  6. +
  7. MeshAI auto-fills the gauge name and flood levels from NWS
  8. +
+

If NWS flood levels don't populate, your gauge may not have them. Set manual thresholds if you know your local conditions.

+ + Learn More +
    +
  • USGS Water Data — find gauges near you
  • +
  • NWS Water Prediction Service — flood forecasts and thresholds
  • +
  • Understanding Streamflow — USGS explainer
  • +
+
+ + {/* Wildfire */} + + What You're Looking At +

+ 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. +

+ + Fire Size — How Big Is It? + +

For reference, 1,000 acres is about 1.5 square miles.

+ + Containment — Is It Under Control? +

+ 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. +

+
    +
  • 0-30% — Essentially uncontrolled. The fire goes where it wants.
  • +
  • 50% — Good progress, but half the edge can still grow.
  • +
  • 80%+ — Well controlled. Major growth unlikely.
  • +
  • 100% — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."
  • +
+ + How Far Away Should I Worry? + Under 5 km (3 miles), <>Immediate threat. This is evacuation-order range. Embers can fly this far in wind.], + [<> 5-15 km (3-10 miles), <>Prepare. The fire could reach you in hours under bad conditions. Have a plan.], + [<> 15-30 km (10-20 miles), <>Watch. Smoke is likely. Wind shifts could change things fast.], + [<> Over 30 km (20 miles), <>Awareness. Keep an eye on it, but no immediate threat.], + ]} + /> +

+ 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. +

+ + Which Matters More — Size or Distance? +

+ 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. +

+ + Setting It Up +

+ Just configure your state code (like 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. +

+ + Learn More +
    +
  • InciWeb — detailed incident information
  • +
  • NIFC Fire Map — raw perimeter data
  • +
  • Ready.gov Wildfires — preparedness guide
  • +
+
+ + {/* FIRMS */} + + What You're Looking At +

+ 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. +

+

+ Why this matters: satellite hotspots show up 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. +

+ + Confidence — Is It Really a Fire? +

Each detection gets a confidence rating:

+ +

+ Recommendation: Set the filter to "Nominal + High." If you include "Low" you'll get alerts for every hot parking lot on a summer day. +

+ + FRP — How Intense Is It? +

FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":

+ +

Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms.

+ + New Ignition Detection +

+ MeshAI cross-references satellite hotspots against known NIFC fire perimeters. If a hotspot is NOT near any known fire, it gets flagged as a potential new ignition — maybe a new fire just started. These get elevated priority regardless of confidence level. +

+ + Timing +

+ Satellite data arrives 1-3 hours after the satellite passes overhead. Each location gets observed about 6 times per day across all satellites, so there are multi-hour gaps. This is not real-time — it's "pretty recent." +

+ + Getting an API Key +
    +
  1. Go to FIRMS API page
  2. +
  3. Click "Get MAP_KEY"
  4. +
  5. Register for a free Earthdata account
  6. +
  7. Your key arrives by email
  8. +
  9. Enter it in Config → Environmental → FIRMS
  10. +
+ + Learn More +
    +
  • FIRMS Fire Map — see hotspots on a map
  • +
  • FIRMS FAQ — how it works
  • +
+
+ + {/* Weather Alerts */} + + What You're Looking At +

+ MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories. +

+ + Alert Severity — How Serious Is It? + + + When Should I Act? (Urgency) + + + How Sure Are They? (Certainty) + + + These Are Separate Scales +

+ 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." +

+ + What Minimum Severity Should I Set? + 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'], + ]} + /> +

+ 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. +

+ + Finding Your NWS Zone +
    +
  1. Go to weather.gov
  2. +
  3. Enter your location
  4. +
  5. Find your zone code at NWS Zone Map
  6. +
  7. Zone codes look like: IDZ016, UTZ040, etc.
  8. +
+ + The User-Agent Field +

+ 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: +

+

(meshai, you@email.com)

+

No registration. No waiting. Just type it in.

+ + Learn More +
    +
  • NWS Active Alerts — see current alerts
  • +
  • NWS API Docs — technical details
  • +
+
+ + {/* Solar & Geomagnetic */} + + What You're Looking At +

+ 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. +

+ + Solar Flux Index (SFI) +

Think of SFI as a "how active is the sun" number. Higher = better for HF radio, but also higher risk of solar flares.

+ +

Quick rule: SFI above 90 and Kp below 4 = good day for HF radio.

+ + Kp Index +

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.

+ 5, <>Minor storm (G1). HF noticeably degraded. Aurora visible at high latitudes (~60°N).], + [6, <>Moderate storm (G2). HF getting rough. Aurora moving south (~55°N).], + [7, <>Strong storm (G3). HF unreliable for 1-2 days. Aurora at mid-latitudes.], + [8-9, <>Severe/Extreme storm. HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible.], + ]} + /> + + R / S / G Scales +

NOAA's shorthand for three types of space weather events:

+ R (Radio Blackouts) — from solar flares: +
    +
  • R1-R2: Brief HF disruption. You might not notice.
  • +
  • R3: HF goes out for about an hour on the sunlit side of Earth.
  • +
  • R4-R5: HF dead for hours. Serious.
  • +
+ S (Solar Radiation Storms) — from energetic particles: +
    +
  • Mostly affects polar regions and satellites
  • +
  • S3+: Polar HF goes out entirely
  • +
+ G (Geomagnetic Storms) — from solar wind disturbances: +
    +
  • Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9
  • +
+ + Bz — The Storm Predictor +

+ 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. +

+ +

Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips.

+ + Learn More +
    +
  • SWPC Space Weather Dashboard — live data
  • +
  • NOAA Space Weather Scales — what R/S/G mean
  • +
  • HamQSL Solar Page — ham-friendly display
  • +
  • Planetary K-Index — live Kp
  • +
+
+ + {/* Tropospheric Ducting */} + + What You're Looking At +

+ 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. +

+

+ MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area. +

+ + How Do I Know If Ducting Is Happening? +

MeshAI reports a "condition" based on the atmospheric profile:

+ + + What You'll Actually Notice +

When ducting happens on your mesh:

+
    +
  • Distant repeaters you've never heard suddenly come in
  • +
  • Nodes appear from far outside your normal range
  • +
  • You hear FM radio stations from other cities
  • +
  • ADS-B flight tracking range gets much longer
  • +
  • There might be interference from distant stations on your frequency
  • +
+ + The dM/dz Number +

The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:

+
    +
  • Around 118 = normal atmosphere
  • +
  • Below 79 = enhanced propagation starting
  • +
  • Below 0 (negative) = ducting is happening
  • +
  • Below -50 = strong ducting — classic VHF/UHF DX event
  • +
+ + When Does Ducting Happen? +
    +
  • Under high-pressure weather systems (clear, stable air)
  • +
  • When warm air sits on top of cool air (temperature inversion)
  • +
  • Most common in late summer and early fall
  • +
  • Strongest along coastlines and over water
  • +
  • In mountain valleys: cold air pooling in fall/winter can create surface ducts
  • +
+ + Setting It Up +

+ 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. +

+ + Learn More +
    +
  • Tropo Forecast Maps (Hepburn) — 6-day tropo prediction
  • +
  • DX Maps — real-time VHF/UHF propagation reports
  • +
  • Wikipedia: Tropospheric Propagation — background
  • +
+
+ + {/* Avalanche Danger */} + + What You're Looking At +

+ 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. +

+ + The Danger Scale + , 'Generally safe. Normal caution in steep terrain.'], + ['2', 'Moderate', , 'Be careful on specific terrain features. Evaluate conditions.'], + ['3', 'Considerable', , <>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', , <>Very dangerous. Stay off anything steep.], + ['5', 'Extreme', , <>Don't go out. Avalanches are happening on their own.], + ]} + /> + + The Most Important Thing to Know +

+ 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. +

+ + Seasonal +

+ MeshAI only checks avalanche conditions during winter months (configurable, default December through April). Outside season, it shows "off season" and saves API calls. +

+ + Finding Your Avalanche Center +

+ Go to avalanche.org/avalanche-centers/ for a map. Common center codes: +

+
    +
  • SNFAC — Sawtooth (central Idaho)
  • +
  • UAC — Utah
  • +
  • NWAC — Cascades/Olympics (WA/OR)
  • +
  • CAIC — Colorado
  • +
  • SAC — Sierra Nevada (CA)
  • +
  • GNFAC — Gallatin (SW Montana)
  • +
+ + Learn More +
    +
  • Avalanche.org — US forecasts
  • +
  • Avalanche Danger Scale — full scale explanation
  • +
  • Know Before You Go — avalanche awareness
  • +
+
+ + {/* Traffic Flow */} + + What You're Looking At +

+ MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed). +

+ + Speed Ratio — The Key Number +

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:

+ Above 85%, 'Normal. Traffic flowing fine.'], + [<> 65-85%, 'Slow. Heavier than usual but moving.'], + [<> 40-65%, 'Congested. Significant delays.'], + [<> Below 40%, 'Gridlock. Barely moving.'], + ]} + /> +

+ 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. +

+ + Confidence — Can You Trust the Data? +

TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:

+ Unreliable — mostly guessing from historical patterns. Don't alert on this.], + ]} + /> +

Set minimum confidence to 0.7 to avoid false congestion alerts at night or on rural roads where few probe vehicles drive.

+ + Setting Up Corridors +

Each "corridor" is a point on a road you want to monitor. To add one:

+
    +
  1. Go to Google Maps, find the road
  2. +
  3. Right-click the road → "What's here?" → copy the coordinates
  4. +
  5. Add the corridor in Config with a name and those coordinates
  6. +
  7. TomTom finds the nearest road segment automatically
  8. +
+ + Getting an API Key +
    +
  1. Sign up at developer.tomtom.com (free)
  2. +
  3. Create an app → get your API key
  4. +
  5. Free tier: 2,500 requests/day (plenty for 5-10 corridors)
  6. +
+ + Learn More +
    +
  • TomTom Developer Portal — API docs and key signup
  • +
  • TomTom Traffic Index — city congestion rankings
  • +
+
+ + {/* 511 Road Conditions */} + + What You're Looking At +

+ 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. +

+ + Setting It Up +

+ 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. +

+

Configure in Config → Environmental → 511:

+
    +
  • Base URL — your state's API endpoint
  • +
  • API Key — if required by your state
  • +
  • Endpoints — which data feeds to poll (varies by state)
  • +
+ + Learn More +

Check your state's 511 or DOT website for developer information.

+
+ + {/* Mesh Health */} + + Health Score +

MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:

+ Infrastructure, '30%', 'Are your routers online?'], + [Utilization, '25%', 'Is the radio channel congested?'], + [Coverage, '20%', 'Do nodes have redundant paths to gateways?'], + [Behavior, '15%', 'Are any nodes flooding the channel?'], + [Power, '10%', 'Are battery-powered nodes running low?'], + ]} + /> +

The overall score is the weighted sum:

+

+ Score = (Infrastructure × 30%) + (Utilization × 25%) + (Coverage × 20%) + (Behavior × 15%) + (Power × 10%) +

+ + How Each Pillar Is Calculated + + Infrastructure (30%) +

+ This is the simplest pillar — what percentage of your infrastructure nodes are currently online? +

+

+ (routers online ÷ total routers) × 100 +

+

+ Only nodes with the ROUTER, ROUTER_LATE, or 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. +

+

+ 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. +

+ + Utilization (25%) +

+ Estimates how much of the radio channel's airtime is being used. MeshAI can't measure airtime directly, so it estimates based on packet counts over the last 24 hours. +

+

+ packets_per_hour = non_text_packets ÷ 24
+ airtime_estimate = (packets_per_hour × 200ms) ÷ 3,600,000ms × 100% +

+

+ The 200ms is an approximation for the MediumFast radio preset — each LoRa packet takes roughly 200ms of airtime. Text messages don't count toward utilization (chatting is the point of a mesh). +

+ +

+ Special case: If MeshAI doesn't have packet data (no sources reporting packet counts), this pillar scores 100. You're not penalized for missing data. +

+ + Coverage (20%) +

+ 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. +

+

+ coverage_ratio = average_gateways_per_node ÷ total_sources
+ single_gw_penalty = (single_gateway_nodes ÷ total_nodes) × 40 +

+

+ 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. +

+ +

+ 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.). +

+ + Behavior (15%) +

+ 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. +

+

+ 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. +

+ +

+ A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar. +

+ + Power (10%) +

+ Measures what fraction of battery-powered nodes are below the warning threshold (default 20%). +

+

+ 100 × (1 − low_battery_nodes ÷ total_battery_nodes) +

+

+ If 2 out of 10 battery nodes are below 20%, power scores 80. +

+

+ 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. +

+ + Health Tiers + Healthy, "Everything's working well."], + ['75-89', <> Slight degradation, 'Some issues but the mesh is functional.'], + ['50-74', <> Unhealthy, 'Multiple problems. Reliability is affected.'], + ['25-49', <> Warning, 'Significant issues. The mesh is struggling.'], + ['0-24', <> Critical, 'Major failures. Barely functional.'], + ]} + /> + + Channel Utilization — Is the Radio Channel Full? +

+ Meshtastic radios share one LoRa channel. If too many nodes are transmitting too often, they step on each other and messages get lost. +

+ Under 25%, 'Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target.'], + [<> 25-40%, 'Getting busy. Common on larger meshes. Worth watching.'], + [<> 40-50%, 'Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying.'], + [<> Over 50%, 'Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast.'], + [<> Over 65%, 'Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable.'], + ]} + /> + + Packet Flooding +

+ ⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding. +

+

+ 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. +

+ + + Battery Levels +

+ Most Meshtastic radios (T-Beam, RAK4631, Heltec V3) use a single lithium battery cell. The voltage tells you how much charge is left: +

+ 3.60V, ~30%, <>⚠️ Warning — charge it soon], + [3.50V, ~15%, <>🔴 Low — charge it now], + [3.40V, ~7%, <>⚫ About to die], + ['3.30V', '~3%', 'Device shutting down'], + ]} + /> +

+ USB-powered nodes report 100% battery even if there's no battery installed. Battery alerts only matter for nodes actually running on battery power. +

+ + Node Offline Detection +

+ MeshAI marks a node as "offline" when it hasn't been heard for a configurable time period. Different node types need different thresholds: +

+ 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.'], + ]} + /> +

+ 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. +

+
+ + {/* Notifications */} + + How It Works +
    +
  1. Something happens — a fire is detected, weather warning issued, node goes offline, etc.
  2. +
  3. MeshAI checks your rules — does this event match any of your notification rules? Is it severe enough? Are we in quiet hours?
  4. +
  5. If a rule matches — MeshAI sends the notification through whatever delivery method that rule is configured for.
  6. +
+ + Building Rules +

Each rule answers three questions:

+
    +
  • WHEN does it trigger? (which categories, what severity)
  • +
  • WHERE does it send? (mesh broadcast, email, webhook, etc.)
  • +
  • HOW OFTEN at most? (cooldown period)
  • +
+

+ Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule." +

+ + Severity Levels — What Should I Set? + 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'], + ]} + /> +

+ "Warning" is the sweet spot for most rules. You get alerted when something actually needs your attention without being overwhelmed by every minor event. +

+ + Quiet Hours +

+ When enabled, non-emergency notifications are held during sleeping hours (default 10pm-6am). Emergency alerts and rules marked "Override Quiet Hours" always get through. +

+

You can turn quiet hours off entirely if you don't want them.

+ + Webhook — The Swiss Army Knife +

+ A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with: +

+
    +
  • Discord — use a Discord webhook URL
  • +
  • Slack — use a Slack incoming webhook URL
  • +
  • ntfy.sh — POST to https://ntfy.sh/your-topic
  • +
  • Pushover — POST to the Pushover API
  • +
  • Home Assistant — POST to an automation webhook URL
  • +
  • Anything else that accepts HTTP POST
  • +
+

+ MeshAI doesn't need to know what's on the other end. Give it the URL and it works. +

+
+ + {/* Commands */} + +

+ All commands use the ! prefix (configurable). Send these as a direct message to MeshAI on your mesh. +

+ + Basic Commands + !help, 'Shows all available commands'], + [!ping, 'Tests if the bot is alive'], + [!status, 'Quick mesh summary (nodes online, health score)'], + [!health, 'Detailed health report with pillar scores'], + [!weather, 'Current weather for your area'], + ]} + /> + + Environmental Commands + !alerts, 'Active NWS weather alerts for your area'], + [<>!solar (or !hf), 'Current solar indices and RF conditions'], + [!fire, 'Active wildfires near your mesh'], + [!avy, 'Avalanche advisory (seasonal — shows "off season" in summer)'], + [<>!streams (or !gauges), 'Stream gauge readings'], + [<>!roads (or !traffic), 'Road conditions and traffic flow'], + [!hotspots, 'Satellite fire detections'], + ]} + /> + + Subscription Commands + !subscribe, 'Lists all alert categories you can subscribe to'], + [!subscribe fire_proximity, 'Subscribe to a specific category'], + [!subscribe all, 'Subscribe to everything'], + [!unsubscribe fire_proximity, 'Unsubscribe from a category'], + [!subscriptions, "Shows what you're currently subscribed to"], + ]} + /> + + Conversational +

+ 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. +

+
+ + {/* API Reference */} + +

+ MeshAI's REST API is available at http://your-host:8080. All endpoints return JSON. +

+ + System +
    +
  • GET /api/status — version, uptime, node count
  • +
  • GET /api/channels — radio channel list
  • +
  • POST /api/restart — restart the bot
  • +
+ + Mesh Data +
    +
  • GET /api/health — health score and pillars
  • +
  • GET /api/nodes — all nodes with positions and telemetry
  • +
  • GET /api/edges — neighbor links with signal quality
  • +
  • GET /api/regions — region summaries
  • +
  • GET /api/sources — data source health
  • +
+ + Configuration +
    +
  • GET /api/config — full config
  • +
  • GET /api/config/{'{section}'} — one section
  • +
  • PUT /api/config/{'{section}'} — update a section
  • +
+ + Environmental +
    +
  • GET /api/env/status — per-feed health
  • +
  • GET /api/env/active — all active events
  • +
  • GET /api/env/swpc — solar/geomagnetic data
  • +
  • GET /api/env/ducting — atmospheric profile
  • +
  • GET /api/env/fires — wildfire perimeters
  • +
  • GET /api/env/hotspots — satellite fire detections
  • +
+ + Alerts +
    +
  • GET /api/alerts/active — current alerts
  • +
  • GET /api/alerts/history — past alerts
  • +
  • GET /api/notifications/categories — available alert categories
  • +
+ + Real-time +
    +
  • ws://your-host:8080/ws/live — WebSocket for live updates
  • +
+
+ +
+
+
+ ) +} diff --git a/meshai/dashboard/static/assets/index-Dc67XxQ3.js b/meshai/dashboard/static/assets/index-CmwrG05d.js similarity index 66% rename from meshai/dashboard/static/assets/index-Dc67XxQ3.js rename to meshai/dashboard/static/assets/index-CmwrG05d.js index c412e8a..d541e6a 100644 --- a/meshai/dashboard/static/assets/index-Dc67XxQ3.js +++ b/meshai/dashboard/static/assets/index-CmwrG05d.js @@ -1,4 +1,4 @@ -function uoe(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 ig=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 GU={exports:{}},nS={},WU={exports:{}},yt={};/** +function uoe(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 ag=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var GU={exports:{}},iS={},WU={exports:{}},yt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function uoe(e,t){for(var r=0;r>>1,Z=z[Y];if(0>>1;Yi(ce,H))gei(Ge,ce)?(z[Y]=Ge,z[ge]=H,Y=ge):(z[Y]=ce,z[ae]=H,Y=ae);else if(gei(Ge,H))z[Y]=Ge,z[ge]=H,Y=ge;else break e}}return U}function i(z,U){var H=z.sortIndex-U.sortIndex;return H!==0?H:z.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,x=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(z){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=z)n(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=r(u)}}function S(z){if(g=!1,b(z),!v)if(r(l)!==null)v=!0,F(T);else{var U=r(u);U!==null&&G(S,U.startTime-z)}}function T(z,U){v=!1,g&&(g=!1,y(P),P=-1),d=!0;var H=h;try{for(b(U),f=r(l);f!==null&&(!(f.expirationTime>U)||z&&!O());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,h=f.priorityLevel;var Z=Y(f.expirationTime<=U);U=e.unstable_now(),typeof Z=="function"?f.callback=Z:f===r(l)&&n(l),b(U)}else n(l);f=r(l)}if(f!==null)var J=!0;else{var ae=r(u);ae!==null&&G(S,ae.startTime-U),J=!1}return J}finally{f=null,h=H,d=!1}}var A=!1,M=null,P=-1,k=5,I=-1;function O(){return!(e.unstable_now()-Iz||125Y?(z.sortIndex=H,t(u,z),r(l)===null&&z===r(u)&&(g?(y(P),P=-1):g=!0,G(S,H-Y))):(z.sortIndex=Z,t(l,z),v||d||(v=!0,F(T))),z},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(z){var U=h;return function(){var H=h;h=U;try{return z.apply(this,arguments)}finally{h=H}}}})(r7);t7.exports=r7;var Ooe=t7.exports;/** + */(function(e){function t(z,U){var H=z.length;z.push(U);e:for(;0>>1,Z=z[Y];if(0>>1;Yi(ce,H))gei(We,ce)?(z[Y]=We,z[ge]=H,Y=ge):(z[Y]=ce,z[ae]=H,Y=ae);else if(gei(We,H))z[Y]=We,z[ge]=H,Y=ge;else break e}}return U}function i(z,U){var H=z.sortIndex-U.sortIndex;return H!==0?H:z.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(z){for(var U=r(u);U!==null;){if(U.callback===null)n(u);else if(U.startTime<=z)n(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=r(u)}}function S(z){if(g=!1,b(z),!v)if(r(l)!==null)v=!0,F(T);else{var U=r(u);U!==null&&G(S,U.startTime-z)}}function T(z,U){v=!1,g&&(g=!1,y(P),P=-1),d=!0;var H=h;try{for(b(U),f=r(l);f!==null&&(!(f.expirationTime>U)||z&&!O());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,h=f.priorityLevel;var Z=Y(f.expirationTime<=U);U=e.unstable_now(),typeof Z=="function"?f.callback=Z:f===r(l)&&n(l),b(U)}else n(l);f=r(l)}if(f!==null)var J=!0;else{var ae=r(u);ae!==null&&G(S,ae.startTime-U),J=!1}return J}finally{f=null,h=H,d=!1}}var A=!1,M=null,P=-1,k=5,I=-1;function O(){return!(e.unstable_now()-Iz||125Y?(z.sortIndex=H,t(u,z),r(l)===null&&z===r(u)&&(g?(y(P),P=-1):g=!0,G(S,H-Y))):(z.sortIndex=Z,t(l,z),v||d||(v=!0,F(T))),z},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(z){var U=h;return function(){var H=h;h=U;try{return z.apply(this,arguments)}finally{h=H}}}})(r7);t7.exports=r7;var Ooe=t7.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function uoe(e,t){for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oP=Object.prototype.hasOwnProperty,Doe=/^[: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]*$/,H5={},U5={};function Noe(e){return oP.call(U5,e)?!0:oP.call(H5,e)?!1:Doe.test(e)?U5[e]=!0:(H5[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 Roe(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 qn(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 yn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){yn[e]=new qn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];yn[t]=new qn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){yn[e]=new qn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){yn[e]=new qn(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){yn[e]=new qn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){yn[e]=new qn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){yn[e]=new qn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){yn[e]=new qn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){yn[e]=new qn(e,5,!1,e.toLowerCase(),null,!1,!1)});var HO=/[\-:]([a-z])/g;function UO(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(HO,UO);yn[t]=new qn(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(HO,UO);yn[t]=new qn(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(HO,UO);yn[t]=new qn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){yn[e]=new qn(e,1,!1,e.toLowerCase(),null,!1,!1)});yn.xlinkHref=new qn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){yn[e]=new qn(e,1,!1,e.toLowerCase(),null,!0,!0)});function ZO(e,t,r,n){var i=yn.hasOwnProperty(t)?yn[t]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oP=Object.prototype.hasOwnProperty,Doe=/^[: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]*$/,H5={},U5={};function Noe(e){return oP.call(U5,e)?!0:oP.call(H5,e)?!1:Doe.test(e)?U5[e]=!0:(H5[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 Roe(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 qn(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 yn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){yn[e]=new qn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];yn[t]=new qn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){yn[e]=new qn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){yn[e]=new qn(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){yn[e]=new qn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){yn[e]=new qn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){yn[e]=new qn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){yn[e]=new qn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){yn[e]=new qn(e,5,!1,e.toLowerCase(),null,!1,!1)});var HO=/[\-:]([a-z])/g;function UO(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(HO,UO);yn[t]=new qn(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(HO,UO);yn[t]=new qn(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(HO,UO);yn[t]=new qn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){yn[e]=new qn(e,1,!1,e.toLowerCase(),null,!1,!1)});yn.xlinkHref=new qn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){yn[e]=new qn(e,1,!1,e.toLowerCase(),null,!0,!0)});function ZO(e,t,r,n){var i=yn.hasOwnProperty(t)?yn[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{LA=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ag(e):""}function Boe(e){switch(e.tag){case 5:return ag(e.type);case 16:return ag("Lazy");case 13:return ag("Suspense");case 19:return ag("SuspenseList");case 0:case 2:case 15:return e=kA(e.type,!1),e;case 11:return e=kA(e.type.render,!1),e;case 1:return e=kA(e.type,!0),e;default:return""}}function cP(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 Sh:return"Fragment";case wh:return"Portal";case sP:return"Profiler";case YO:return"StrictMode";case lP:return"Suspense";case uP:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a7:return(e.displayName||"Context")+".Consumer";case i7:return(e._context.displayName||"Context")+".Provider";case XO:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qO:return t=e.displayName||null,t!==null?t:cP(e.type)||"Memo";case vl:t=e._payload,e=e._init;try{return cP(e(t))}catch{}}return null}function zoe(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 cP(t);case 8:return t===YO?"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 Ql(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 $oe(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 W0(e){e._valueTracker||(e._valueTracker=$oe(e))}function l7(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 gb(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 fP(e,t){var r=t.checked;return cr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Y5(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ql(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 u7(e,t){t=t.checked,t!=null&&ZO(e,"checked",t,!1)}function hP(e,t){u7(e,t);var r=Ql(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")?dP(e,t.type,r):t.hasOwnProperty("defaultValue")&&dP(e,t.type,Ql(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function X5(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 dP(e,t,r){(t!=="number"||gb(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var og=Array.isArray;function Hh(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=H0.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function tm(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Sg={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},Foe=["Webkit","ms","Moz","O"];Object.keys(Sg).forEach(function(e){Foe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Sg[t]=Sg[e]})});function d7(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Sg.hasOwnProperty(e)&&Sg[e]?(""+t).trim():t+"px"}function v7(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=d7(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var Voe=cr({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 gP(e,t){if(t){if(Voe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function mP(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 yP=null;function KO(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xP=null,Uh=null,Zh=null;function Q5(e){if(e=$y(e)){if(typeof xP!="function")throw Error(me(280));var t=e.stateNode;t&&(t=lS(t),xP(e.stateNode,e.type,t))}}function p7(e){Uh?Zh?Zh.push(e):Zh=[e]:Uh=e}function g7(){if(Uh){var e=Uh,t=Zh;if(Zh=Uh=null,Q5(e),t)for(e=0;e>>=0,e===0?32:31-(Joe(e)/ese|0)|0}var U0=64,Z0=4194304;function sg(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 _b(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=sg(s):(a&=o,a!==0&&(n=sg(a)))}else o=r&~i,o!==0?n=sg(o):a!==0&&(n=sg(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 By(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-za(t),e[t]=r}function ise(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=Ag),sB=" ",lB=!1;function j7(e,t){switch(e){case"keyup":return Ose.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function R7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Th=!1;function Dse(e,t){switch(e){case"compositionend":return R7(t);case"keypress":return t.which!==32?null:(lB=!0,sB);case"textInput":return e=t.data,e===sB&&lB?null:e;default:return null}}function Nse(e,t){if(Th)return e==="compositionend"||!aE&&j7(e,t)?(e=D7(),z_=rE=bl=null,Th=!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=hB(r)}}function F7(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F7(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function V7(){for(var e=window,t=gb();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=gb(e.document)}return t}function oE(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 Wse(e){var t=V7(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&F7(r.ownerDocument.documentElement,r)){if(n!==null&&oE(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=dB(r,a);var o=dB(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,Ah=null,AP=null,Mg=null,CP=!1;function vB(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;CP||Ah==null||Ah!==gb(n)||(n=Ah,"selectionStart"in n&&oE(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}),Mg&&sm(Mg,n)||(Mg=n,n=Sb(AP,"onSelect"),0Ph||(e.current=OP[Ph],OP[Ph]=null,Ph--)}function Zt(e,t){Ph++,OP[Ph]=e.current,e.current=t}var Jl={},Nn=lu(Jl),li=lu(!1),Vc=Jl;function cd(e,t){var r=e.type.contextTypes;if(!r)return Jl;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 ui(e){return e=e.childContextTypes,e!=null}function Ab(){Jt(li),Jt(Nn)}function bB(e,t,r){if(Nn.current!==Jl)throw Error(me(168));Zt(Nn,t),Zt(li,r)}function K7(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(me(108,zoe(e)||"Unknown",i));return cr({},r,n)}function Cb(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jl,Vc=Nn.current,Zt(Nn,e),Zt(li,li.current),!0}function wB(e,t,r){var n=e.stateNode;if(!n)throw Error(me(169));r?(e=K7(e,t,Vc),n.__reactInternalMemoizedMergedChildContext=e,Jt(li),Jt(Nn),Zt(Nn,e)):Jt(li),Zt(li,r)}var us=null,uS=!1,WA=!1;function Q7(e){us===null?us=[e]:us.push(e)}function rle(e){uS=!0,Q7(e)}function uu(){if(!WA&&us!==null){WA=!0;var e=0,t=Dt;try{var r=us;for(Dt=1;e>=o,i-=o,fs=1<<32-za(t)+i|r<P?(k=M,M=null):k=M.sibling;var I=h(y,M,b[P],S);if(I===null){M===null&&(M=k);break}e&&M&&I.alternate===null&&t(y,M),x=a(I,x,P),A===null?T=I:A.sibling=I,A=I,M=k}if(P===b.length)return r(y,M),er&&Ju(y,P),T;if(M===null){for(;PP?(k=M,M=null):k=M.sibling;var O=h(y,M,I.value,S);if(O===null){M===null&&(M=k);break}e&&M&&O.alternate===null&&t(y,M),x=a(O,x,P),A===null?T=O:A.sibling=O,A=O,M=k}if(I.done)return r(y,M),er&&Ju(y,P),T;if(M===null){for(;!I.done;P++,I=b.next())I=f(y,I.value,S),I!==null&&(x=a(I,x,P),A===null?T=I:A.sibling=I,A=I);return er&&Ju(y,P),T}for(M=n(y,M);!I.done;P++,I=b.next())I=d(M,y,P,I.value,S),I!==null&&(e&&I.alternate!==null&&M.delete(I.key===null?P:I.key),x=a(I,x,P),A===null?T=I:A.sibling=I,A=I);return e&&M.forEach(function(D){return t(y,D)}),er&&Ju(y,P),T}function m(y,x,b,S){if(typeof b=="object"&&b!==null&&b.type===Sh&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case G0:e:{for(var T=b.key,A=x;A!==null;){if(A.key===T){if(T=b.type,T===Sh){if(A.tag===7){r(y,A.sibling),x=i(A,b.props.children),x.return=y,y=x;break e}}else if(A.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===vl&&AB(T)===A.type){r(y,A.sibling),x=i(A,b.props),x.ref=dp(y,A,b),x.return=y,y=x;break e}r(y,A);break}else t(y,A);A=A.sibling}b.type===Sh?(x=kc(b.props.children,y.mode,S,b.key),x.return=y,y=x):(S=Z_(b.type,b.key,b.props,null,y.mode,S),S.ref=dp(y,x,b),S.return=y,y=S)}return o(y);case wh:e:{for(A=b.key;x!==null;){if(x.key===A)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){r(y,x.sibling),x=i(x,b.children||[]),x.return=y,y=x;break e}else{r(y,x);break}else t(y,x);x=x.sibling}x=QA(b,y.mode,S),x.return=y,y=x}return o(y);case vl:return A=b._init,m(y,x,A(b._payload),S)}if(og(b))return v(y,x,b,S);if(lp(b))return g(y,x,b,S);ex(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(r(y,x.sibling),x=i(x,b),x.return=y,y=x):(r(y,x),x=KA(b,y.mode,S),x.return=y,y=x),o(y)):r(y,x)}return m}var hd=r9(!0),n9=r9(!1),Lb=lu(null),kb=null,Ih=null,cE=null;function fE(){cE=Ih=kb=null}function hE(e){var t=Lb.current;Jt(Lb),e._currentValue=t}function NP(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 Xh(e,t){kb=e,cE=Ih=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(oi=!0),e.firstContext=null)}function ua(e){var t=e._currentValue;if(cE!==e)if(e={context:e,memoizedValue:t,next:null},Ih===null){if(kb===null)throw Error(me(308));Ih=e,kb.dependencies={lanes:0,firstContext:e}}else Ih=Ih.next=e;return t}var pc=null;function dE(e){pc===null?pc=[e]:pc.push(e)}function i9(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,dE(t)):(r.next=i.next,i.next=r),t.interleaved=r,Os(e,n)}function Os(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 pl=!1;function vE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function a9(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 _s(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Rl(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,wt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Os(e,r)}return i=n.interleaved,i===null?(t.next=t,dE(n)):(t.next=i.next,i.next=t),n.interleaved=t,Os(e,r)}function F_(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,JO(e,r)}}function CB(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 Ib(e,t,r,n){var i=e.updateQueue;pl=!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=cr({},f,h);break e;case 2:pl=!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);Hc|=o,e.lanes=o,e.memoizedState=f}}function MB(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=UA.transition;UA.transition={};try{e(!1),t()}finally{Dt=r,UA.transition=n}}function w9(){return ca().memoizedState}function ole(e,t,r){var n=zl(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},S9(e))T9(t,r);else if(r=i9(e,t,r,n),r!==null){var i=Wn();$a(r,e,n,i),A9(r,t,n)}}function sle(e,t,r){var n=zl(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(S9(e))T9(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,Ha(s,o)){var l=t.interleaved;l===null?(i.next=i,dE(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=i9(e,t,i,n),r!==null&&(i=Wn(),$a(r,e,n,i),A9(r,t,n))}}function S9(e){var t=e.alternate;return e===sr||t!==null&&t===sr}function T9(e,t){Pg=Eb=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function A9(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,JO(e,r)}}var Db={readContext:ua,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useInsertionEffect:Sn,useLayoutEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useMutableSource:Sn,useSyncExternalStore:Sn,useId:Sn,unstable_isNewReconciler:!1},lle={readContext:ua,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:ua,useEffect:LB,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,G_(4194308,4,m9.bind(null,t,e),r)},useLayoutEffect:function(e,t){return G_(4194308,4,e,t)},useInsertionEffect:function(e,t){return G_(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();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=ole.bind(null,sr,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:PB,useDebugValue:wE,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=PB(!1),t=e[0];return e=ale.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=sr,i=ho();if(er){if(r===void 0)throw Error(me(407));r=r()}else{if(r=t(),an===null)throw Error(me(349));Wc&30||u9(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,LB(f9.bind(null,n,a,e),[e]),n.flags|=2048,pm(9,c9.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ho(),t=an.identifierPrefix;if(er){var r=hs,n=fs;r=(n&~(1<<32-za(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=dm++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{kA=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?og(e):""}function Boe(e){switch(e.tag){case 5:return og(e.type);case 16:return og("Lazy");case 13:return og("Suspense");case 19:return og("SuspenseList");case 0:case 2:case 15:return e=IA(e.type,!1),e;case 11:return e=IA(e.type.render,!1),e;case 1:return e=IA(e.type,!0),e;default:return""}}function cP(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 Th:return"Fragment";case Sh:return"Portal";case sP:return"Profiler";case YO:return"StrictMode";case lP:return"Suspense";case uP:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a7:return(e.displayName||"Context")+".Consumer";case i7:return(e._context.displayName||"Context")+".Provider";case XO:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qO:return t=e.displayName||null,t!==null?t:cP(e.type)||"Memo";case pl:t=e._payload,e=e._init;try{return cP(e(t))}catch{}}return null}function zoe(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 cP(t);case 8:return t===YO?"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 Jl(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 $oe(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 H0(e){e._valueTracker||(e._valueTracker=$oe(e))}function l7(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 fP(e,t){var r=t.checked;return cr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Y5(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Jl(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 u7(e,t){t=t.checked,t!=null&&ZO(e,"checked",t,!1)}function hP(e,t){u7(e,t);var r=Jl(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")?dP(e,t.type,r):t.hasOwnProperty("defaultValue")&&dP(e,t.type,Jl(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function X5(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 dP(e,t,r){(t!=="number"||mb(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var sg=Array.isArray;function Uh(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=U0.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rm(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Tg={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},Foe=["Webkit","ms","Moz","O"];Object.keys(Tg).forEach(function(e){Foe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tg[t]=Tg[e]})});function d7(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Tg.hasOwnProperty(e)&&Tg[e]?(""+t).trim():t+"px"}function v7(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=d7(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var Voe=cr({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 gP(e,t){if(t){if(Voe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function mP(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 yP=null;function KO(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xP=null,Zh=null,Yh=null;function Q5(e){if(e=Fy(e)){if(typeof xP!="function")throw Error(me(280));var t=e.stateNode;t&&(t=uS(t),xP(e.stateNode,e.type,t))}}function p7(e){Zh?Yh?Yh.push(e):Yh=[e]:Zh=e}function g7(){if(Zh){var e=Zh,t=Yh;if(Yh=Zh=null,Q5(e),t)for(e=0;e>>=0,e===0?32:31-(Joe(e)/ese|0)|0}var Z0=64,Y0=4194304;function lg(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 bb(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=lg(s):(a&=o,a!==0&&(n=lg(a)))}else o=r&~i,o!==0?n=lg(o):a!==0&&(n=lg(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-za(t),e[t]=r}function ise(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=Cg),sB=" ",lB=!1;function j7(e,t){switch(e){case"keyup":return Ose.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function R7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ah=!1;function Dse(e,t){switch(e){case"compositionend":return R7(t);case"keypress":return t.which!==32?null:(lB=!0,sB);case"textInput":return e=t.data,e===sB&&lB?null:e;default:return null}}function Nse(e,t){if(Ah)return e==="compositionend"||!aE&&j7(e,t)?(e=D7(),$_=rE=wl=null,Ah=!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=hB(r)}}function F7(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F7(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function V7(){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 oE(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 Wse(e){var t=V7(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&F7(r.ownerDocument.documentElement,r)){if(n!==null&&oE(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=dB(r,a);var o=dB(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,Ch=null,AP=null,Pg=null,CP=!1;function vB(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;CP||Ch==null||Ch!==mb(n)||(n=Ch,"selectionStart"in n&&oE(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}),Pg&&lm(Pg,n)||(Pg=n,n=Tb(AP,"onSelect"),0Lh||(e.current=OP[Lh],OP[Lh]=null,Lh--)}function Yt(e,t){Lh++,OP[Lh]=e.current,e.current=t}var eu={},Nn=uu(eu),li=uu(!1),Gc=eu;function fd(e,t){var r=e.type.contextTypes;if(!r)return eu;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 ui(e){return e=e.childContextTypes,e!=null}function Cb(){Jt(li),Jt(Nn)}function bB(e,t,r){if(Nn.current!==eu)throw Error(me(168));Yt(Nn,t),Yt(li,r)}function K7(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(me(108,zoe(e)||"Unknown",i));return cr({},r,n)}function Mb(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||eu,Gc=Nn.current,Yt(Nn,e),Yt(li,li.current),!0}function wB(e,t,r){var n=e.stateNode;if(!n)throw Error(me(169));r?(e=K7(e,t,Gc),n.__reactInternalMemoizedMergedChildContext=e,Jt(li),Jt(Nn),Yt(Nn,e)):Jt(li),Yt(li,r)}var us=null,cS=!1,HA=!1;function Q7(e){us===null?us=[e]:us.push(e)}function rle(e){cS=!0,Q7(e)}function cu(){if(!HA&&us!==null){HA=!0;var e=0,t=Dt;try{var r=us;for(Dt=1;e>=o,i-=o,fs=1<<32-za(t)+i|r<P?(k=M,M=null):k=M.sibling;var I=h(y,M,b[P],S);if(I===null){M===null&&(M=k);break}e&&M&&I.alternate===null&&t(y,M),_=a(I,_,P),A===null?T=I:A.sibling=I,A=I,M=k}if(P===b.length)return r(y,M),er&&ec(y,P),T;if(M===null){for(;PP?(k=M,M=null):k=M.sibling;var O=h(y,M,I.value,S);if(O===null){M===null&&(M=k);break}e&&M&&O.alternate===null&&t(y,M),_=a(O,_,P),A===null?T=O:A.sibling=O,A=O,M=k}if(I.done)return r(y,M),er&&ec(y,P),T;if(M===null){for(;!I.done;P++,I=b.next())I=f(y,I.value,S),I!==null&&(_=a(I,_,P),A===null?T=I:A.sibling=I,A=I);return er&&ec(y,P),T}for(M=n(y,M);!I.done;P++,I=b.next())I=d(M,y,P,I.value,S),I!==null&&(e&&I.alternate!==null&&M.delete(I.key===null?P:I.key),_=a(I,_,P),A===null?T=I:A.sibling=I,A=I);return e&&M.forEach(function(D){return t(y,D)}),er&&ec(y,P),T}function m(y,_,b,S){if(typeof b=="object"&&b!==null&&b.type===Th&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case W0:e:{for(var T=b.key,A=_;A!==null;){if(A.key===T){if(T=b.type,T===Th){if(A.tag===7){r(y,A.sibling),_=i(A,b.props.children),_.return=y,y=_;break e}}else if(A.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===pl&&AB(T)===A.type){r(y,A.sibling),_=i(A,b.props),_.ref=vp(y,A,b),_.return=y,y=_;break e}r(y,A);break}else t(y,A);A=A.sibling}b.type===Th?(_=Ic(b.props.children,y.mode,S,b.key),_.return=y,y=_):(S=Y_(b.type,b.key,b.props,null,y.mode,S),S.ref=vp(y,_,b),S.return=y,y=S)}return o(y);case Sh:e:{for(A=b.key;_!==null;){if(_.key===A)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}_=JA(b,y.mode,S),_.return=y,y=_}return o(y);case pl:return A=b._init,m(y,_,A(b._payload),S)}if(sg(b))return v(y,_,b,S);if(up(b))return g(y,_,b,S);tx(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,_),_=QA(b,y.mode,S),_.return=y,y=_),o(y)):r(y,_)}return m}var dd=r9(!0),n9=r9(!1),kb=uu(null),Ib=null,Oh=null,cE=null;function fE(){cE=Oh=Ib=null}function hE(e){var t=kb.current;Jt(kb),e._currentValue=t}function NP(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 qh(e,t){Ib=e,cE=Oh=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(oi=!0),e.firstContext=null)}function ua(e){var t=e._currentValue;if(cE!==e)if(e={context:e,memoizedValue:t,next:null},Oh===null){if(Ib===null)throw Error(me(308));Oh=e,Ib.dependencies={lanes:0,firstContext:e}}else Oh=Oh.next=e;return t}var gc=null;function dE(e){gc===null?gc=[e]:gc.push(e)}function i9(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,dE(t)):(r.next=i.next,i.next=r),t.interleaved=r,Os(e,n)}function Os(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 gl=!1;function vE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function a9(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 _s(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bl(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,wt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Os(e,r)}return i=n.interleaved,i===null?(t.next=t,dE(n)):(t.next=i.next,i.next=t),n.interleaved=t,Os(e,r)}function V_(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,JO(e,r)}}function CB(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 Ob(e,t,r,n){var i=e.updateQueue;gl=!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=cr({},f,h);break e;case 2:gl=!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);Uc|=o,e.lanes=o,e.memoizedState=f}}function MB(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=ZA.transition;ZA.transition={};try{e(!1),t()}finally{Dt=r,ZA.transition=n}}function w9(){return ca().memoizedState}function ole(e,t,r){var n=$l(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},S9(e))T9(t,r);else if(r=i9(e,t,r,n),r!==null){var i=Wn();$a(r,e,n,i),A9(r,t,n)}}function sle(e,t,r){var n=$l(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(S9(e))T9(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,Ha(s,o)){var l=t.interleaved;l===null?(i.next=i,dE(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=i9(e,t,i,n),r!==null&&(i=Wn(),$a(r,e,n,i),A9(r,t,n))}}function S9(e){var t=e.alternate;return e===sr||t!==null&&t===sr}function T9(e,t){Lg=Db=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function A9(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,JO(e,r)}}var Nb={readContext:ua,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useInsertionEffect:Sn,useLayoutEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useMutableSource:Sn,useSyncExternalStore:Sn,useId:Sn,unstable_isNewReconciler:!1},lle={readContext:ua,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:ua,useEffect:LB,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,W_(4194308,4,m9.bind(null,t,e),r)},useLayoutEffect:function(e,t){return W_(4194308,4,e,t)},useInsertionEffect:function(e,t){return W_(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();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=ole.bind(null,sr,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:PB,useDebugValue:wE,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=PB(!1),t=e[0];return e=ale.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=sr,i=ho();if(er){if(r===void 0)throw Error(me(407));r=r()}else{if(r=t(),an===null)throw Error(me(349));Hc&30||u9(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,LB(f9.bind(null,n,a,e),[e]),n.flags|=2048,gm(9,c9.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ho(),t=an.identifierPrefix;if(er){var r=hs,n=fs;r=(n&~(1<<32-za(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=vm++,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[po]=t,e[cm]=n,N9(e,t,!1,!1),t.stateNode=e;e:{switch(o=mP(r,n),r){case"dialog":qt("cancel",e),qt("close",e),i=n;break;case"iframe":case"object":case"embed":qt("load",e),i=n;break;case"video":case"audio":for(i=0;ipd&&(t.flags|=128,n=!0,vp(a,!1),t.lanes=4194304)}else{if(!n)if(e=Ob(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),vp(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!er)return Tn(t),null}else 2*wr()-a.renderingStartTime>pd&&r!==1073741824&&(t.flags|=128,n=!0,vp(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=or.current,Zt(or,n?r&1|2:r&1),t):(Tn(t),null);case 22:case 23:return PE(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?yi&1073741824&&(Tn(t),t.subtreeFlags&6&&(t.flags|=8192)):Tn(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function gle(e,t){switch(lE(t),t.tag){case 1:return ui(t.type)&&Ab(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dd(),Jt(li),Jt(Nn),mE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gE(t),null;case 13:if(Jt(or),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));fd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jt(or),null;case 4:return dd(),null;case 10:return hE(t.type._context),null;case 22:case 23:return PE(),null;case 24:return null;default:return null}}var rx=!1,kn=!1,mle=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Oh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){dr(e,t,n)}else r.current=null}function WP(e,t,r){try{r()}catch(n){dr(e,t,n)}}var $B=!1;function yle(e,t){if(MP=bb,e=V7(),oE(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(PP={focusedElem:e,selectionRange:r},bb=!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,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:La(t.type,g),m);y.__reactInternalSnapshotBeforeUpdate=x}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(me(163))}}catch(S){dr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return v=$B,$B=!1,v}function Lg(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&&WP(t,r,a)}i=i.next}while(i!==n)}}function hS(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 HP(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 B9(e){var t=e.alternate;t!==null&&(e.alternate=null,B9(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[po],delete t[cm],delete t[IP],delete t[ele],delete t[tle])),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 z9(e){return e.tag===5||e.tag===3||e.tag===4}function FB(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||z9(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 UP(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=Tb));else if(n!==4&&(e=e.child,e!==null))for(UP(e,t,r),e=e.sibling;e!==null;)UP(e,t,r),e=e.sibling}function ZP(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(ZP(e,t,r),e=e.sibling;e!==null;)ZP(e,t,r),e=e.sibling}var fn=null,Ia=!1;function tl(e,t,r){for(r=r.child;r!==null;)$9(e,t,r),r=r.sibling}function $9(e,t,r){if(Mo&&typeof Mo.onCommitFiberUnmount=="function")try{Mo.onCommitFiberUnmount(iS,r)}catch{}switch(r.tag){case 5:kn||Oh(r,t);case 6:var n=fn,i=Ia;fn=null,tl(e,t,r),fn=n,Ia=i,fn!==null&&(Ia?(e=fn,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):fn.removeChild(r.stateNode));break;case 18:fn!==null&&(Ia?(e=fn,r=r.stateNode,e.nodeType===8?GA(e.parentNode,r):e.nodeType===1&&GA(e,r),am(e)):GA(fn,r.stateNode));break;case 4:n=fn,i=Ia,fn=r.stateNode.containerInfo,Ia=!0,tl(e,t,r),fn=n,Ia=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)&&WP(r,t,o),i=i.next}while(i!==n)}tl(e,t,r);break;case 1:if(!kn&&(Oh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){dr(r,t,s)}tl(e,t,r);break;case 21:tl(e,t,r);break;case 22:r.mode&1?(kn=(n=kn)||r.memoizedState!==null,tl(e,t,r),kn=n):tl(e,t,r);break;default:tl(e,t,r)}}function VB(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new mle),t.forEach(function(n){var i=Mle.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Sa(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*_le(n/1960))-n,10e?16:e,wl===null)var n=!1;else{if(e=wl,wl=null,Rb=0,wt&6)throw Error(me(331));var i=wt;for(wt|=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()-CE?Lc(e,0):AE|=r),ci(e,t)}function Y9(e,t){t===0&&(e.mode&1?(t=Z0,Z0<<=1,!(Z0&130023424)&&(Z0=4194304)):t=1);var r=Wn();e=Os(e,t),e!==null&&(By(e,t,r),ci(e,r))}function Cle(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Y9(e,r)}function Mle(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(me(314))}n!==null&&n.delete(t),Y9(e,r)}var X9;X9=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||li.current)oi=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return oi=!1,vle(e,t,r);oi=!!(e.flags&131072)}else oi=!1,er&&t.flags&1048576&&J7(t,Pb,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;W_(e,t),e=t.pendingProps;var i=cd(t,Nn.current);Xh(t,r),i=xE(null,t,n,e,i,r);var a=_E();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,ui(n)?(a=!0,Cb(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,vE(t),i.updater=fS,t.stateNode=i,i._reactInternals=t,RP(t,n,e,r),t=$P(null,t,n,!0,a,r)):(t.tag=0,er&&a&&sE(t),zn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(W_(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Lle(n),e=La(n,e),i){case 0:t=zP(null,t,n,e,r);break e;case 1:t=RB(null,t,n,e,r);break e;case 11:t=NB(null,t,n,e,r);break e;case 14:t=jB(null,t,n,La(n.type,e),r);break e}throw Error(me(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),zP(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),RB(e,t,n,i,r);case 3:e:{if(O9(t),e===null)throw Error(me(387));n=t.pendingProps,a=t.memoizedState,i=a.element,a9(e,t),Ib(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=vd(Error(me(423)),t),t=BB(e,t,n,r,i);break e}else if(n!==i){i=vd(Error(me(424)),t),t=BB(e,t,n,r,i);break e}else for(Ai=jl(t.stateNode.containerInfo.firstChild),ki=t,er=!0,Da=null,r=n9(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(fd(),n===i){t=Es(e,t,r);break e}zn(e,t,n,r)}t=t.child}return t;case 5:return o9(t),e===null&&DP(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,LP(n,i)?o=null:a!==null&&LP(n,a)&&(t.flags|=32),I9(e,t),zn(e,t,o,r),t.child;case 6:return e===null&&DP(t),null;case 13:return E9(e,t,r);case 4:return pE(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=hd(t,null,n,r):zn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),NB(e,t,n,i,r);case 7:return zn(e,t,t.pendingProps,r),t.child;case 8:return zn(e,t,t.pendingProps.children,r),t.child;case 12:return zn(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(Lb,n._currentValue),n._currentValue=o,a!==null)if(Ha(a.value,o)){if(a.children===i.children&&!li.current){t=Es(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=_s(-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),NP(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(me(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),NP(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}zn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Xh(t,r),i=ua(i),n=n(i),t.flags|=1,zn(e,t,n,r),t.child;case 14:return n=t.type,i=La(n,t.pendingProps),i=La(n.type,i),jB(e,t,n,i,r);case 15:return L9(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),W_(e,t),t.tag=1,ui(n)?(e=!0,Cb(t)):e=!1,Xh(t,r),C9(t,n,i),RP(t,n,i,r),$P(null,t,n,!0,e,r);case 19:return D9(e,t,r);case 22:return k9(e,t,r)}throw Error(me(156,t.tag))};function q9(e,t){return S7(e,t)}function Ple(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 Ple(e,t,r,n)}function kE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lle(e){if(typeof e=="function")return kE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===XO)return 11;if(e===qO)return 14}return 2}function $l(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 Z_(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")kE(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Sh:return kc(r.children,i,a,t);case YO:o=8,i|=8;break;case sP:return e=ra(12,r,t,i|2),e.elementType=sP,e.lanes=a,e;case lP:return e=ra(13,r,t,i),e.elementType=lP,e.lanes=a,e;case uP:return e=ra(19,r,t,i),e.elementType=uP,e.lanes=a,e;case o7:return vS(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case i7:o=10;break e;case a7:o=9;break e;case XO:o=11;break e;case qO:o=14;break e;case vl:o=16,n=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=ra(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function kc(e,t,r,n){return e=ra(7,e,n,t),e.lanes=r,e}function vS(e,t,r,n){return e=ra(22,e,n,t),e.elementType=o7,e.lanes=r,e.stateNode={isHidden:!1},e}function KA(e,t,r){return e=ra(6,e,null,t),e.lanes=r,e}function QA(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 kle(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=OA(0),this.expirationTimes=OA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=OA(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function IE(e,t,r,n,i,a,o,s,l){return e=new kle(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},vE(a),e}function Ile(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eZ)}catch(e){console.error(e)}}eZ(),e7.exports=Ei;var tZ=e7.exports,qB=tZ;aP.createRoot=qB.createRoot,aP.hydrateRoot=qB.hydrateRoot;/** +`+a.stack}return{value:e,source:t,stack:i,digest:null}}function qA(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function BP(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var fle=typeof WeakMap=="function"?WeakMap:Map;function M9(e,t,r){r=_s(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Rb||(Rb=!0,YP=n),BP(e,t)},r}function P9(e,t,r){r=_s(-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(){BP(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){BP(e,t),typeof n!="function"&&(zl===null?zl=new Set([this]):zl.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function OB(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new fle;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=Ale.bind(null,e,t,r),t.then(e,e))}function EB(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 DB(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=_s(-1,1),t.tag=2,Bl(r,t,1))),r.lanes|=1),e)}var hle=Us.ReactCurrentOwner,oi=!1;function zn(e,t,r,n){t.child=e===null?n9(t,null,r,n):dd(t,e.child,r,n)}function NB(e,t,r,n,i){r=r.render;var a=t.ref;return qh(t,i),n=xE(e,t,r,n,a,i),r=_E(),e!==null&&!oi?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Es(e,t,i)):(er&&r&&sE(t),t.flags|=1,zn(e,t,n,i),t.child)}function jB(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!kE(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,L9(e,t,a,n,i)):(e=Y_(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:lm,r(o,n)&&e.ref===t.ref)return Es(e,t,i)}return t.flags|=1,e=Fl(a,n),e.ref=t.ref,e.return=t,t.child=e}function L9(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(lm(a,n)&&e.ref===t.ref)if(oi=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(oi=!0);else return t.lanes=e.lanes,Es(e,t,i)}return zP(e,t,r,n,i)}function k9(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},Yt(Dh,yi),yi|=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,Yt(Dh,yi),yi|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Yt(Dh,yi),yi|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Yt(Dh,yi),yi|=n;return zn(e,t,i,r),t.child}function I9(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function zP(e,t,r,n,i){var a=ui(r)?Gc:Nn.current;return a=fd(t,a),qh(t,i),r=xE(e,t,r,n,a,i),n=_E(),e!==null&&!oi?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Es(e,t,i)):(er&&n&&sE(t),t.flags|=1,zn(e,t,r,i),t.child)}function RB(e,t,r,n,i){if(ui(r)){var a=!0;Mb(t)}else a=!1;if(qh(t,i),t.stateNode===null)H_(e,t),C9(t,r,n),RP(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=ua(u):(u=ui(r)?Gc:Nn.current,u=fd(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)&&IB(t,o,n,u),gl=!1;var h=t.memoizedState;o.state=h,Ob(t,n,o,i),l=t.memoizedState,s!==n||h!==l||li.current||gl?(typeof c=="function"&&(jP(t,r,c,n),l=t.memoizedState),(s=gl||kB(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,a9(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:La(t.type,s),o.props=u,f=t.pendingProps,h=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=ua(l):(l=ui(r)?Gc:Nn.current,l=fd(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)&&IB(t,o,n,l),gl=!1,h=t.memoizedState,o.state=h,Ob(t,n,o,i);var v=t.memoizedState;s!==f||h!==v||li.current||gl?(typeof d=="function"&&(jP(t,r,d,n),v=t.memoizedState),(u=gl||kB(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 $P(e,t,r,n,a,i)}function $P(e,t,r,n,i,a){I9(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&wB(t,r,!1),Es(e,t,a);n=t.stateNode,hle.current=t;var s=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=dd(t,e.child,null,a),t.child=dd(t,null,s,a)):zn(e,t,s,a),t.memoizedState=n.state,i&&wB(t,r,!0),t.child}function O9(e){var t=e.stateNode;t.pendingContext?bB(e,t.pendingContext,t.pendingContext!==t.context):t.context&&bB(e,t.context,!1),pE(e,t.containerInfo)}function BB(e,t,r,n,i){return hd(),uE(i),t.flags|=256,zn(e,t,r,n),t.child}var FP={dehydrated:null,treeContext:null,retryLane:0};function VP(e){return{baseLanes:e,cachePool:null,transitions:null}}function E9(e,t,r){var n=t.pendingProps,i=or.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),Yt(or,i&1),e===null)return DP(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=pS(o,n,0,null),e=Ic(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=VP(r),t.memoizedState=FP,e):SE(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return dle(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=Fl(i,l),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=Fl(s,a):(a=Ic(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?VP(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=FP,n}return a=e.child,e=a.sibling,n=Fl(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 SE(e,t){return t=pS({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rx(e,t,r,n){return n!==null&&uE(n),dd(t,e.child,null,r),e=SE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dle(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=qA(Error(me(422))),rx(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=pS({mode:"visible",children:n.children},i,0,null),a=Ic(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&dd(t,e.child,null,o),t.child.memoizedState=VP(o),t.memoizedState=FP,a);if(!(t.mode&1))return rx(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(me(419)),n=qA(a,n,void 0),rx(e,t,o,n)}if(s=(o&e.childLanes)!==0,oi||s){if(n=an,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,Os(e,i),$a(n,e,i,-1))}return LE(),n=qA(Error(me(421))),rx(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Cle.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Ai=Rl(i.nextSibling),ki=t,er=!0,Da=null,e!==null&&(Ki[Qi++]=fs,Ki[Qi++]=hs,Ki[Qi++]=Wc,fs=e.id,hs=e.overflow,Wc=t),t=SE(t,n.children),t.flags|=4096,t)}function zB(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),NP(e.return,t,r)}function KA(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 D9(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(zn(e,t,n.children,r),n=or.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&&zB(e,r,t);else if(e.tag===19)zB(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(Yt(or,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&&Eb(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),KA(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&&Eb(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}KA(t,!0,r,null,a);break;case"together":KA(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function H_(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Es(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Uc|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(me(153));if(t.child!==null){for(e=t.child,r=Fl(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Fl(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function vle(e,t,r){switch(t.tag){case 3:O9(t),hd();break;case 5:o9(t);break;case 1:ui(t.type)&&Mb(t);break;case 4:pE(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Yt(kb,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Yt(or,or.current&1),t.flags|=128,null):r&t.child.childLanes?E9(e,t,r):(Yt(or,or.current&1),e=Es(e,t,r),e!==null?e.sibling:null);Yt(or,or.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return D9(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Yt(or,or.current),n)break;return null;case 22:case 23:return t.lanes=0,k9(e,t,r)}return Es(e,t,r)}var N9,GP,j9,R9;N9=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}};GP=function(){};j9=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,mc(Po.current);var a=null;switch(r){case"input":i=fP(e,i),n=fP(e,n),a=[];break;case"select":i=cr({},i,{value:void 0}),n=cr({},n,{value:void 0}),a=[];break;case"textarea":i=vP(e,i),n=vP(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Ab)}gP(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"&&(tm.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"&&(tm.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&qt("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)}};R9=function(e,t,r,n){r!==n&&(t.flags|=4)};function pp(e,t){if(!er)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 Tn(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 ple(e,t,r){var n=t.pendingProps;switch(lE(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(t),null;case 1:return ui(t.type)&&Cb(),Tn(t),null;case 3:return n=t.stateNode,vd(),Jt(li),Jt(Nn),mE(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ex(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Da!==null&&(KP(Da),Da=null))),GP(e,t),Tn(t),null;case 5:gE(t);var i=mc(dm.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(me(166));return Tn(t),null}if(e=mc(Po.current),ex(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[po]=t,n[fm]=a,e=(t.mode&1)!==0,r){case"dialog":qt("cancel",n),qt("close",n);break;case"iframe":case"object":case"embed":qt("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[po]=t,e[fm]=n,N9(e,t,!1,!1),t.stateNode=e;e:{switch(o=mP(r,n),r){case"dialog":qt("cancel",e),qt("close",e),i=n;break;case"iframe":case"object":case"embed":qt("load",e),i=n;break;case"video":case"audio":for(i=0;igd&&(t.flags|=128,n=!0,pp(a,!1),t.lanes=4194304)}else{if(!n)if(e=Eb(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),pp(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!er)return Tn(t),null}else 2*wr()-a.renderingStartTime>gd&&r!==1073741824&&(t.flags|=128,n=!0,pp(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=or.current,Yt(or,n?r&1|2:r&1),t):(Tn(t),null);case 22:case 23:return PE(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?yi&1073741824&&(Tn(t),t.subtreeFlags&6&&(t.flags|=8192)):Tn(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function gle(e,t){switch(lE(t),t.tag){case 1:return ui(t.type)&&Cb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vd(),Jt(li),Jt(Nn),mE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gE(t),null;case 13:if(Jt(or),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));hd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jt(or),null;case 4:return vd(),null;case 10:return hE(t.type._context),null;case 22:case 23:return PE(),null;case 24:return null;default:return null}}var nx=!1,kn=!1,mle=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Eh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){dr(e,t,n)}else r.current=null}function WP(e,t,r){try{r()}catch(n){dr(e,t,n)}}var $B=!1;function yle(e,t){if(MP=wb,e=V7(),oE(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(PP={focusedElem:e,selectionRange:r},wb=!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(me(163))}}catch(S){dr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return v=$B,$B=!1,v}function kg(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&&WP(t,r,a)}i=i.next}while(i!==n)}}function dS(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 HP(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 B9(e){var t=e.alternate;t!==null&&(e.alternate=null,B9(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[po],delete t[fm],delete t[IP],delete t[ele],delete t[tle])),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 z9(e){return e.tag===5||e.tag===3||e.tag===4}function FB(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||z9(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 UP(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=Ab));else if(n!==4&&(e=e.child,e!==null))for(UP(e,t,r),e=e.sibling;e!==null;)UP(e,t,r),e=e.sibling}function ZP(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(ZP(e,t,r),e=e.sibling;e!==null;)ZP(e,t,r),e=e.sibling}var fn=null,Ia=!1;function tl(e,t,r){for(r=r.child;r!==null;)$9(e,t,r),r=r.sibling}function $9(e,t,r){if(Mo&&typeof Mo.onCommitFiberUnmount=="function")try{Mo.onCommitFiberUnmount(aS,r)}catch{}switch(r.tag){case 5:kn||Eh(r,t);case 6:var n=fn,i=Ia;fn=null,tl(e,t,r),fn=n,Ia=i,fn!==null&&(Ia?(e=fn,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):fn.removeChild(r.stateNode));break;case 18:fn!==null&&(Ia?(e=fn,r=r.stateNode,e.nodeType===8?WA(e.parentNode,r):e.nodeType===1&&WA(e,r),om(e)):WA(fn,r.stateNode));break;case 4:n=fn,i=Ia,fn=r.stateNode.containerInfo,Ia=!0,tl(e,t,r),fn=n,Ia=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)&&WP(r,t,o),i=i.next}while(i!==n)}tl(e,t,r);break;case 1:if(!kn&&(Eh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){dr(r,t,s)}tl(e,t,r);break;case 21:tl(e,t,r);break;case 22:r.mode&1?(kn=(n=kn)||r.memoizedState!==null,tl(e,t,r),kn=n):tl(e,t,r);break;default:tl(e,t,r)}}function VB(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new mle),t.forEach(function(n){var i=Mle.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Sa(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*_le(n/1960))-n,10e?16:e,Sl===null)var n=!1;else{if(e=Sl,Sl=null,Bb=0,wt&6)throw Error(me(331));var i=wt;for(wt|=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()-CE?kc(e,0):AE|=r),ci(e,t)}function Y9(e,t){t===0&&(e.mode&1?(t=Y0,Y0<<=1,!(Y0&130023424)&&(Y0=4194304)):t=1);var r=Wn();e=Os(e,t),e!==null&&(zy(e,t,r),ci(e,r))}function Cle(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Y9(e,r)}function Mle(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(me(314))}n!==null&&n.delete(t),Y9(e,r)}var X9;X9=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||li.current)oi=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return oi=!1,vle(e,t,r);oi=!!(e.flags&131072)}else oi=!1,er&&t.flags&1048576&&J7(t,Lb,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;H_(e,t),e=t.pendingProps;var i=fd(t,Nn.current);qh(t,r),i=xE(null,t,n,e,i,r);var a=_E();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,ui(n)?(a=!0,Mb(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,vE(t),i.updater=hS,t.stateNode=i,i._reactInternals=t,RP(t,n,e,r),t=$P(null,t,n,!0,a,r)):(t.tag=0,er&&a&&sE(t),zn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(H_(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Lle(n),e=La(n,e),i){case 0:t=zP(null,t,n,e,r);break e;case 1:t=RB(null,t,n,e,r);break e;case 11:t=NB(null,t,n,e,r);break e;case 14:t=jB(null,t,n,La(n.type,e),r);break e}throw Error(me(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),zP(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),RB(e,t,n,i,r);case 3:e:{if(O9(t),e===null)throw Error(me(387));n=t.pendingProps,a=t.memoizedState,i=a.element,a9(e,t),Ob(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=pd(Error(me(423)),t),t=BB(e,t,n,r,i);break e}else if(n!==i){i=pd(Error(me(424)),t),t=BB(e,t,n,r,i);break e}else for(Ai=Rl(t.stateNode.containerInfo.firstChild),ki=t,er=!0,Da=null,r=n9(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(hd(),n===i){t=Es(e,t,r);break e}zn(e,t,n,r)}t=t.child}return t;case 5:return o9(t),e===null&&DP(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,LP(n,i)?o=null:a!==null&&LP(n,a)&&(t.flags|=32),I9(e,t),zn(e,t,o,r),t.child;case 6:return e===null&&DP(t),null;case 13:return E9(e,t,r);case 4:return pE(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=dd(t,null,n,r):zn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),NB(e,t,n,i,r);case 7:return zn(e,t,t.pendingProps,r),t.child;case 8:return zn(e,t,t.pendingProps.children,r),t.child;case 12:return zn(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,Yt(kb,n._currentValue),n._currentValue=o,a!==null)if(Ha(a.value,o)){if(a.children===i.children&&!li.current){t=Es(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=_s(-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),NP(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(me(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),NP(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}zn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,qh(t,r),i=ua(i),n=n(i),t.flags|=1,zn(e,t,n,r),t.child;case 14:return n=t.type,i=La(n,t.pendingProps),i=La(n.type,i),jB(e,t,n,i,r);case 15:return L9(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:La(n,i),H_(e,t),t.tag=1,ui(n)?(e=!0,Mb(t)):e=!1,qh(t,r),C9(t,n,i),RP(t,n,i,r),$P(null,t,n,!0,e,r);case 19:return D9(e,t,r);case 22:return k9(e,t,r)}throw Error(me(156,t.tag))};function q9(e,t){return S7(e,t)}function Ple(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 Ple(e,t,r,n)}function kE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lle(e){if(typeof e=="function")return kE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===XO)return 11;if(e===qO)return 14}return 2}function Fl(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 Y_(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")kE(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Th:return Ic(r.children,i,a,t);case YO:o=8,i|=8;break;case sP:return e=ra(12,r,t,i|2),e.elementType=sP,e.lanes=a,e;case lP:return e=ra(13,r,t,i),e.elementType=lP,e.lanes=a,e;case uP:return e=ra(19,r,t,i),e.elementType=uP,e.lanes=a,e;case o7:return pS(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case i7:o=10;break e;case a7:o=9;break e;case XO:o=11;break e;case qO:o=14;break e;case pl:o=16,n=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=ra(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Ic(e,t,r,n){return e=ra(7,e,n,t),e.lanes=r,e}function pS(e,t,r,n){return e=ra(22,e,n,t),e.elementType=o7,e.lanes=r,e.stateNode={isHidden:!1},e}function QA(e,t,r){return e=ra(6,e,null,t),e.lanes=r,e}function JA(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 kle(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=EA(0),this.expirationTimes=EA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=EA(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function IE(e,t,r,n,i,a,o,s,l){return e=new kle(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},vE(a),e}function Ile(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eZ)}catch(e){console.error(e)}}eZ(),e7.exports=Ei;var tZ=e7.exports,qB=tZ;aP.createRoot=qB.createRoot,aP.hydrateRoot=qB.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 mm(){return mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function NE(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rle(){return Math.random().toString(36).substr(2,8)}function QB(e,t){return{usr:e.state,key:e.key,idx:t}}function QP(e,t,r,n){return r===void 0&&(r=null),mm({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?uv(t):t,{state:r,key:t&&t.key||n||Rle()})}function $b(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 uv(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 Ble(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Sl.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(mm({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function f(){s=Sl.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=Sl.Push;let x=QP(g.location,m,y);u=c()+1;let b=QB(x,u),S=g.createHref(x);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=Sl.Replace;let x=QP(g.location,m,y);u=c();let b=QB(x,u),S=g.createHref(x);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,x=typeof m=="string"?m:$b(m);return x=x.replace(/ $/,"%20"),Or(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,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(KB,f),l=m,()=>{i.removeEventListener(KB,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 JB;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(JB||(JB={}));function zle(e,t,r){return r===void 0&&(r="/"),$le(e,t,r)}function $le(e,t,r,n){let i=typeof t=="string"?uv(t):t,a=jE(i.pathname||"/",r);if(a==null)return null;let o=rZ(e);Fle(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=Fl([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+'".')),rZ(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Yle(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 nZ(a.path))i(a,o,l)}),t}function nZ(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=nZ(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 Fle(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Xle(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Vle=/^:[\w-]+$/,Gle=3,Wle=2,Hle=1,Ule=10,Zle=-2,e3=e=>e==="*";function Yle(e,t){let r=e.split("/"),n=r.length;return r.some(e3)&&(n+=Zle),t&&(n+=Wle),r.filter(i=>!e3(i)).reduce((i,a)=>i+(Vle.test(a)?Gle:a===""?Hle:Ule),n)}function Xle(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 qle(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 Qle(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),NE(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 Jle(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return NE(!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 jE(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 eue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tue=e=>eue.test(e);function rue(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?uv(e):e,a;if(r)if(tue(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),NE(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=t3(r.substring(1),"/"):a=t3(r,t)}else a=t;return{pathname:a,search:aue(n),hash:oue(i)}}function t3(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 JA(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 nue(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function iZ(e,t){let r=nue(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function aZ(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=uv(e):(i=mm({},e),Or(!i.pathname||!i.pathname.includes("?"),JA("?","pathname","search",i)),Or(!i.pathname||!i.pathname.includes("#"),JA("#","pathname","hash",i)),Or(!i.search||!i.search.includes("#"),JA("#","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=rue(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Fl=e=>e.join("/").replace(/\/\/+/g,"/"),iue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),aue=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oue=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 oZ=["post","put","patch","delete"];new Set(oZ);const lue=["get",...oZ];new Set(lue);/** + */function ym(){return ym=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function NE(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rle(){return Math.random().toString(36).substr(2,8)}function QB(e,t){return{usr:e.state,key:e.key,idx:t}}function QP(e,t,r,n){return r===void 0&&(r=null),ym({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?cv(t):t,{state:r,key:t&&t.key||n||Rle()})}function Fb(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 cv(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 Ble(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Tl.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(ym({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function f(){s=Tl.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=Tl.Push;let _=QP(g.location,m,y);u=c()+1;let b=QB(_,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=Tl.Replace;let _=QP(g.location,m,y);u=c();let b=QB(_,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:Fb(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(KB,f),l=m,()=>{i.removeEventListener(KB,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 JB;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(JB||(JB={}));function zle(e,t,r){return r===void 0&&(r="/"),$le(e,t,r)}function $le(e,t,r,n){let i=typeof t=="string"?cv(t):t,a=jE(i.pathname||"/",r);if(a==null)return null;let o=rZ(e);Fle(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=Vl([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+'".')),rZ(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Yle(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 nZ(a.path))i(a,o,l)}),t}function nZ(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=nZ(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 Fle(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Xle(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Vle=/^:[\w-]+$/,Gle=3,Wle=2,Hle=1,Ule=10,Zle=-2,e3=e=>e==="*";function Yle(e,t){let r=e.split("/"),n=r.length;return r.some(e3)&&(n+=Zle),t&&(n+=Wle),r.filter(i=>!e3(i)).reduce((i,a)=>i+(Vle.test(a)?Gle:a===""?Hle:Ule),n)}function Xle(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 qle(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 Qle(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),NE(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 Jle(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return NE(!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 jE(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 eue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tue=e=>eue.test(e);function rue(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?cv(e):e,a;if(r)if(tue(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),NE(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=t3(r.substring(1),"/"):a=t3(r,t)}else a=t;return{pathname:a,search:aue(n),hash:oue(i)}}function t3(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 eC(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 nue(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function iZ(e,t){let r=nue(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function aZ(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=cv(e):(i=ym({},e),Or(!i.pathname||!i.pathname.includes("?"),eC("?","pathname","search",i)),Or(!i.pathname||!i.pathname.includes("#"),eC("#","pathname","hash",i)),Or(!i.search||!i.search.includes("#"),eC("#","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=rue(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Vl=e=>e.join("/").replace(/\/\/+/g,"/"),iue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),aue=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oue=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 oZ=["post","put","patch","delete"];new Set(oZ);const lue=["get",...oZ];new Set(lue);/** * 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 ym(){return ym=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=aZ(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Fl([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,a,e])}function cZ(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=W.useContext(hf),{matches:i}=W.useContext(df),{pathname:a}=cv(),o=JSON.stringify(iZ(i,n.v7_relativeSplatPath));return W.useMemo(()=>aZ(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function hue(e,t){return due(e,t)}function due(e,t,r,n){Vy()||Or(!1);let{navigator:i}=W.useContext(hf),{matches:a}=W.useContext(df),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=cv(),c;if(t){var f;let m=typeof t=="string"?uv(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=zle(e,{pathname:d}),g=yue(v&&v.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:Fl([l,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:Fl([l,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),a,r,n);return t&&g?W.createElement(xS.Provider,{value:{location:ym({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Sl.Pop}},g):g}function vue(){let e=wue(),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 pue=W.createElement(vue,null);class gue 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(df.Provider,{value:this.props.routeContext},W.createElement(sZ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mue(e){let{routeContext:t,match:r,children:n}=e,i=W.useContext(RE);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),W.createElement(df.Provider,{value:t},n)}function yue(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||pue,l&&(u<0&&h===0?(Tue("route-fallback"),v=!0,m=null):u===h&&(v=!0,m=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),x=()=>{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(mue,{match:f,routeContext:{outlet:c,matches:y,isDataRoute:r!=null},children:b})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?W.createElement(gue,{location:r.location,revalidation:r.revalidation,component:g,error:d,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var fZ=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(fZ||{}),hZ=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}(hZ||{});function xue(e){let t=W.useContext(RE);return t||Or(!1),t}function _ue(e){let t=W.useContext(uue);return t||Or(!1),t}function bue(e){let t=W.useContext(df);return t||Or(!1),t}function dZ(e){let t=bue(),r=t.matches[t.matches.length-1];return r.route.id||Or(!1),r.route.id}function wue(){var e;let t=W.useContext(sZ),r=_ue(),n=dZ();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Sue(){let{router:e}=xue(fZ.UseNavigateStable),t=dZ(hZ.UseNavigateStable),r=W.useRef(!1);return lZ(()=>{r.current=!0}),W.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,ym({fromRouteId:t},a)))},[e,t])}const r3={};function Tue(e,t,r){r3[e]||(r3[e]=!0)}function Aue(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function cl(e){Or(!1)}function Cue(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Sl.Pop,navigator:a,static:o=!1,future:s}=e;Vy()&&Or(!1);let l=t.replace(/^\/*/,"/"),u=W.useMemo(()=>({basename:l,navigator:a,static:o,future:ym({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=uv(n));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:v="default"}=n,g=W.useMemo(()=>{let m=jE(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(hf.Provider,{value:u},W.createElement(xS.Provider,{children:r,value:g}))}function Mue(e){let{children:t,location:r}=e;return hue(JP(t),r)}new Promise(()=>{});function JP(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,JP(n.props.children,a));return}n.type!==cl&&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=JP(n.props.children,a)),r.push(o)}),r}/** + */function xm(){return xm=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=aZ(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Vl([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,a,e])}function cZ(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=W.useContext(df),{matches:i}=W.useContext(vf),{pathname:a}=fv(),o=JSON.stringify(iZ(i,n.v7_relativeSplatPath));return W.useMemo(()=>aZ(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function hue(e,t){return due(e,t)}function due(e,t,r,n){Gy()||Or(!1);let{navigator:i}=W.useContext(df),{matches:a}=W.useContext(vf),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=fv(),c;if(t){var f;let m=typeof t=="string"?cv(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=zle(e,{pathname:d}),g=yue(v&&v.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:Vl([l,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:Vl([l,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),a,r,n);return t&&g?W.createElement(_S.Provider,{value:{location:xm({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Tl.Pop}},g):g}function vue(){let e=wue(),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 pue=W.createElement(vue,null);class gue 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(vf.Provider,{value:this.props.routeContext},W.createElement(sZ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mue(e){let{routeContext:t,match:r,children:n}=e,i=W.useContext(RE);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),W.createElement(vf.Provider,{value:t},n)}function yue(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||pue,l&&(u<0&&h===0?(Tue("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(mue,{match:f,routeContext:{outlet:c,matches:y,isDataRoute:r!=null},children:b})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?W.createElement(gue,{location:r.location,revalidation:r.revalidation,component:g,error:d,children:_(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):_()},null)}var fZ=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(fZ||{}),hZ=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}(hZ||{});function xue(e){let t=W.useContext(RE);return t||Or(!1),t}function _ue(e){let t=W.useContext(uue);return t||Or(!1),t}function bue(e){let t=W.useContext(vf);return t||Or(!1),t}function dZ(e){let t=bue(),r=t.matches[t.matches.length-1];return r.route.id||Or(!1),r.route.id}function wue(){var e;let t=W.useContext(sZ),r=_ue(),n=dZ();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Sue(){let{router:e}=xue(fZ.UseNavigateStable),t=dZ(hZ.UseNavigateStable),r=W.useRef(!1);return lZ(()=>{r.current=!0}),W.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,xm({fromRouteId:t},a)))},[e,t])}const r3={};function Tue(e,t,r){r3[e]||(r3[e]=!0)}function Aue(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function fl(e){Or(!1)}function Cue(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Tl.Pop,navigator:a,static:o=!1,future:s}=e;Gy()&&Or(!1);let l=t.replace(/^\/*/,"/"),u=W.useMemo(()=>({basename:l,navigator:a,static:o,future:xm({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=cv(n));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:v="default"}=n,g=W.useMemo(()=>{let m=jE(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(df.Provider,{value:u},W.createElement(_S.Provider,{children:r,value:g}))}function Mue(e){let{children:t,location:r}=e;return hue(JP(t),r)}new Promise(()=>{});function JP(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,JP(n.props.children,a));return}n.type!==fl&&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=JP(n.props.children,a)),r.push(o)}),r}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. @@ -64,7 +64,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function eL(){return eL=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Lue(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kue(e,t){return e.button===0&&(!t||t==="_self")&&!Lue(e)}const Iue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Oue="6";try{window.__reactRouterVersion=Oue}catch{}const Eue="startTransition",n3=Aoe[Eue];function Due(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&&n3?n3(()=>l(f)):l(f)},[l,u]);return W.useLayoutEffect(()=>o.listen(c),[o,c]),W.useEffect(()=>Aue(n),[n]),W.createElement(Cue,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const Nue=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rue=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=Pue(t,Iue),{basename:d}=W.useContext(hf),v,g=!1;if(typeof u=="string"&&jue.test(u)&&(v=u,Nue))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),T=jE(S.pathname,d);S.origin===b.origin&&T!=null?u=T+S.search+S.hash:g=!0}catch{}let m=cue(u,{relative:i}),y=Bue(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:f});function x(b){n&&n(b),b.defaultPrevented||y(b)}return W.createElement("a",eL({},h,{href:v||m,onClick:g||a?n:x,ref:r,target:l}))});var i3;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(i3||(i3={}));var a3;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(a3||(a3={}));function Bue(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=uZ(),u=cv(),c=cZ(e,{relative:o});return W.useCallback(f=>{if(kue(f,r)){f.preventDefault();let h=n!==void 0?n:$b(u)===$b(c);l(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,c,n,i,r,e,a,o,s])}/** + */function eL(){return eL=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Lue(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kue(e,t){return e.button===0&&(!t||t==="_self")&&!Lue(e)}const Iue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Oue="6";try{window.__reactRouterVersion=Oue}catch{}const Eue="startTransition",n3=Aoe[Eue];function Due(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&&n3?n3(()=>l(f)):l(f)},[l,u]);return W.useLayoutEffect(()=>o.listen(c),[o,c]),W.useEffect(()=>Aue(n),[n]),W.createElement(Cue,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const Nue=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rue=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=Pue(t,Iue),{basename:d}=W.useContext(df),v,g=!1;if(typeof u=="string"&&jue.test(u)&&(v=u,Nue))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),T=jE(S.pathname,d);S.origin===b.origin&&T!=null?u=T+S.search+S.hash:g=!0}catch{}let m=cue(u,{relative:i}),y=Bue(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",eL({},h,{href:v||m,onClick:g||a?n:_,ref:r,target:l}))});var i3;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(i3||(i3={}));var a3;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(a3||(a3={}));function Bue(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=uZ(),u=fv(),c=cZ(e,{relative:o});return W.useCallback(f=>{if(kue(f,r)){f.preventDefault();let h=n!==void 0?n:Fb(u)===Fb(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. @@ -89,12 +89,12 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gy=ze("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + */const Wy=ze("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @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 eC=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 tC=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. @@ -104,7 +104,7 @@ 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 xm=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 _m=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. @@ -134,12 +134,12 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gd=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const md=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. * See the LICENSE file in the root directory of this source tree. - */const Wy=ze("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const Hy=ze("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -149,7 +149,7 @@ 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 _m=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const bm=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. @@ -159,17 +159,17 @@ 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 Hy=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 Uy=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 Kh=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 Qh=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. * See the LICENSE file in the root directory of this source tree. - */const md=ze("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + */const yd=ze("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -179,7 +179,7 @@ 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 Zc=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 Yc=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. @@ -214,7 +214,7 @@ 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 yd=ze("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const xd=ze("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -239,7 +239,7 @@ 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 bm=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 wm=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. @@ -284,12 +284,12 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _S=ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const bS=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 eu=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 tu=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. @@ -329,7 +329,7 @@ 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 Fb=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 Vb=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. @@ -374,12 +374,12 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fv=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + */const hv=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 wm=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 Zr(e){const t=await fetch(e);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function l3(){return Zr("/api/status")}async function ace(){return Zr("/api/health")}async function oce(){return Zr("/api/nodes")}async function sce(){return Zr("/api/edges")}async function lce(){return Zr("/api/sources")}async function PZ(){return Zr("/api/alerts/active")}async function u3(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),Zr(`/api/alerts/history?${i.toString()}`)}async function uce(){return Zr("/api/subscriptions")}async function LZ(){return Zr("/api/env/status")}async function kZ(){return Zr("/api/env/active")}async function IZ(){return Zr("/api/env/swpc")}async function OZ(){return Zr("/api/env/ducting")}async function cce(){return Zr("/api/env/fires")}async function fce(){return Zr("/api/env/avalanche")}async function hce(){return Zr("/api/env/streams")}async function dce(){return Zr("/api/env/traffic")}async function vce(){return Zr("/api/env/roads")}async function pce(){return Zr("/api/env/hotspots")}async function gce(){return Zr("/api/regions")}function ZE(){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 x=JSON.parse(y.data);switch(s(x),x.type){case"health_update":n(x.data);break;case"alert_fired":a(x.data);break}}catch(x){console.error("Failed to parse WebSocket message:",x)}},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 EZ=W.createContext(null);function mce(){const e=W.useContext(EZ);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function yce(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Hy,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:Ds,iconColor:"text-amber-500"};default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:bm,iconColor:"text-blue-500"}}}function xce({toast:e,onDismiss:t,onNavigate:r}){const n=yce(e.alert.severity),i=n.icon;return W.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),_.jsx("div",{className:`${n.bg} border ${n.border} rounded-lg shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:_.jsxs("div",{className:"flex items-start gap-3 p-4",children:[_.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),_.jsx(i,{size:18,className:n.iconColor}),_.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[_.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())}),_.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),_.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:_.jsx(fv,{size:16})})]})})}function _ce({children:e}){const[t,r]=W.useState([]),n=uZ(),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 _.jsxs(EZ.Provider,{value:{addToast:i},children:[e,_.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=>_.jsx("div",{className:"pointer-events-auto",children:_.jsx(xce,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const DZ=[{path:"/",label:"Dashboard",icon:_Z},{path:"/mesh",label:"Mesh",icon:eu},{path:"/environment",label:"Environment",icon:Zc},{path:"/config",label:"Config",icon:AZ},{path:"/alerts",label:"Alerts",icon:xm},{path:"/notifications",label:"Notifications",icon:Vue},{path:"/reference",label:"Reference",icon:pZ}];function bce(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 wce(e){const t=DZ.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function Sce({children:e}){var h;const t=cv(),{connected:r,lastAlert:n}=ZE(),{addToast:i}=mce(),[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(()=>{l3().then(o).catch(console.error);const d=setInterval(()=>{l3().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 _.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-slate-200",children:[_.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[_.jsx("div",{className:"p-5 border-b border-border",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.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"}),_.jsxs("div",{children:[_.jsx("div",{className:"font-semibold text-lg",children:"MeshAI"}),_.jsxs("div",{className:"text-xs text-slate-500 font-mono",children:["v",(a==null?void 0:a.version)||"..."]})]})]})}),_.jsx("nav",{className:"flex-1 py-4",children:DZ.map(d=>{const v=t.pathname===d.path,g=d.icon;return _.jsxs(Rue,{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&&_.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500"}),_.jsx(g,{size:18}),d.label]},d.path)})}),_.jsxs("div",{className:"p-5 border-t border-border",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[_.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),_.jsx("span",{className:"text-xs text-slate-400",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),_.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]}),_.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Uptime: ",a?bce(a.uptime_seconds):"..."]})]})]}),_.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[_.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[_.jsx("h1",{className:"text-lg font-semibold",children:wce(t.pathname)}),_.jsxs("div",{className:"flex items-center gap-6",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500 animate-pulse-slow":"bg-slate-500"}`}),_.jsx("span",{className:"text-xs text-slate-400",children:r?"Live":"Offline"})]}),_.jsxs("div",{className:"text-sm font-mono text-slate-400",children:[f," MT"]})]})]}),_.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:e})]})]})}function NZ(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 whe=bhe,She=wS;function The(e,t){var r=this.__data__,n=She(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Ahe=The,Che=lhe,Mhe=ghe,Phe=xhe,Lhe=whe,khe=Ahe;function pv(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=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 EZ=W.createContext(null);function mce(){const e=W.useContext(EZ);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function yce(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Uy,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:Ds,iconColor:"text-amber-500"};default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:wm,iconColor:"text-blue-500"}}}function xce({toast:e,onDismiss:t,onNavigate:r}){const n=yce(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(hv,{size:16})})]})})}function _ce({children:e}){const[t,r]=W.useState([]),n=uZ(),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(EZ.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(xce,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const DZ=[{path:"/",label:"Dashboard",icon:_Z},{path:"/mesh",label:"Mesh",icon:tu},{path:"/environment",label:"Environment",icon:Yc},{path:"/config",label:"Config",icon:AZ},{path:"/alerts",label:"Alerts",icon:_m},{path:"/notifications",label:"Notifications",icon:Vue},{path:"/reference",label:"Reference",icon:pZ}];function bce(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 wce(e){const t=DZ.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function Sce({children:e}){var h;const t=fv(),{connected:r,lastAlert:n}=ZE(),{addToast:i}=mce(),[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(()=>{l3().then(o).catch(console.error);const d=setInterval(()=>{l3().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:DZ.map(d=>{const v=t.pathname===d.path,g=d.icon;return x.jsxs(Rue,{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?bce(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:wce(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 NZ(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 whe=bhe,She=SS;function The(e,t){var r=this.__data__,n=She(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Ahe=The,Che=lhe,Mhe=ghe,Phe=xhe,Lhe=whe,khe=Ahe;function gv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},mc=function(t){return Yc(t)&&t.indexOf("%")===t.length-1},we=function(t){return qde(t)&&!mv(t)},eve=function(t){return dt(t)},Vr=function(t){return we(t)||Yc(t)},tve=0,yv=function(t){var r=++tve;return"".concat(t||"").concat(r)},Xc=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)&&!Yc(t))return n;var a;if(mc(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return mv(a)&&(a=n),i&&a>r&&(a=r),a},mh=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},rve=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 uve(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 rL(e){"@babel/helpers - typeof";return rL=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},rL(e)}var b3={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"},bs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},w3=null,nC=null,aD=function e(t){if(t===w3&&Array.isArray(nC))return nC;var r=[];return W.Children.forEach(t,function(n){dt(n)||(Hde.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),nC=r,w3=t,r};function oa(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return bs(i)}):n=[bs(t)],aD(e).forEach(function(i){var a=aa(i,"type.displayName")||aa(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function xi(e,t){var r=oa(e,t);return r&&r[0]}var S3=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)},cve=["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"],fve=function(t){return t&&t.type&&Yc(t.type)&&cve.indexOf(t.type)>=0},YZ=function(t){return t&&rL(t)==="object"&&"clipDot"in t},hve=function(t,r,n,i){var a,o=(a=rC==null?void 0:rC[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!ft(t)&&(i&&o.includes(r)||ave.includes(r))||n&&iD.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),!dv(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;hve((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},nL=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 T3(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 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 aL(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=gve(e,pve),c=i||{width:r,height:n,x:0,y:0},f=xt("recharts-surface",a);return Q.createElement("svg",iL({},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 yve=["children","className"];function oL(){return oL=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 _ve(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=xve(e,yve),a=xt("recharts-layer",n);return Q.createElement("g",oL({className:a},ct(i,!0),{ref:t}),r)}),Ic=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:Sve(e,t,r)}var Ave=Tve,Cve="\\ud800-\\udfff",Mve="\\u0300-\\u036f",Pve="\\ufe20-\\ufe2f",Lve="\\u20d0-\\u20ff",kve=Mve+Pve+Lve,Ive="\\ufe0e\\ufe0f",Ove="\\u200d",Eve=RegExp("["+Ove+Cve+kve+Ive+"]");function Dve(e){return Eve.test(e)}var XZ=Dve;function Nve(e){return e.split("")}var jve=Nve,qZ="\\ud800-\\udfff",Rve="\\u0300-\\u036f",Bve="\\ufe20-\\ufe2f",zve="\\u20d0-\\u20ff",$ve=Rve+Bve+zve,Fve="\\ufe0e\\ufe0f",Vve="["+qZ+"]",sL="["+$ve+"]",lL="\\ud83c[\\udffb-\\udfff]",Gve="(?:"+sL+"|"+lL+")",KZ="[^"+qZ+"]",QZ="(?:\\ud83c[\\udde6-\\uddff]){2}",JZ="[\\ud800-\\udbff][\\udc00-\\udfff]",Wve="\\u200d",eY=Gve+"?",tY="["+Fve+"]?",Hve="(?:"+Wve+"(?:"+[KZ,QZ,JZ].join("|")+")"+tY+eY+")*",Uve=tY+eY+Hve,Zve="(?:"+[KZ+sL+"?",sL,QZ,JZ,Vve].join("|")+")",Yve=RegExp(lL+"(?="+lL+")|"+Zve+Uve,"g");function Xve(e){return e.match(Yve)||[]}var qve=Xve,Kve=jve,Qve=XZ,Jve=qve;function epe(e){return Qve(e)?Jve(e):Kve(e)}var tpe=epe,rpe=Ave,npe=XZ,ipe=tpe,ape=VZ;function ope(e){return function(t){t=ape(t);var r=npe(t)?ipe(t):void 0,n=r?r[0]:t.charAt(0),i=r?rpe(r,1).join(""):t.slice(1);return n[e]()+i}}var spe=ope,lpe=spe,upe=lpe("toUpperCase"),cpe=upe;const jS=$t(cpe);function Ut(e){return function(){return e}}const rY=Math.cos,Hb=Math.sin,Xa=Math.sqrt,Ub=Math.PI,RS=2*Ub,uL=Math.PI,cL=2*uL,tc=1e-6,fpe=cL-tc;function nY(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nY;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;itc)if(!(Math.abs(f*l-u*c)>tc)||!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),x=Math.sqrt(h),b=a*Math.tan((uL-Math.acos((g+h-m)/(2*y*x)))/2),S=b/x,T=b/y;Math.abs(S-1)>tc&&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)>tc||Math.abs(this._y1-c)>tc)&&this._append`L${u},${c}`,n&&(h<0&&(h=h%cL+cL),h>fpe?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>tc&&this._append`A${n},${n},0,${+(h>=uL)},${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 oD(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 dpe(t)}function sD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iY(e){this._context=e}iY.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 BS(e){return new iY(e)}function aY(e){return e[0]}function oY(e){return e[1]}function sY(e,t){var r=Ut(!0),n=null,i=BS,a=null,o=oD(s);e=typeof e=="function"?e:e===void 0?aY:Ut(e),t=typeof t=="function"?t:t===void 0?oY:Ut(t);function s(l){var u,c=(l=sD(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(x)return s=null,x+""||null}function c(){return sY().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 lY{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 vpe(e){return new lY(e,!0)}function ppe(e){return new lY(e,!1)}const lD={draw(e,t){const r=Xa(t/Ub);e.moveTo(r,0),e.arc(0,0,r,0,RS)}},gpe={draw(e,t){const r=Xa(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()}},uY=Xa(1/3),mpe=uY*2,ype={draw(e,t){const r=Xa(t/mpe),n=r*uY;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},xpe={draw(e,t){const r=Xa(t),n=-r/2;e.rect(n,n,r,r)}},_pe=.8908130915292852,cY=Hb(Ub/10)/Hb(7*Ub/10),bpe=Hb(RS/10)*cY,wpe=-rY(RS/10)*cY,Spe={draw(e,t){const r=Xa(t*_pe),n=bpe*r,i=wpe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=RS*a/5,s=rY(o),l=Hb(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},iC=Xa(3),Tpe={draw(e,t){const r=-Xa(t/(iC*3));e.moveTo(0,r*2),e.lineTo(-iC*r,-r),e.lineTo(iC*r,-r),e.closePath()}},$i=-.5,Fi=Xa(3)/2,fL=1/Xa(12),Ape=(fL/2+1)*3,Cpe={draw(e,t){const r=Xa(t/Ape),n=r/2,i=r*fL,a=n,o=r*fL+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 Mpe(e,t){let r=null,n=oD(i);e=typeof e=="function"?e:Ut(e||lD),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 Zb(){}function Yb(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 fY(e){this._context=e}fY.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:Yb(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:Yb(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ppe(e){return new fY(e)}function hY(e){this._context=e}hY.prototype={areaStart:Zb,areaEnd:Zb,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:Yb(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lpe(e){return new hY(e)}function dY(e){this._context=e}dY.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:Yb(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kpe(e){return new dY(e)}function vY(e){this._context=e}vY.prototype={areaStart:Zb,areaEnd:Zb,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 Ipe(e){return new vY(e)}function C3(e){return e<0?-1:1}function M3(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(C3(a)+C3(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function P3(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function aC(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 Xb(e){this._context=e}Xb.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:aC(this,this._t0,P3(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,aC(this,P3(this,r=M3(this,e,t)),r);break;default:aC(this,this._t0,r=M3(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 gY(e)}(pY.prototype=Object.create(Xb.prototype)).point=function(e,t){Xb.prototype.point.call(this,t,e)};function gY(e){this._context=e}gY.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 Ope(e){return new Xb(e)}function Epe(e){return new pY(e)}function mY(e){this._context=e}mY.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=L3(e),i=L3(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 Npe(e){return new zS(e,.5)}function jpe(e){return new zS(e,0)}function Rpe(e){return new zS(e,1)}function xd(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 Bpe(e,t){return e[t]}function zpe(e){const t=[];return t.key=e,t}function $pe(){var e=Ut([]),t=hL,r=xd,n=Bpe;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 Xpe(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 yY={symbolCircle:lD,symbolCross:gpe,symbolDiamond:ype,symbolSquare:xpe,symbolStar:Spe,symbolTriangle:Tpe,symbolWye:Cpe},qpe=Math.PI/180,Kpe=function(t){var r="symbol".concat(jS(t));return yY[r]||lD},Qpe=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*qpe;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}},Jpe=function(t,r){yY["symbol".concat(jS(t))]=r},uD=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=Ype(t,Wpe),u=I3(I3({},l),{},{type:n,size:a,sizeType:s}),c=function(){var m=Kpe(n),y=Mpe().type(m).size(Qpe(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",dL({},v,{className:xt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:c()})):null};uD.registerSymbol=Jpe;function _d(e){"@babel/helpers - typeof";return _d=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},_d(e)}function vL(){return vL=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},yc=function(t){return Xc(t)&&t.indexOf("%")===t.length-1},we=function(t){return qde(t)&&!yv(t)},eve=function(t){return dt(t)},Vr=function(t){return we(t)||Xc(t)},tve=0,xv=function(t){var r=++tve;return"".concat(t||"").concat(r)},qc=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)&&!Xc(t))return n;var a;if(yc(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return yv(a)&&(a=n),i&&a>r&&(a=r),a},yh=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},rve=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 uve(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 rL(e){"@babel/helpers - typeof";return rL=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},rL(e)}var b3={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"},bs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},w3=null,iC=null,aD=function e(t){if(t===w3&&Array.isArray(iC))return iC;var r=[];return W.Children.forEach(t,function(n){dt(n)||(Hde.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),iC=r,w3=t,r};function oa(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return bs(i)}):n=[bs(t)],aD(e).forEach(function(i){var a=aa(i,"type.displayName")||aa(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function xi(e,t){var r=oa(e,t);return r&&r[0]}var S3=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)},cve=["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"],fve=function(t){return t&&t.type&&Xc(t.type)&&cve.indexOf(t.type)>=0},YZ=function(t){return t&&rL(t)==="object"&&"clipDot"in t},hve=function(t,r,n,i){var a,o=(a=nC==null?void 0:nC[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!ft(t)&&(i&&o.includes(r)||ave.includes(r))||n&&iD.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),!vv(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;hve((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},nL=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 T3(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 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 aL(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=gve(e,pve),c=i||{width:r,height:n,x:0,y:0},f=xt("recharts-surface",a);return Q.createElement("svg",iL({},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 yve=["children","className"];function oL(){return oL=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 _ve(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 Xt=Q.forwardRef(function(e,t){var r=e.children,n=e.className,i=xve(e,yve),a=xt("recharts-layer",n);return Q.createElement("g",oL({className:a},ct(i,!0),{ref:t}),r)}),Oc=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:Sve(e,t,r)}var Ave=Tve,Cve="\\ud800-\\udfff",Mve="\\u0300-\\u036f",Pve="\\ufe20-\\ufe2f",Lve="\\u20d0-\\u20ff",kve=Mve+Pve+Lve,Ive="\\ufe0e\\ufe0f",Ove="\\u200d",Eve=RegExp("["+Ove+Cve+kve+Ive+"]");function Dve(e){return Eve.test(e)}var XZ=Dve;function Nve(e){return e.split("")}var jve=Nve,qZ="\\ud800-\\udfff",Rve="\\u0300-\\u036f",Bve="\\ufe20-\\ufe2f",zve="\\u20d0-\\u20ff",$ve=Rve+Bve+zve,Fve="\\ufe0e\\ufe0f",Vve="["+qZ+"]",sL="["+$ve+"]",lL="\\ud83c[\\udffb-\\udfff]",Gve="(?:"+sL+"|"+lL+")",KZ="[^"+qZ+"]",QZ="(?:\\ud83c[\\udde6-\\uddff]){2}",JZ="[\\ud800-\\udbff][\\udc00-\\udfff]",Wve="\\u200d",eY=Gve+"?",tY="["+Fve+"]?",Hve="(?:"+Wve+"(?:"+[KZ,QZ,JZ].join("|")+")"+tY+eY+")*",Uve=tY+eY+Hve,Zve="(?:"+[KZ+sL+"?",sL,QZ,JZ,Vve].join("|")+")",Yve=RegExp(lL+"(?="+lL+")|"+Zve+Uve,"g");function Xve(e){return e.match(Yve)||[]}var qve=Xve,Kve=jve,Qve=XZ,Jve=qve;function epe(e){return Qve(e)?Jve(e):Kve(e)}var tpe=epe,rpe=Ave,npe=XZ,ipe=tpe,ape=VZ;function ope(e){return function(t){t=ape(t);var r=npe(t)?ipe(t):void 0,n=r?r[0]:t.charAt(0),i=r?rpe(r,1).join(""):t.slice(1);return n[e]()+i}}var spe=ope,lpe=spe,upe=lpe("toUpperCase"),cpe=upe;const RS=Ft(cpe);function Zt(e){return function(){return e}}const rY=Math.cos,Ub=Math.sin,Xa=Math.sqrt,Zb=Math.PI,BS=2*Zb,uL=Math.PI,cL=2*uL,rc=1e-6,fpe=cL-rc;function nY(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nY;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;irc)if(!(Math.abs(f*l-u*c)>rc)||!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((uL-Math.acos((g+h-m)/(2*y*_)))/2),S=b/_,T=b/y;Math.abs(S-1)>rc&&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)>rc||Math.abs(this._y1-c)>rc)&&this._append`L${u},${c}`,n&&(h<0&&(h=h%cL+cL),h>fpe?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>rc&&this._append`A${n},${n},0,${+(h>=uL)},${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 oD(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 dpe(t)}function sD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iY(e){this._context=e}iY.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 zS(e){return new iY(e)}function aY(e){return e[0]}function oY(e){return e[1]}function sY(e,t){var r=Zt(!0),n=null,i=zS,a=null,o=oD(s);e=typeof e=="function"?e:e===void 0?aY:Zt(e),t=typeof t=="function"?t:t===void 0?oY:Zt(t);function s(l){var u,c=(l=sD(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 sY().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Zt(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Zt(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Zt(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Zt(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Zt(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Zt(+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:Zt(!!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 lY{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 vpe(e){return new lY(e,!0)}function ppe(e){return new lY(e,!1)}const lD={draw(e,t){const r=Xa(t/Zb);e.moveTo(r,0),e.arc(0,0,r,0,BS)}},gpe={draw(e,t){const r=Xa(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()}},uY=Xa(1/3),mpe=uY*2,ype={draw(e,t){const r=Xa(t/mpe),n=r*uY;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},xpe={draw(e,t){const r=Xa(t),n=-r/2;e.rect(n,n,r,r)}},_pe=.8908130915292852,cY=Ub(Zb/10)/Ub(7*Zb/10),bpe=Ub(BS/10)*cY,wpe=-rY(BS/10)*cY,Spe={draw(e,t){const r=Xa(t*_pe),n=bpe*r,i=wpe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=BS*a/5,s=rY(o),l=Ub(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},aC=Xa(3),Tpe={draw(e,t){const r=-Xa(t/(aC*3));e.moveTo(0,r*2),e.lineTo(-aC*r,-r),e.lineTo(aC*r,-r),e.closePath()}},$i=-.5,Fi=Xa(3)/2,fL=1/Xa(12),Ape=(fL/2+1)*3,Cpe={draw(e,t){const r=Xa(t/Ape),n=r/2,i=r*fL,a=n,o=r*fL+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 Mpe(e,t){let r=null,n=oD(i);e=typeof e=="function"?e:Zt(e||lD),t=typeof t=="function"?t:Zt(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:Zt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Zt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Yb(){}function Xb(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 fY(e){this._context=e}fY.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:Xb(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:Xb(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ppe(e){return new fY(e)}function hY(e){this._context=e}hY.prototype={areaStart:Yb,areaEnd:Yb,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:Xb(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lpe(e){return new hY(e)}function dY(e){this._context=e}dY.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:Xb(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kpe(e){return new dY(e)}function vY(e){this._context=e}vY.prototype={areaStart:Yb,areaEnd:Yb,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 Ipe(e){return new vY(e)}function C3(e){return e<0?-1:1}function M3(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(C3(a)+C3(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function P3(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function oC(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 qb(e){this._context=e}qb.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:oC(this,this._t0,P3(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,oC(this,P3(this,r=M3(this,e,t)),r);break;default:oC(this,this._t0,r=M3(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 gY(e)}(pY.prototype=Object.create(qb.prototype)).point=function(e,t){qb.prototype.point.call(this,t,e)};function gY(e){this._context=e}gY.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 Ope(e){return new qb(e)}function Epe(e){return new pY(e)}function mY(e){this._context=e}mY.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=L3(e),i=L3(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 Npe(e){return new $S(e,.5)}function jpe(e){return new $S(e,0)}function Rpe(e){return new $S(e,1)}function _d(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 Bpe(e,t){return e[t]}function zpe(e){const t=[];return t.key=e,t}function $pe(){var e=Zt([]),t=hL,r=_d,n=Bpe;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 Xpe(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 yY={symbolCircle:lD,symbolCross:gpe,symbolDiamond:ype,symbolSquare:xpe,symbolStar:Spe,symbolTriangle:Tpe,symbolWye:Cpe},qpe=Math.PI/180,Kpe=function(t){var r="symbol".concat(RS(t));return yY[r]||lD},Qpe=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*qpe;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}},Jpe=function(t,r){yY["symbol".concat(RS(t))]=r},uD=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=Ype(t,Wpe),u=I3(I3({},l),{},{type:n,size:a,sizeType:s}),c=function(){var m=Kpe(n),y=Mpe().type(m).size(Qpe(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",dL({},v,{className:xt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:c()})):null};uD.registerSymbol=Jpe;function bd(e){"@babel/helpers - typeof";return bd=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},bd(e)}function vL(){return vL=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=d.inactive?u:d.color;return Q.createElement("li",vL({className:m,style:f,key:"legend-item-".concat(v)},Wb(n.props,d,v)),Q.createElement(aL,{width:o,height:o,viewBox:c,style:h},n.renderIcon(d)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},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);Tm(cD,"displayName","Legend");Tm(cD,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var uge=SS;function cge(){this.__data__=new uge,this.size=0}var fge=cge;function hge(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var dge=hge;function vge(e){return this.__data__.get(e)}var pge=vge;function gge(e){return this.__data__.has(e)}var mge=gge,yge=SS,xge=KE,_ge=QE,bge=200;function wge(e,t){var r=this.__data__;if(r instanceof yge){var n=r.__data__;if(!xge||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&Wge?new $ge:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=Yme}var vD=Xme,qme=Zs,Kme=vD,Qme=Ys,Jme="[object Arguments]",eye="[object Array]",tye="[object Boolean]",rye="[object Date]",nye="[object Error]",iye="[object Function]",aye="[object Map]",oye="[object Number]",sye="[object Object]",lye="[object RegExp]",uye="[object Set]",cye="[object String]",fye="[object WeakMap]",hye="[object ArrayBuffer]",dye="[object DataView]",vye="[object Float32Array]",pye="[object Float64Array]",gye="[object Int8Array]",mye="[object Int16Array]",yye="[object Int32Array]",xye="[object Uint8Array]",_ye="[object Uint8ClampedArray]",bye="[object Uint16Array]",wye="[object Uint32Array]",Kt={};Kt[vye]=Kt[pye]=Kt[gye]=Kt[mye]=Kt[yye]=Kt[xye]=Kt[_ye]=Kt[bye]=Kt[wye]=!0;Kt[Jme]=Kt[eye]=Kt[hye]=Kt[tye]=Kt[dye]=Kt[rye]=Kt[nye]=Kt[iye]=Kt[aye]=Kt[oye]=Kt[sye]=Kt[lye]=Kt[uye]=Kt[cye]=Kt[fye]=!1;function Sye(e){return Qme(e)&&Kme(e.length)&&!!Kt[qme(e)]}var Tye=Sye;function Aye(e){return function(t){return e(t)}}var LY=Aye,Jb={exports:{}};Jb.exports;(function(e,t){var r=jZ,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})(Jb,Jb.exports);var Cye=Jb.exports,Mye=Tye,Pye=LY,B3=Cye,z3=B3&&B3.isTypedArray,Lye=z3?Pye(z3):Mye,kY=Lye,kye=Eme,Iye=hD,Oye=di,Eye=PY,Dye=dD,Nye=kY,jye=Object.prototype,Rye=jye.hasOwnProperty;function Bye(e,t){var r=Oye(e),n=!r&&Iye(e),i=!r&&!n&&Eye(e),a=!r&&!n&&!i&&Nye(e),o=r||n||i||a,s=o?kye(e.length,String):[],l=s.length;for(var u in e)(t||Rye.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Dye(u,l)))&&s.push(u);return s}var zye=Bye,$ye=Object.prototype;function Fye(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||$ye;return e===r}var Vye=Fye;function Gye(e,t){return function(r){return e(t(r))}}var IY=Gye,Wye=IY,Hye=Wye(Object.keys,Object),Uye=Hye,Zye=Vye,Yye=Uye,Xye=Object.prototype,qye=Xye.hasOwnProperty;function Kye(e){if(!Zye(e))return Yye(e);var t=[];for(var r in Object(e))qye.call(e,r)&&r!="constructor"&&t.push(r);return t}var Qye=Kye,Jye=XE,e0e=vD;function t0e(e){return e!=null&&e0e(e.length)&&!Jye(e)}var $S=t0e,r0e=zye,n0e=Qye,i0e=$S;function a0e(e){return i0e(e)?r0e(e):n0e(e)}var pD=a0e,o0e=bme,s0e=Ime,l0e=pD;function u0e(e){return o0e(e,l0e,s0e)}var c0e=u0e,$3=c0e,f0e=1,h0e=Object.prototype,d0e=h0e.hasOwnProperty;function v0e(e,t,r,n,i,a){var o=r&f0e,s=$3(e),l=s.length,u=$3(t),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in t:d0e.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 d_e=h_e;function v_e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=L_e){var u=t?null:M_e(e);if(u)return P_e(u);o=!1,i=C_e,l=new S_e}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function H_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 U_e(e){return e.value}function Z_e(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var r=W_e(t,j_e);return Q.createElement(cD,r)}var rz=1,Jh=function(e){function t(){var r;R_e(this,t);for(var n=arguments.length,i=new Array(n),a=0;arz||Math.abs(i.height-this.lastBoundingBox.height)>rz)&&(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?Jo({},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 Jo(Jo({},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=Jo(Jo({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}},Z_e(a,Jo(Jo({},this.props),{},{payload:RY(c,u,U_e)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Jo(Jo({},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);FS(Jh,"displayName","Legend");FS(Jh,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var nz=Uy,Y_e=hD,X_e=di,iz=nz?nz.isConcatSpreadable:void 0;function q_e(e){return X_e(e)||Y_e(e)||!!(iz&&e&&e[iz])}var K_e=q_e,Q_e=CY,J_e=K_e;function $Y(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=J_e),i||(i=[]);++a0&&r(s)?t>1?$Y(s,t-1,r,n,i):Q_e(i,s):n||(i[i.length]=s)}return i}var FY=$Y;function ebe(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 tbe=ebe,rbe=tbe,nbe=rbe(),ibe=nbe,abe=ibe,obe=pD;function sbe(e,t){return e&&abe(e,t,obe)}var VY=sbe,lbe=$S;function ube(e,t){return function(r,n){if(r==null)return r;if(!lbe(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 Sbe=wbe,uC=eD,Tbe=tD,Abe=wv,Cbe=GY,Mbe=ybe,Pbe=LY,Lbe=Sbe,kbe=bv,Ibe=di;function Obe(e,t,r){t.length?t=uC(t,function(a){return Ibe(a)?function(o){return Tbe(o,a.length===1?a[0]:a)}:a}):t=[kbe];var n=-1;t=uC(t,Pbe(Abe));var i=Cbe(e,function(a,o,s){var l=uC(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Mbe(i,function(a,o){return Lbe(a,o,r)})}var Ebe=Obe;function Dbe(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 Nbe=Dbe,jbe=Nbe,oz=Math.max;function Rbe(e,t,r){return t=oz(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=oz(n.length-t,0),o=Array(a);++i0){if(++t>=Zbe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Kbe=qbe,Qbe=Ube,Jbe=Kbe,e1e=Jbe(Qbe),t1e=e1e,r1e=bv,n1e=Bbe,i1e=t1e;function a1e(e,t){return i1e(n1e(e,t,r1e),e+"")}var o1e=a1e,s1e=qE,l1e=$S,u1e=dD,c1e=cu;function f1e(e,t,r){if(!c1e(r))return!1;var n=typeof t;return(n=="number"?l1e(r)&&u1e(t,r.length):n=="string"&&t in r)?s1e(r[t],e):!1}var VS=f1e,h1e=FY,d1e=Ebe,v1e=o1e,lz=VS,p1e=v1e(function(e,t){if(e==null)return[];var r=t.length;return r>1&&lz(e,t[0],t[1])?t=[]:r>2&&lz(t[0],t[1],t[2])&&(t=[t[0]]),d1e(e,h1e(t,1),[])}),g1e=p1e;const yD=$t(g1e);function Am(e){"@babel/helpers - typeof";return Am=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},Am(e)}function wL(){return wL=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(mp,"-left"),we(r)&&t&&we(t.x)&&r=t.y),"".concat(mp,"-top"),we(n)&&t&&we(t.y)&&ng?Math.max(c,l[n]):Math.max(f,l[n])}function I1e(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 O1e(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=fz({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=fz({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=I1e({translateX:c,translateY:f,useTranslate3d:s})):u=L1e,{cssProperties:u,cssClasses:k1e({translateX:c,translateY:f,coordinate:r})}}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 hz(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 dz(e){for(var t=1;tvz||Math.abs(n.height-this.state.lastBoundingBox.height)>vz)&&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,x=i.wrapperStyle,b=O1e({allowEscapeViewBox:o,coordinate:c,offsetTopLeft:d,position:v,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:y}),S=b.cssClasses,T=b.cssProperties,A=dz(dz({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},x);return Q.createElement("div",{tabIndex:-1,className:S,style:A,ref:function(P){n.wrapperNode=P}},u)}}])}(W.PureComponent),V1e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},pf={isSsr:V1e()};function Sd(e){"@babel/helpers - typeof";return Sd=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},Sd(e)}function pz(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 gz(e){for(var t=1;t0;return Q.createElement(F1e,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:c,hasPayload:A,offset:d,position:m,reverseDirection:y,useTranslate3d:x,viewBox:b,wrapperStyle:S},Q1e(u,gz(gz({},this.props),{},{payload:T})))}}])}(W.PureComponent);xD(os,"displayName","Tooltip");xD(os,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!pf.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 J1e=Ho,ewe=function(){return J1e.Date.now()},twe=ewe,rwe=/\s/;function nwe(e){for(var t=e.length;t--&&rwe.test(e.charAt(t)););return t}var iwe=nwe,awe=iwe,owe=/^\s+/;function swe(e){return e&&e.slice(0,awe(e)+1).replace(owe,"")}var lwe=swe,uwe=lwe,mz=cu,cwe=hv,yz=NaN,fwe=/^[-+]0x[0-9a-f]+$/i,hwe=/^0b[01]+$/i,dwe=/^0o[0-7]+$/i,vwe=parseInt;function pwe(e){if(typeof e=="number")return e;if(cwe(e))return yz;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=uwe(e);var r=hwe.test(e);return r||dwe.test(e)?vwe(e.slice(2),r?2:8):fwe.test(e)?yz:+e}var XY=pwe,gwe=cu,fC=twe,xz=XY,mwe="Expected a function",ywe=Math.max,xwe=Math.min;function _we(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(mwe);t=xz(t)||0,gwe(r)&&(c=!!r.leading,f="maxWait"in r,a=f?ywe(xz(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function d(A){var M=n,P=i;return n=i=void 0,u=A,o=e.apply(P,M),o}function v(A){return u=A,s=setTimeout(y,t),c?d(A):o}function g(A){var M=A-l,P=A-u,k=t-M;return f?xwe(k,a-P):k}function m(A){var M=A-l,P=A-u;return l===void 0||M>=t||M<0||f&&P>=a}function y(){var A=fC();if(m(A))return x(A);s=setTimeout(y,g(A))}function x(A){return s=void 0,h&&n?d(A):(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:x(fC())}function T(){var A=fC(),M=m(A);if(n=arguments,i=this,l=A,M){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 bwe=_we,wwe=bwe,Swe=cu,Twe="Expected a function";function Awe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Twe);return Swe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),wwe(e,t,{leading:n,maxWait:t,trailing:i})}var Cwe=Awe;const qY=$t(Cwe);function Mm(e){"@babel/helpers - typeof";return Mm=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},Mm(e)}function _z(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 lx(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(N=qY(N,g,{trailing:!0,leading:!1}));var B=new ResizeObserver(N),$=T.current.getBoundingClientRect(),F=$.width,G=$.height;return O(F,G),B.observe(T.current),function(){B.disconnect()}},[O,g]);var D=W.useMemo(function(){var N=k.containerWidth,B=k.containerHeight;if(N<0||B<0)return null;Ic(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),Ic(!r||r>0,"The aspect(%s) must be greater than zero.",r);var $=mc(o)?N:o,F=mc(l)?B:l;r&&r>0&&($?F=$/r:F&&($=F*r),h&&F>h&&(F=h)),Ic($>0||F>0,`The width(%s) and height(%s) of chart should be greater than 0, + 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=ege({},n);return delete u.legendIcon,Q.cloneElement(n.legendIcon,u)}return Q.createElement(uD,{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=xt(Am(Am({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",d.inactive));if(d.type==="none")return null;var y=ft(d.value)?null:d.value;Oc(!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",vL({className:m,style:f,key:"legend-item-".concat(v)},Hb(n.props,d,v)),Q.createElement(aL,{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);Am(cD,"displayName","Legend");Am(cD,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var uge=TS;function cge(){this.__data__=new uge,this.size=0}var fge=cge;function hge(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var dge=hge;function vge(e){return this.__data__.get(e)}var pge=vge;function gge(e){return this.__data__.has(e)}var mge=gge,yge=TS,xge=KE,_ge=QE,bge=200;function wge(e,t){var r=this.__data__;if(r instanceof yge){var n=r.__data__;if(!xge||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&Wge?new $ge:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=Yme}var vD=Xme,qme=Zs,Kme=vD,Qme=Ys,Jme="[object Arguments]",eye="[object Array]",tye="[object Boolean]",rye="[object Date]",nye="[object Error]",iye="[object Function]",aye="[object Map]",oye="[object Number]",sye="[object Object]",lye="[object RegExp]",uye="[object Set]",cye="[object String]",fye="[object WeakMap]",hye="[object ArrayBuffer]",dye="[object DataView]",vye="[object Float32Array]",pye="[object Float64Array]",gye="[object Int8Array]",mye="[object Int16Array]",yye="[object Int32Array]",xye="[object Uint8Array]",_ye="[object Uint8ClampedArray]",bye="[object Uint16Array]",wye="[object Uint32Array]",Kt={};Kt[vye]=Kt[pye]=Kt[gye]=Kt[mye]=Kt[yye]=Kt[xye]=Kt[_ye]=Kt[bye]=Kt[wye]=!0;Kt[Jme]=Kt[eye]=Kt[hye]=Kt[tye]=Kt[dye]=Kt[rye]=Kt[nye]=Kt[iye]=Kt[aye]=Kt[oye]=Kt[sye]=Kt[lye]=Kt[uye]=Kt[cye]=Kt[fye]=!1;function Sye(e){return Qme(e)&&Kme(e.length)&&!!Kt[qme(e)]}var Tye=Sye;function Aye(e){return function(t){return e(t)}}var LY=Aye,e1={exports:{}};e1.exports;(function(e,t){var r=jZ,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})(e1,e1.exports);var Cye=e1.exports,Mye=Tye,Pye=LY,B3=Cye,z3=B3&&B3.isTypedArray,Lye=z3?Pye(z3):Mye,kY=Lye,kye=Eme,Iye=hD,Oye=di,Eye=PY,Dye=dD,Nye=kY,jye=Object.prototype,Rye=jye.hasOwnProperty;function Bye(e,t){var r=Oye(e),n=!r&&Iye(e),i=!r&&!n&&Eye(e),a=!r&&!n&&!i&&Nye(e),o=r||n||i||a,s=o?kye(e.length,String):[],l=s.length;for(var u in e)(t||Rye.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Dye(u,l)))&&s.push(u);return s}var zye=Bye,$ye=Object.prototype;function Fye(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||$ye;return e===r}var Vye=Fye;function Gye(e,t){return function(r){return e(t(r))}}var IY=Gye,Wye=IY,Hye=Wye(Object.keys,Object),Uye=Hye,Zye=Vye,Yye=Uye,Xye=Object.prototype,qye=Xye.hasOwnProperty;function Kye(e){if(!Zye(e))return Yye(e);var t=[];for(var r in Object(e))qye.call(e,r)&&r!="constructor"&&t.push(r);return t}var Qye=Kye,Jye=XE,e0e=vD;function t0e(e){return e!=null&&e0e(e.length)&&!Jye(e)}var FS=t0e,r0e=zye,n0e=Qye,i0e=FS;function a0e(e){return i0e(e)?r0e(e):n0e(e)}var pD=a0e,o0e=bme,s0e=Ime,l0e=pD;function u0e(e){return o0e(e,l0e,s0e)}var c0e=u0e,$3=c0e,f0e=1,h0e=Object.prototype,d0e=h0e.hasOwnProperty;function v0e(e,t,r,n,i,a){var o=r&f0e,s=$3(e),l=s.length,u=$3(t),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in t:d0e.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 d_e=h_e;function v_e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=L_e){var u=t?null:M_e(e);if(u)return P_e(u);o=!1,i=C_e,l=new S_e}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function H_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 U_e(e){return e.value}function Z_e(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var r=W_e(t,j_e);return Q.createElement(cD,r)}var rz=1,ed=function(e){function t(){var r;R_e(this,t);for(var n=arguments.length,i=new Array(n),a=0;arz||Math.abs(i.height-this.lastBoundingBox.height)>rz)&&(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?Jo({},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 Jo(Jo({},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=Jo(Jo({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}},Z_e(a,Jo(Jo({},this.props),{},{payload:RY(c,u,U_e)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Jo(Jo({},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);VS(ed,"displayName","Legend");VS(ed,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var nz=Zy,Y_e=hD,X_e=di,iz=nz?nz.isConcatSpreadable:void 0;function q_e(e){return X_e(e)||Y_e(e)||!!(iz&&e&&e[iz])}var K_e=q_e,Q_e=CY,J_e=K_e;function $Y(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=J_e),i||(i=[]);++a0&&r(s)?t>1?$Y(s,t-1,r,n,i):Q_e(i,s):n||(i[i.length]=s)}return i}var FY=$Y;function ebe(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 tbe=ebe,rbe=tbe,nbe=rbe(),ibe=nbe,abe=ibe,obe=pD;function sbe(e,t){return e&&abe(e,t,obe)}var VY=sbe,lbe=FS;function ube(e,t){return function(r,n){if(r==null)return r;if(!lbe(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 Sbe=wbe,cC=eD,Tbe=tD,Abe=Sv,Cbe=GY,Mbe=ybe,Pbe=LY,Lbe=Sbe,kbe=wv,Ibe=di;function Obe(e,t,r){t.length?t=cC(t,function(a){return Ibe(a)?function(o){return Tbe(o,a.length===1?a[0]:a)}:a}):t=[kbe];var n=-1;t=cC(t,Pbe(Abe));var i=Cbe(e,function(a,o,s){var l=cC(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Mbe(i,function(a,o){return Lbe(a,o,r)})}var Ebe=Obe;function Dbe(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 Nbe=Dbe,jbe=Nbe,oz=Math.max;function Rbe(e,t,r){return t=oz(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=oz(n.length-t,0),o=Array(a);++i0){if(++t>=Zbe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Kbe=qbe,Qbe=Ube,Jbe=Kbe,e1e=Jbe(Qbe),t1e=e1e,r1e=wv,n1e=Bbe,i1e=t1e;function a1e(e,t){return i1e(n1e(e,t,r1e),e+"")}var o1e=a1e,s1e=qE,l1e=FS,u1e=dD,c1e=fu;function f1e(e,t,r){if(!c1e(r))return!1;var n=typeof t;return(n=="number"?l1e(r)&&u1e(t,r.length):n=="string"&&t in r)?s1e(r[t],e):!1}var GS=f1e,h1e=FY,d1e=Ebe,v1e=o1e,lz=GS,p1e=v1e(function(e,t){if(e==null)return[];var r=t.length;return r>1&&lz(e,t[0],t[1])?t=[]:r>2&&lz(t[0],t[1],t[2])&&(t=[t[0]]),d1e(e,h1e(t,1),[])}),g1e=p1e;const yD=Ft(g1e);function Cm(e){"@babel/helpers - typeof";return Cm=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},Cm(e)}function wL(){return wL=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(yp,"-left"),we(r)&&t&&we(t.x)&&r=t.y),"".concat(yp,"-top"),we(n)&&t&&we(t.y)&&ng?Math.max(c,l[n]):Math.max(f,l[n])}function I1e(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 O1e(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=fz({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=fz({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=I1e({translateX:c,translateY:f,useTranslate3d:s})):u=L1e,{cssProperties:u,cssClasses:k1e({translateX:c,translateY:f,coordinate:r})}}function Sd(e){"@babel/helpers - typeof";return Sd=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},Sd(e)}function hz(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 dz(e){for(var t=1;tvz||Math.abs(n.height-this.state.lastBoundingBox.height)>vz)&&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=O1e({allowEscapeViewBox:o,coordinate:c,offsetTopLeft:d,position:v,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:y}),S=b.cssClasses,T=b.cssProperties,A=dz(dz({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:A,ref:function(P){n.wrapperNode=P}},u)}}])}(W.PureComponent),V1e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},gf={isSsr:V1e()};function Td(e){"@babel/helpers - typeof";return Td=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},Td(e)}function pz(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 gz(e){for(var t=1;t0;return Q.createElement(F1e,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:c,hasPayload:A,offset:d,position:m,reverseDirection:y,useTranslate3d:_,viewBox:b,wrapperStyle:S},Q1e(u,gz(gz({},this.props),{},{payload:T})))}}])}(W.PureComponent);xD(os,"displayName","Tooltip");xD(os,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!gf.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 J1e=Ho,ewe=function(){return J1e.Date.now()},twe=ewe,rwe=/\s/;function nwe(e){for(var t=e.length;t--&&rwe.test(e.charAt(t)););return t}var iwe=nwe,awe=iwe,owe=/^\s+/;function swe(e){return e&&e.slice(0,awe(e)+1).replace(owe,"")}var lwe=swe,uwe=lwe,mz=fu,cwe=dv,yz=NaN,fwe=/^[-+]0x[0-9a-f]+$/i,hwe=/^0b[01]+$/i,dwe=/^0o[0-7]+$/i,vwe=parseInt;function pwe(e){if(typeof e=="number")return e;if(cwe(e))return yz;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=uwe(e);var r=hwe.test(e);return r||dwe.test(e)?vwe(e.slice(2),r?2:8):fwe.test(e)?yz:+e}var XY=pwe,gwe=fu,hC=twe,xz=XY,mwe="Expected a function",ywe=Math.max,xwe=Math.min;function _we(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(mwe);t=xz(t)||0,gwe(r)&&(c=!!r.leading,f="maxWait"in r,a=f?ywe(xz(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function d(A){var M=n,P=i;return n=i=void 0,u=A,o=e.apply(P,M),o}function v(A){return u=A,s=setTimeout(y,t),c?d(A):o}function g(A){var M=A-l,P=A-u,k=t-M;return f?xwe(k,a-P):k}function m(A){var M=A-l,P=A-u;return l===void 0||M>=t||M<0||f&&P>=a}function y(){var A=hC();if(m(A))return _(A);s=setTimeout(y,g(A))}function _(A){return s=void 0,h&&n?d(A):(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:_(hC())}function T(){var A=hC(),M=m(A);if(n=arguments,i=this,l=A,M){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 bwe=_we,wwe=bwe,Swe=fu,Twe="Expected a function";function Awe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Twe);return Swe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),wwe(e,t,{leading:n,maxWait:t,trailing:i})}var Cwe=Awe;const qY=Ft(Cwe);function Pm(e){"@babel/helpers - typeof";return Pm=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},Pm(e)}function _z(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 ux(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(N=qY(N,g,{trailing:!0,leading:!1}));var B=new ResizeObserver(N),$=T.current.getBoundingClientRect(),F=$.width,G=$.height;return O(F,G),B.observe(T.current),function(){B.disconnect()}},[O,g]);var D=W.useMemo(function(){var N=k.containerWidth,B=k.containerHeight;if(N<0||B<0)return null;Oc(yc(o)||yc(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),Oc(!r||r>0,"The aspect(%s) must be greater than zero.",r);var $=yc(o)?N:o,F=yc(l)?B:l;r&&r>0&&($?F=$/r:F&&($=F*r),h&&F>h&&(F=h)),Oc($>0||F>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 G=!Array.isArray(d)&&bs(d.type).endsWith("Chart");return Q.Children.map(d,function(z){return Q.isValidElement(z)?W.cloneElement(z,lx({width:$,height:F},G?{style:lx({height:"100%",width:"100%",maxHeight:F,maxWidth:$},z.props.style)}:{})):z})},[r,d,l,h,f,c,k,o]);return Q.createElement("div",{id:m?"".concat(m):void 0,className:xt("recharts-responsive-container",y),style:lx(lx({},S),{},{width:o,height:l,minWidth:c,minHeight:f,maxHeight:h}),ref:T},D)}),QY=function(t){return null};QY.displayName="Cell";function Pm(e){"@babel/helpers - typeof";return Pm=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},Pm(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 CL(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||pf.isSsr)return{width:0,height:0};var n=$we(r),i=JSON.stringify({text:t,copyStyle:n});if($f.widthCache[i])return $f.widthCache[i];try{var a=document.getElementById(Sz);a||(a=document.createElement("span"),a.setAttribute("id",Sz),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=CL(CL({},zwe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return $f.widthCache[i]=l,++$f.cacheCount>Bwe&&($f.cacheCount=0,$f.widthCache={}),l}catch{return{width:0,height:0}}},Fwe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Lm(e){"@babel/helpers - typeof";return Lm=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},Lm(e)}function n1(e,t){return Hwe(e)||Wwe(e,t)||Gwe(e,t)||Vwe()}function Vwe(){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 Gwe(e,t){if(e){if(typeof e=="string")return Tz(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 Tz(e,t)}}function Tz(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 aSe(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 kz(e,t){return uSe(e)||lSe(e,t)||sSe(e,t)||oSe()}function oSe(){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 sSe(e,t){if(e){if(typeof e=="string")return Iz(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 Iz(e,t)}}function Iz(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 $.reduce(function(F,G){var z=G.word,U=G.width,H=F[F.length-1];if(H&&(i==null||a||H.width+U+nG.width?F:G})};if(!c)return d;for(var g="…",m=function($){var F=f.slice(0,$),G=rX({breakAll:u,style:l,children:F+g}).wordsWithComputedWidth,z=h(G),U=z.length>o||v(z).width>Number(i);return[U,z]},y=0,x=f.length-1,b=0,S;y<=x&&b<=f.length-1;){var T=Math.floor((y+x)/2),A=T-1,M=m(A),P=kz(M,2),k=P[0],I=P[1],O=m(T),D=kz(O,1),N=D[0];if(!k&&!N&&(y=T+1),k&&N&&(x=T-1),!k&&N){S=I;break}b++}return S||d},Oz=function(t){var r=dt(t)?[]:t.toString().split(tX);return[{words:r}]},fSe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!pf.isSsr){var l,u,c=rX({breakAll:o,children:i,style:a});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;l=f,u=h}else return Oz(i);return cSe({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return Oz(i)},Ez="#808080",i1=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?Ez:m,x=Lz(t,nSe),b=W.useMemo(function(){return fSe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),S=x.dx,T=x.dy,A=x.angle,M=x.className,P=x.breakAll,k=Lz(x,iSe);if(!Vr(n)||!Vr(a))return null;var I=n+(we(S)?S:0),O=a+(we(T)?T:0),D;switch(g){case"start":D=hC("calc(".concat(u,")"));break;case"middle":D=hC("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:D=hC("calc(".concat(b.length-1," * -").concat(s,")"));break}var N=[];if(f){var B=b[0].width,$=x.width;N.push("scale(".concat((we($)?$/B:1)/B,")"))}return A&&N.push("rotate(".concat(A,", ").concat(I,", ").concat(O,")")),N.length&&(k.transform=N.join(" ")),Q.createElement("text",ML({},ct(k,!0),{x:I,y:O,className:xt("recharts-text",M),textAnchor:d,fill:y.includes("url")?Ez:y}),b.map(function(F,G){var z=F.words.join(P?"":" ");return Q.createElement("tspan",{x:I,dy:G===0?D:s,key:"".concat(z,"-").concat(G)},z)}))};function Vl(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function hSe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function _D(e){let t,r,n;e.length!==2?(t=Vl,r=(s,l)=>Vl(e(s),l),n=(s,l)=>e(s)-l):(t=e===Vl||e===hSe?e:dSe,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 dSe(){return 0}function nX(e){return e===null?NaN:+e}function*vSe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const pSe=_D(Vl),Zy=pSe.right;_D(nX).center;class Dz extends Map{constructor(t,r=ySe){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(Nz(this,t))}has(t){return super.has(Nz(this,t))}set(t,r){return super.set(gSe(this,t),r)}delete(t){return super.delete(mSe(this,t))}}function Nz({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function gSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function mSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function ySe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xSe(e=Vl){if(e===Vl)return iX;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 iX(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const _Se=Math.sqrt(50),bSe=Math.sqrt(10),wSe=Math.sqrt(2);function a1(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>=_Se?10:a>=bSe?5:a>=wSe?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 Rz(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function aX(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?iX:xSe(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));aX(e,t,d,v,i)}const a=e[t];let o=r,s=n;for(yp(e,r,t),i(e[n],a)>0&&yp(e,r,n);o0;)--s}i(e[r],a)===0?yp(e,r,s):(++s,yp(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function yp(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function SSe(e,t,r){if(e=Float64Array.from(vSe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Rz(e);if(t>=1)return jz(e);var n,i=(n-1)*t,a=Math.floor(i),o=jz(aX(e,a).subarray(0,a+1)),s=Rz(e.subarray(a+1));return o+(s-o)*(i-a)}}function TSe(e,t,r=nX){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 ASe(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?cx(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?cx(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=MSe.exec(e))?new si(t[1],t[2],t[3],1):(t=PSe.exec(e))?new si(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LSe.exec(e))?cx(t[1],t[2],t[3],t[4]):(t=kSe.exec(e))?cx(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ISe.exec(e))?Wz(t[1],t[2]/100,t[3]/100,1):(t=OSe.exec(e))?Wz(t[1],t[2]/100,t[3]/100,t[4]):Bz.hasOwnProperty(e)?Fz(Bz[e]):e==="transparent"?new si(NaN,NaN,NaN,0):null}function Fz(e){return new si(e>>16&255,e>>8&255,e&255,1)}function cx(e,t,r,n){return n<=0&&(e=t=r=NaN),new si(e,t,r,n)}function NSe(e){return e instanceof Yy||(e=Em(e)),e?(e=e.rgb(),new si(e.r,e.g,e.b,e.opacity)):new si}function OL(e,t,r,n){return arguments.length===1?NSe(e):new si(e,t,r,n??1)}function si(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}wD(si,OL,sX(Yy,{brighter(e){return e=e==null?o1:Math.pow(o1,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Im:Math.pow(Im,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new si(Oc(this.r),Oc(this.g),Oc(this.b),s1(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:Vz,formatHex:Vz,formatHex8:jSe,formatRgb:Gz,toString:Gz}));function Vz(){return`#${yc(this.r)}${yc(this.g)}${yc(this.b)}`}function jSe(){return`#${yc(this.r)}${yc(this.g)}${yc(this.b)}${yc((isNaN(this.opacity)?1:this.opacity)*255)}`}function Gz(){const e=s1(this.opacity);return`${e===1?"rgb(":"rgba("}${Oc(this.r)}, ${Oc(this.g)}, ${Oc(this.b)}${e===1?")":`, ${e})`}`}function s1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yc(e){return e=Oc(e),(e<16?"0":"")+e.toString(16)}function Wz(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Na(e,t,r,n)}function lX(e){if(e instanceof Na)return new Na(e.h,e.s,e.l,e.opacity);if(e instanceof Yy||(e=Em(e)),!e)return new Na;if(e instanceof Na)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 Na(o,s,l,e.opacity)}function RSe(e,t,r,n){return arguments.length===1?lX(e):new Na(e,t,r,n??1)}function Na(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}wD(Na,RSe,sX(Yy,{brighter(e){return e=e==null?o1:Math.pow(o1,e),new Na(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Im:Math.pow(Im,e),new Na(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 si(dC(e>=240?e-240:e+120,i,n),dC(e,i,n),dC(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Na(Hz(this.h),fx(this.s),fx(this.l),s1(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=s1(this.opacity);return`${e===1?"hsl(":"hsla("}${Hz(this.h)}, ${fx(this.s)*100}%, ${fx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Hz(e){return e=(e||0)%360,e<0?e+360:e}function fx(e){return Math.max(0,Math.min(1,e||0))}function dC(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 SD=e=>()=>e;function BSe(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 $Se(e){return(e=+e)==1?uX:function(t,r){return r-t?zSe(t,r,e):SD(isNaN(t)?r:t)}}function uX(e,t){var r=t-e;return r?BSe(e,r):SD(isNaN(e)?t:e)}const Uz=function e(t){var r=$Se(t);function n(i,a){var o=r((i=OL(i)).r,(a=OL(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=uX(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 FSe(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:l1(n,i)})),r=vC.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function QSe(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?JSe:QSe,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),l1)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,u1),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=TD,c()},f.clamp=function(h){return arguments.length?(o=h?!0:Gn,c()):o!==Gn},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 AD(){return GS()(Gn,Gn)}function eTe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function c1(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 Td(e){return e=c1(Math.abs(e)),e?e[1]:NaN}function tTe(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 rTe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var nTe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Dm(e){if(!(t=nTe.exec(e)))throw new Error("invalid format: "+e);var t;return new CD({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]})}Dm.prototype=CD.prototype;function CD(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+""}CD.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 iTe(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 f1;function aTe(e,t){var r=c1(e,t);if(!r)return f1=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(f1=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")+c1(e,Math.max(0,t+a-1))[0]}function Yz(e,t){var r=c1(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 Xz={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:eTe,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)=>Yz(e*100,t),r:Yz,s:aTe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qz(e){return e}var Kz=Array.prototype.map,Qz=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oTe(e){var t=e.grouping===void 0||e.thousands===void 0?qz:tTe(Kz.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?qz:rTe(Kz.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=Dm(f);var d=f.fill,v=f.align,g=f.sign,m=f.symbol,y=f.zero,x=f.width,b=f.comma,S=f.precision,T=f.trim,A=f.type;A==="n"?(b=!0,A="g"):Xz[A]||(S===void 0&&(S=12),T=!0,A="g"),(y||d==="0"&&v==="=")&&(y=!0,d="0",v="=");var M=(h&&h.prefix!==void 0?h.prefix:"")+(m==="$"?r:m==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),P=(m==="$"?n:/[%p]/.test(A)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),k=Xz[A],I=/[defgprs%]/.test(A);S=S===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function O(D){var N=M,B=P,$,F,G;if(A==="c")B=k(D)+B,D="";else{D=+D;var z=D<0||1/D<0;if(D=isNaN(D)?l:k(Math.abs(D),S),T&&(D=iTe(D)),z&&+D==0&&g!=="+"&&(z=!1),N=(z?g==="("?g:s:g==="-"||g==="("?"":g)+N,B=(A==="s"&&!isNaN(D)&&f1!==void 0?Qz[8+f1/3]:"")+B+(z&&g==="("?")":""),I){for($=-1,F=D.length;++$G||G>57){B=(G===46?i+D.slice($+1):D.slice($))+B,D=D.slice(0,$);break}}}b&&!y&&(D=t(D,1/0));var U=N.length+D.length+B.length,H=U>1)+N+D+B+H.slice(U);break;default:D=H+N+D+B;break}return a(D)}return O.toString=function(){return f+""},O}function c(f,h){var d=Math.max(-8,Math.min(8,Math.floor(Td(h)/3)))*3,v=Math.pow(10,-d),g=u((f=Dm(f),f.type="f",f),{suffix:Qz[8+d/3]});return function(m){return g(v*m)}}return{format:u,formatPrefix:c}}var hx,MD,cX;sTe({thousands:",",grouping:[3],currency:["$",""]});function sTe(e){return hx=oTe(e),MD=hx.format,cX=hx.formatPrefix,hx}function lTe(e){return Math.max(0,-Td(Math.abs(e)))}function uTe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Td(t)/3)))*3-Td(Math.abs(e)))}function cTe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Td(t)-Td(e))+1}function fX(e,t,r,n){var i=kL(e,t,r),a;switch(n=Dm(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=uTe(i,o))&&(n.precision=a),cX(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=cTe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=lTe(i))&&(n.precision=a-(n.type==="%")*2);break}}return MD(n)}function fu(e){var t=e.domain;return e.ticks=function(r){var n=t();return PL(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return fX(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=LL(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 h1(){var e=AD();return e.copy=function(){return Xy(e,h1())},ma.apply(e,arguments),fu(e)}function hX(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,u1),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return hX(e).unknown(t)},e=arguments.length?Array.from(e,u1):[0,1],fu(r)}function dX(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 pTe(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 t4(e){return(t,r)=>-e(-t,r)}function PD(e){const t=e(Jz,e4),r=t.domain;let n=10,i,a;function o(){return i=pTe(n),a=vTe(n),r()[0]<0?(i=t4(i),a=t4(a),e(fTe,hTe)):e(Jz,e4),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=Dm(l)).precision==null&&(l.trim=!0),l=MD(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(dX(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function vX(){const e=PD(GS()).domain([1,10]);return e.copy=()=>Xy(e,vX()).base(e.base()),ma.apply(e,arguments),e}function r4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function n4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function LD(e){var t=1,r=e(r4(t),n4(t));return r.constant=function(n){return arguments.length?e(r4(t=+n),n4(t)):t},fu(r)}function pX(){var e=LD(GS());return e.copy=function(){return Xy(e,pX()).constant(e.constant())},ma.apply(e,arguments)}function i4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function gTe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function mTe(e){return e<0?-e*e:e*e}function kD(e){var t=e(Gn,Gn),r=1;function n(){return r===1?e(Gn,Gn):r===.5?e(gTe,mTe):e(i4(r),i4(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},fu(t)}function ID(){var e=kD(GS());return e.copy=function(){return Xy(e,ID()).exponent(e.exponent())},ma.apply(e,arguments),e}function yTe(){return ID.apply(null,arguments).exponent(.5)}function a4(e){return Math.sign(e)*e*e}function xTe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function gX(){var e=AD(),t=[0,1],r=!1,n;function i(a){var o=xTe(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(a4(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,u1)).map(a4)),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 gX(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ma.apply(i,arguments),fu(i)}function mX(){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 yX().domain([e,t]).range(i).unknown(a)},ma.apply(fu(o),arguments)}function xX(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Zy(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 xX().domain(e).range(t).unknown(r)},ma.apply(i,arguments)}const pC=new Date,gC=new Date;function Yr(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(uYr(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)=>(pC.setTime(+a),gC.setTime(+o),e(pC),e(gC),Math.floor(r(pC,gC))),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 d1=Yr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);d1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):d1);d1.range;const ds=1e3,na=ds*60,vs=na*60,Ns=vs*24,OD=Ns*7,o4=Ns*30,mC=Ns*365,xc=Yr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ds)},(e,t)=>(t-e)/ds,e=>e.getUTCSeconds());xc.range;const ED=Yr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ds)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getMinutes());ED.range;const DD=Yr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getUTCMinutes());DD.range;const ND=Yr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ds-e.getMinutes()*na)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getHours());ND.range;const jD=Yr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getUTCHours());jD.range;const qy=Yr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*na)/Ns,e=>e.getDate()-1);qy.range;const WS=Yr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ns,e=>e.getUTCDate()-1);WS.range;const _X=Yr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ns,e=>Math.floor(e/Ns));_X.range;function gf(e){return Yr(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)/OD)}const HS=gf(0),v1=gf(1),_Te=gf(2),bTe=gf(3),Ad=gf(4),wTe=gf(5),STe=gf(6);HS.range;v1.range;_Te.range;bTe.range;Ad.range;wTe.range;STe.range;function mf(e){return Yr(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)/OD)}const US=mf(0),p1=mf(1),TTe=mf(2),ATe=mf(3),Cd=mf(4),CTe=mf(5),MTe=mf(6);US.range;p1.range;TTe.range;ATe.range;Cd.range;CTe.range;MTe.range;const RD=Yr(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());RD.range;const BD=Yr(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());BD.range;const js=Yr(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());js.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yr(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)});js.range;const Rs=Yr(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());Rs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yr(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)});Rs.range;function bX(e,t,r,n,i,a){const o=[[xc,1,ds],[xc,5,5*ds],[xc,15,15*ds],[xc,30,30*ds],[a,1,na],[a,5,5*na],[a,15,15*na],[a,30,30*na],[i,1,vs],[i,3,3*vs],[i,6,6*vs],[i,12,12*vs],[n,1,Ns],[n,2,2*Ns],[r,1,OD],[t,1,o4],[t,3,3*o4],[e,1,mC]];function s(u,c,f){const h=cm).right(o,h);if(d===o.length)return e.every(kL(u/mC,c/mC,f));if(d===0)return d1.every(Math.max(kL(u,c,f),1));const[v,g]=o[h/o[d-1][2]53)return null;"w"in ee||(ee.w=1),"Z"in ee?(Se=xC(xp(ee.y,0,1)),Fe=Se.getUTCDay(),Se=Fe>4||Fe===0?p1.ceil(Se):p1(Se),Se=WS.offset(Se,(ee.V-1)*7),ee.y=Se.getUTCFullYear(),ee.m=Se.getUTCMonth(),ee.d=Se.getUTCDate()+(ee.w+6)%7):(Se=yC(xp(ee.y,0,1)),Fe=Se.getDay(),Se=Fe>4||Fe===0?v1.ceil(Se):v1(Se),Se=qy.offset(Se,(ee.V-1)*7),ee.y=Se.getFullYear(),ee.m=Se.getMonth(),ee.d=Se.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),Fe="Z"in ee?xC(xp(ee.y,0,1)).getUTCDay():yC(xp(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-(Fe+5)%7:ee.w+ee.U*7-(Fe+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,xC(ee)):yC(ee)}}function P(ne,fe,le,ee){for(var $e=0,Se=fe.length,Fe=le.length,Ye,vt;$e=Fe)return-1;if(Ye=fe.charCodeAt($e++),Ye===37){if(Ye=fe.charAt($e++),vt=T[Ye in s4?fe.charAt($e++):Ye],!vt||(ee=vt(ne,le,ee))<0)return-1}else if(Ye!=le.charCodeAt(ee++))return-1}return ee}function k(ne,fe,le){var ee=u.exec(fe.slice(le));return ee?(ne.p=c.get(ee[0].toLowerCase()),le+ee[0].length):-1}function I(ne,fe,le){var ee=d.exec(fe.slice(le));return ee?(ne.w=v.get(ee[0].toLowerCase()),le+ee[0].length):-1}function O(ne,fe,le){var ee=f.exec(fe.slice(le));return ee?(ne.w=h.get(ee[0].toLowerCase()),le+ee[0].length):-1}function D(ne,fe,le){var ee=y.exec(fe.slice(le));return ee?(ne.m=x.get(ee[0].toLowerCase()),le+ee[0].length):-1}function N(ne,fe,le){var ee=g.exec(fe.slice(le));return ee?(ne.m=m.get(ee[0].toLowerCase()),le+ee[0].length):-1}function B(ne,fe,le){return P(ne,t,fe,le)}function $(ne,fe,le){return P(ne,r,fe,le)}function F(ne,fe,le){return P(ne,n,fe,le)}function G(ne){return o[ne.getDay()]}function z(ne){return a[ne.getDay()]}function U(ne){return l[ne.getMonth()]}function H(ne){return s[ne.getMonth()]}function Y(ne){return i[+(ne.getHours()>=12)]}function Z(ne){return 1+~~(ne.getMonth()/3)}function J(ne){return o[ne.getUTCDay()]}function ae(ne){return a[ne.getUTCDay()]}function ce(ne){return l[ne.getUTCMonth()]}function ge(ne){return s[ne.getUTCMonth()]}function Ge(ne){return i[+(ne.getUTCHours()>=12)]}function xe(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var fe=A(ne+="",b);return fe.toString=function(){return ne},fe},parse:function(ne){var fe=M(ne+="",!1);return fe.toString=function(){return ne},fe},utcFormat:function(ne){var fe=A(ne+="",S);return fe.toString=function(){return ne},fe},utcParse:function(ne){var fe=M(ne+="",!0);return fe.toString=function(){return ne},fe}}}var s4={"-":"",_:" ",0:"0"},ln=/^\s*\d+/,ETe=/^%/,DTe=/[\\^$*+?|[\]().{}]/g;function Ct(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function jTe(e,t,r){var n=ln.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function RTe(e,t,r){var n=ln.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function BTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function zTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function $Te(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function l4(e,t,r){var n=ln.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function u4(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function FTe(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 VTe(e,t,r){var n=ln.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function GTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function c4(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function WTe(e,t,r){var n=ln.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function f4(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function HTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function UTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function ZTe(e,t,r){var n=ln.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function YTe(e,t,r){var n=ln.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function XTe(e,t,r){var n=ETe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function qTe(e,t,r){var n=ln.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function KTe(e,t,r){var n=ln.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function h4(e,t){return Ct(e.getDate(),t,2)}function QTe(e,t){return Ct(e.getHours(),t,2)}function JTe(e,t){return Ct(e.getHours()%12||12,t,2)}function eAe(e,t){return Ct(1+qy.count(js(e),e),t,3)}function wX(e,t){return Ct(e.getMilliseconds(),t,3)}function tAe(e,t){return wX(e,t)+"000"}function rAe(e,t){return Ct(e.getMonth()+1,t,2)}function nAe(e,t){return Ct(e.getMinutes(),t,2)}function iAe(e,t){return Ct(e.getSeconds(),t,2)}function aAe(e){var t=e.getDay();return t===0?7:t}function oAe(e,t){return Ct(HS.count(js(e)-1,e),t,2)}function SX(e){var t=e.getDay();return t>=4||t===0?Ad(e):Ad.ceil(e)}function sAe(e,t){return e=SX(e),Ct(Ad.count(js(e),e)+(js(e).getDay()===4),t,2)}function lAe(e){return e.getDay()}function uAe(e,t){return Ct(v1.count(js(e)-1,e),t,2)}function cAe(e,t){return Ct(e.getFullYear()%100,t,2)}function fAe(e,t){return e=SX(e),Ct(e.getFullYear()%100,t,2)}function hAe(e,t){return Ct(e.getFullYear()%1e4,t,4)}function dAe(e,t){var r=e.getDay();return e=r>=4||r===0?Ad(e):Ad.ceil(e),Ct(e.getFullYear()%1e4,t,4)}function vAe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ct(t/60|0,"0",2)+Ct(t%60,"0",2)}function d4(e,t){return Ct(e.getUTCDate(),t,2)}function pAe(e,t){return Ct(e.getUTCHours(),t,2)}function gAe(e,t){return Ct(e.getUTCHours()%12||12,t,2)}function mAe(e,t){return Ct(1+WS.count(Rs(e),e),t,3)}function TX(e,t){return Ct(e.getUTCMilliseconds(),t,3)}function yAe(e,t){return TX(e,t)+"000"}function xAe(e,t){return Ct(e.getUTCMonth()+1,t,2)}function _Ae(e,t){return Ct(e.getUTCMinutes(),t,2)}function bAe(e,t){return Ct(e.getUTCSeconds(),t,2)}function wAe(e){var t=e.getUTCDay();return t===0?7:t}function SAe(e,t){return Ct(US.count(Rs(e)-1,e),t,2)}function AX(e){var t=e.getUTCDay();return t>=4||t===0?Cd(e):Cd.ceil(e)}function TAe(e,t){return e=AX(e),Ct(Cd.count(Rs(e),e)+(Rs(e).getUTCDay()===4),t,2)}function AAe(e){return e.getUTCDay()}function CAe(e,t){return Ct(p1.count(Rs(e)-1,e),t,2)}function MAe(e,t){return Ct(e.getUTCFullYear()%100,t,2)}function PAe(e,t){return e=AX(e),Ct(e.getUTCFullYear()%100,t,2)}function LAe(e,t){return Ct(e.getUTCFullYear()%1e4,t,4)}function kAe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Cd(e):Cd.ceil(e),Ct(e.getUTCFullYear()%1e4,t,4)}function IAe(){return"+0000"}function v4(){return"%"}function p4(e){return+e}function g4(e){return Math.floor(+e/1e3)}var Ff,CX,MX;OAe({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 OAe(e){return Ff=OTe(e),CX=Ff.format,Ff.parse,MX=Ff.utcFormat,Ff.utcParse,Ff}function EAe(e){return new Date(e)}function DAe(e){return e instanceof Date?+e:+new Date(+e)}function zD(e,t,r,n,i,a,o,s,l,u){var c=AD(),f=c.invert,h=c.domain,d=u(".%L"),v=u(":%S"),g=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),x=u("%b %d"),b=u("%B"),S=u("%Y");function T(A){return(l(A)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>SSe(e,a/n))},r.copy=function(){return IX(t).domain(e)},Xs.apply(r,arguments)}function YS(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Gn,c,f=!1,h;function d(g){return isNaN(g=+g)?h:(g=.5+((g=+c(g))-a)*(n*gt}var VAe=FAe,GAe=NX,WAe=VAe,HAe=bv;function UAe(e){return e&&e.length?GAe(e,HAe,WAe):void 0}var ZAe=UAe;const Tl=$t(ZAe);function YAe(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)*Qt;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 ws(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return Vt(ws(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(wi))throw Error(fa+"NaN");if(r.s<1)throw Error(fa+(r.s?"NaN":"-Infinity"));return r.eq(wi)?new n(0):(rr=!1,t=ws(Nm(r,a),Nm(e,a),a),rr=!0,Vt(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?zX(t,e):RX(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(fa+"NaN");return r.s?(rr=!1,t=ws(r,e,0,1).times(e),rr=!0,r.minus(t)):Vt(new n(r),i)};je.naturalExponential=je.exp=function(){return BX(this)};je.naturalLogarithm=je.ln=function(){return Nm(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?RX(t,e):zX(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(Ec+e);if(t=Er(i)+1,n=i.d.length-1,r=n*Qt+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(fa+"NaN")}for(e=Er(s),rr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=xo(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Av((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(ws(s,a,o+2)).times(.5),xo(a.d).slice(0,o)===(t=xo(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 rr=!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%en|0,t=s/en|0;a[i]=(a[i]+t)%en|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,rr?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:(jo(e,0,Tv),t===void 0?t=n.rounding:jo(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=qc(n,!0):(jo(e,0,Tv),t===void 0?t=i.rounding:jo(t,0,8),n=Vt(new i(n),e+1,t),r=qc(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?qc(i):(jo(e,0,Tv),t===void 0?t=a.rounding:jo(t,0,8),n=Vt(new a(i),e+Er(i)+1,t),r=qc(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(wi);if(s=new l(s),!s.s){if(e.s<1)throw Error(fa+"Infinity");return s}if(s.eq(wi))return s;if(n=l.precision,e.eq(wi))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)<=jX){for(i=new l(wi),t=Math.ceil(n/Qt+4),rr=!1;r%2&&(i=i.times(s),x4(i.d,t)),r=Av(r/2),r!==0;)s=s.times(s),x4(s.d,t);return rr=!0,e.s<0?new l(wi).div(i):Vt(i,n)}}else if(a<0)throw Error(fa+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,rr=!1,i=e.times(Nm(s,n+u)),rr=!0,i=BX(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=qc(i,r<=a.toExpNeg||r>=a.toExpPos)):(jo(e,1,Tv),t===void 0?t=a.rounding:jo(t,0,8),i=Vt(new a(i),e,t),r=Er(i),n=qc(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):(jo(e,1,Tv),t===void 0?t=n.rounding:jo(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 qc(e,t<=r.toExpNeg||t>=r.toExpPos)};function RX(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)),rr?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/Qt),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)/en|0,l[a]%=en;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,rr?Vt(t,f):t}function jo(e,t,r){if(e!==~~e||er)throw Error(Ec+e)}function xo(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,x,b,S,T,A,M,P,k=n.constructor,I=n.s==i.s?1:-1,O=n.d,D=i.d;if(!n.s)return new k(n);if(!i.s)throw Error(fa+"Division by zero");for(l=n.e-i.e,M=D.length,T=O.length,d=new k(I),v=d.d=[],u=0;D[u]==(O[u]||0);)++u;if(D[u]>(O[u]||0)&&--l,a==null?x=a=k.precision:o?x=a+(Er(n)-Er(i))+1:x=a,x<0)return new k(0);if(x=x/Qt+2|0,u=0,M==1)for(c=0,D=D[0],x++;(u1&&(D=e(D,c),O=e(O,c),M=D.length,T=O.length),S=M,g=O.slice(0,M),m=g.length;m=en/2&&++A;do c=0,s=t(D,g,M,m),s<0?(y=g[0],M!=m&&(y=y*en+(g[1]||0)),c=y/A|0,c>1?(c>=en&&(c=en-1),f=e(D,c),h=f.length,m=g.length,s=t(f,g,h,m),s==1&&(c--,r(f,M16)throw Error(VD+Er(e));if(!e.s)return new c(wi);for(rr=!1,s=f,o=new c(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(nc(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new c(wi),c.precision=s;;){if(i=Vt(i.times(e),s),r=r.times(++l),o=a.plus(ws(i,r,s)),xo(o.d).slice(0,s)===xo(a.d).slice(0,s)){for(;u--;)a=Vt(a.times(a),s);return c.precision=f,t==null?(rr=!0,Vt(a,f)):a}a=o}}function Er(e){for(var t=e.e*Qt,r=e.d[0];r>=10;r/=10)t++;return t}function _C(e,t,r){if(t>e.LN10.sd())throw rr=!0,r&&(e.precision=r),Error(fa+"LN10 precision limit exceeded");return Vt(new e(e.LN10),t)}function gl(e){for(var t="";e--;)t+="0";return t}function Nm(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(fa+(d.s?"NaN":"-Infinity"));if(d.eq(wi))return new g(0);if(t==null?(rr=!1,u=m):u=t,d.eq(10))return t==null&&(rr=!0),_C(g,u);if(u+=h,g.precision=u,r=xo(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=xo(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=_C(g,u+2,m).times(a+""),d=Nm(new g(n+"."+r.slice(1)),u-h).plus(l),g.precision=m,t==null?(rr=!0,Vt(d,m)):d;for(s=o=d=ws(d.minus(wi),d.plus(wi),u),c=Vt(d.times(d),u),i=3;;){if(o=Vt(o.times(c),u),l=s.plus(ws(o,new g(i),u)),xo(l.d).slice(0,u)===xo(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(_C(g,u+2,m).times(a+""))),s=ws(s,new g(f),u),g.precision=m,t==null?(rr=!0,Vt(s,m)):s;s=l,i+=2}}function y4(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=Av(r/Qt),e.d=[],n=(r+1)%Qt,r<0&&(n+=Qt),ng1||e.e<-g1))throw Error(VD+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+=Qt,i=t,u=f[c=0];else{if(c=Math.ceil((n+1)/Qt),a=f.length,c>=a)return e;for(u=a=f[c],o=1;a>=10;a/=10)o++;n%=Qt,i=n-Qt+o}if(r!==void 0&&(a=nc(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/nc(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]=nc(10,(Qt-t%Qt)%Qt),e.e=Av(-t/Qt)||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=nc(10,Qt-n),f[c]=i>0?(u/nc(10,o-i)%nc(10,i)|0)*a:0),l)for(;;)if(c==0){(f[0]+=a)==en&&(f[0]=1,++e.e);break}else{if(f[c]+=a,f[c]!=en)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(rr&&(e.e>g1||e.e<-g1))throw Error(VD+Er(e));return e}function zX(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),rr?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/Qt),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)+gl(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+gl(-i-1)+a,r&&(n=r-o)>0&&(a+=gl(n))):i>=o?(a+=gl(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+gl(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=gl(n))),e.s<0?"-"+a:a}function x4(e,t){if(e.length>t)return e.length=t,!0}function $X(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(Ec+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 y4(o,a.toString())}else if(typeof a!="string")throw Error(Ec+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,gCe.test(a))y4(o,a);else throw Error(Ec+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=$X,i.config=i.set=mCe,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(Ec+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ec+r+": "+n);return this}var GD=$X(pCe);wi=new GD(1);const Bt=GD;function yCe(e){return wCe(e)||bCe(e)||_Ce(e)||xCe()}function xCe(){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 _Ce(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 bCe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function wCe(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=t?r.apply(void 0,i):e(t-o,_4(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 RCe(e){if(Array.isArray(e))return e}function HX(e){var t=jm(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function UX(e,t,r){if(e.lte(0))return new Bt(0);var n=KS.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 BCe(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(KS.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=CCe(ACe(function(l){return i.add(new Bt(l-o).mul(n)).toNumber()}),jL);return s(0,t)}function ZX(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=UX(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?ZX(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 zCe(e){var t=jm(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=HX([r,n]),l=jm(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(BL(jL(0,i-1).map(function(){return 1/0}))):[].concat(BL(jL(0,i-1).map(function(){return-1/0})),[c]);return r>n?RL(f):f}if(u===c)return BCe(u,i,a);var h=ZX(u,c,o,a),d=h.step,v=h.tickMin,g=h.tickMax,m=KS.rangeStep(v,g.add(new Bt(.1).mul(d)),d);return r>n?RL(m):m}function $Ce(e,t){var r=jm(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=HX([n,i]),s=jm(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=UX(new Bt(u).sub(l).div(c-1),a,0),h=[].concat(BL(KS.rangeStep(new Bt(l),new Bt(u).sub(new Bt(.99).mul(f)),f)),[u]);return n>i?RL(h):h}var FCe=GX(zCe),VCe=GX($Ce),GCe="Invariant failed";function Kc(e,t){throw new Error(GCe)}var WCe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Pd(e){"@babel/helpers - typeof";return Pd=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},Pd(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 KCe(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 QCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JCe(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(ja(f-c)!==ja(h-f)){var v=[];if(ja(h-f)===ja(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 x=Math.min(c,h),b=Math.max(c,h);if(t>(x+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},WD=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?pr(pr({},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},g2e=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 x=y[0].type.defaultProps,b=x!==void 0?pr(pr({},x),y[0].props):y[0].props,S=b.barSize,T=b[m];o[T]||(o[T]=[]);var A=dt(S)?r:S;o[T].push({item:y[0],stackList:y.slice(1),barSize:dt(A)?void 0:Xc(A,n,0)})}}return o},m2e=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=Xc(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 A={item:T.item,position:{offset:m.offset+m.size+u,size:h?d:T.barSize}},M=[].concat(S4(S),[A]);return m=M[M.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){M.push({item:P,position:m})}),M},f)}else{var y=Xc(n,i,0,!0);i-2*y-(l-1)*u<=0&&(u=0);var x=(i-2*y-(l-1)*u)/l;x>1&&(x>>=0);var b=s===+s?Math.min(x,s):x;c=o.reduce(function(S,T,A){var M=[].concat(S4(S),[{item:T.item,position:{offset:y+(x+u)*A+(x-b)/2,size:b}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){M.push({item:P,position:M[M.length-1].position})}),M},f)}return c},y2e=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=KX({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 pr(pr({},t),{},td({},d,t[d]+(f||0)));if((g==="horizontal"||g==="vertical"&&d==="center")&&v!=="middle"&&we(t[v]))return pr(pr({},t),{},td({},v,t[v]+(h||0)))}return t},x2e=function(t,r,n){return dt(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},QX=function(t,r,n,i,a){var o=r.props.children,s=oa(o,Ky).filter(function(u){return x2e(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=Un(c,n);if(dt(f))return u;var h=Array.isArray(f)?[XS(f),Tl(f)]:[f,f],d=l.reduce(function(v,g){var m=Un(c,g,0),y=h[0]-Math.abs(Array.isArray(m)?m[0]:m),x=h[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(y,v[0]),Math.max(x,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},_2e=function(t,r,n,i,a){var o=r.map(function(s){return QX(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},JX=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&QX(t,l,u,i)||Dg(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?ja(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!mv(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}})},bC=new WeakMap,dx=function(t,r){if(typeof r!="function")return t;bC.has(t)||bC.set(t,new WeakMap);var n=bC.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},b2e=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:km(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:h1(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Eg(),realScaleType:"point"}:a==="category"?{scale:km(),realScaleType:"band"}:{scale:h1(),realScaleType:"linear"};if(Yc(i)){var l="scale".concat(jS(i));return{scale:(m4[l]||Eg)(),realScaleType:m4[l]?l:"point"}}return ft(i)?{scale:i}:{scale:Eg(),realScaleType:"point"}},A4=1e-4,w2e=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])-A4,o=Math.max(i[0],i[1])+A4,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},S2e=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])}},C2e=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)}},M2e={sign:A2e,expand:Fpe,none:xd,silhouette:Vpe,wiggle:Gpe,positive:C2e},P2e=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=M2e[n],o=$pe().keys(i).value(function(s,l){return+Un(s,l,0)}).order(hL).offset(a);return o(t)},L2e=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?pr(pr({},h.type.defaultProps),h.props):h.props,g=v.stackId,m=v.hide;if(m)return f;var y=v[n],x=f[y]||{hasStack:!1,stackGroups:{}};if(Vr(g)){var b=x.stackGroups[g]||{numericAxisId:n,cateAxisId:i,items:[]};b.items.push(h),x.hasStack=!0,x.stackGroups[g]=b}else x.stackGroups[yv("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return pr(pr({},f),{},td({},y,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 y=d.stackGroups[m];return pr(pr({},g),{},td({},m,{numericAxisId:n,cateAxisId:i,items:y.items,stackedData:P2e(t,y.items,a)}))},v)}return pr(pr({},f),{},td({},h,d))},c)},k2e=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=FCe(u,a,s);return t.domain([XS(c),Tl(c)]),{niceTicks:c}}if(a&&i==="number"){var f=t.domain(),h=VCe(f,a,s);return{niceTicks:h}}return null};function x1(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=Vb(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Un(i,dt(o)?t.dataKey:o);return dt(l)?null:t.scale(l)}var C4=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=Un(o,r.dataKey,r.domain[s]);return dt(l)?null:r.scale(l)-a/2+i},I2e=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]},O2e=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?pr(pr({},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},E2e=function(t){return t.reduce(function(r,n){return[XS(n.concat([r[0]]).filter(we)),Tl(n.concat([r[1]]).filter(we))]},[1/0,-1/0])},tq=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=E2e(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})},M4=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,P4=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,VL=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(M4.test(t[0])){var a=+M4.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(P4.test(t[1])){var o=+P4.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},_1=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=yD(r,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;so&&(u=2*Math.PI-u),{radius:s,angle:R2e(u),angleInRadian:u}},$2e=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}},F2e=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},O4=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=$2e(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?I4(I4({},r),{},{radius:o,angle:F2e(d,r)}):null};function $m(e){"@babel/helpers - typeof";return $m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$m(e)}var V2e=["offset"];function G2e(e){return Z2e(e)||U2e(e)||H2e(e)||W2e()}function W2e(){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 H2e(e,t){if(e){if(typeof e=="string")return GL(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 GL(e,t)}}function U2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Z2e(e){if(Array.isArray(e))return GL(e)}function GL(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 X2e(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 E4(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+x*o,S=g):i==="insideEnd"?(b=v-x*o,S=!g):i==="end"&&(b=v+x*o,S=g),S=y<=0?S:!S;var T=pn(u,c,m,b),A=pn(u,c,m,b+(S?1:-1)*359),M="M".concat(T.x,",").concat(T.y,` + height and width.`,$,F,o,l,c,f,r);var G=!Array.isArray(d)&&bs(d.type).endsWith("Chart");return Q.Children.map(d,function(z){return Q.isValidElement(z)?W.cloneElement(z,ux({width:$,height:F},G?{style:ux({height:"100%",width:"100%",maxHeight:F,maxWidth:$},z.props.style)}:{})):z})},[r,d,l,h,f,c,k,o]);return Q.createElement("div",{id:m?"".concat(m):void 0,className:xt("recharts-responsive-container",y),style:ux(ux({},S),{},{width:o,height:l,minWidth:c,minHeight:f,maxHeight:h}),ref:T},D)}),QY=function(t){return null};QY.displayName="Cell";function Lm(e){"@babel/helpers - typeof";return Lm=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},Lm(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 CL(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||gf.isSsr)return{width:0,height:0};var n=$we(r),i=JSON.stringify({text:t,copyStyle:n});if(Ff.widthCache[i])return Ff.widthCache[i];try{var a=document.getElementById(Sz);a||(a=document.createElement("span"),a.setAttribute("id",Sz),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=CL(CL({},zwe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return Ff.widthCache[i]=l,++Ff.cacheCount>Bwe&&(Ff.cacheCount=0,Ff.widthCache={}),l}catch{return{width:0,height:0}}},Fwe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 i1(e,t){return Hwe(e)||Wwe(e,t)||Gwe(e,t)||Vwe()}function Vwe(){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 Gwe(e,t){if(e){if(typeof e=="string")return Tz(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 Tz(e,t)}}function Tz(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 aSe(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 kz(e,t){return uSe(e)||lSe(e,t)||sSe(e,t)||oSe()}function oSe(){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 sSe(e,t){if(e){if(typeof e=="string")return Iz(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 Iz(e,t)}}function Iz(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 $.reduce(function(F,G){var z=G.word,U=G.width,H=F[F.length-1];if(H&&(i==null||a||H.width+U+nG.width?F:G})};if(!c)return d;for(var g="…",m=function($){var F=f.slice(0,$),G=rX({breakAll:u,style:l,children:F+g}).wordsWithComputedWidth,z=h(G),U=z.length>o||v(z).width>Number(i);return[U,z]},y=0,_=f.length-1,b=0,S;y<=_&&b<=f.length-1;){var T=Math.floor((y+_)/2),A=T-1,M=m(A),P=kz(M,2),k=P[0],I=P[1],O=m(T),D=kz(O,1),N=D[0];if(!k&&!N&&(y=T+1),k&&N&&(_=T-1),!k&&N){S=I;break}b++}return S||d},Oz=function(t){var r=dt(t)?[]:t.toString().split(tX);return[{words:r}]},fSe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!gf.isSsr){var l,u,c=rX({breakAll:o,children:i,style:a});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;l=f,u=h}else return Oz(i);return cSe({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return Oz(i)},Ez="#808080",a1=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?Ez:m,_=Lz(t,nSe),b=W.useMemo(function(){return fSe({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:f,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,f,_.style,_.width]),S=_.dx,T=_.dy,A=_.angle,M=_.className,P=_.breakAll,k=Lz(_,iSe);if(!Vr(n)||!Vr(a))return null;var I=n+(we(S)?S:0),O=a+(we(T)?T:0),D;switch(g){case"start":D=dC("calc(".concat(u,")"));break;case"middle":D=dC("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:D=dC("calc(".concat(b.length-1," * -").concat(s,")"));break}var N=[];if(f){var B=b[0].width,$=_.width;N.push("scale(".concat((we($)?$/B:1)/B,")"))}return A&&N.push("rotate(".concat(A,", ").concat(I,", ").concat(O,")")),N.length&&(k.transform=N.join(" ")),Q.createElement("text",ML({},ct(k,!0),{x:I,y:O,className:xt("recharts-text",M),textAnchor:d,fill:y.includes("url")?Ez:y}),b.map(function(F,G){var z=F.words.join(P?"":" ");return Q.createElement("tspan",{x:I,dy:G===0?D:s,key:"".concat(z,"-").concat(G)},z)}))};function Gl(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function hSe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function _D(e){let t,r,n;e.length!==2?(t=Gl,r=(s,l)=>Gl(e(s),l),n=(s,l)=>e(s)-l):(t=e===Gl||e===hSe?e:dSe,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 dSe(){return 0}function nX(e){return e===null?NaN:+e}function*vSe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const pSe=_D(Gl),Yy=pSe.right;_D(nX).center;class Dz extends Map{constructor(t,r=ySe){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(Nz(this,t))}has(t){return super.has(Nz(this,t))}set(t,r){return super.set(gSe(this,t),r)}delete(t){return super.delete(mSe(this,t))}}function Nz({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function gSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function mSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function ySe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xSe(e=Gl){if(e===Gl)return iX;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 iX(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const _Se=Math.sqrt(50),bSe=Math.sqrt(10),wSe=Math.sqrt(2);function o1(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>=_Se?10:a>=bSe?5:a>=wSe?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 Rz(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function aX(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?iX:xSe(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));aX(e,t,d,v,i)}const a=e[t];let o=r,s=n;for(xp(e,r,t),i(e[n],a)>0&&xp(e,r,n);o0;)--s}i(e[r],a)===0?xp(e,r,s):(++s,xp(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function xp(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function SSe(e,t,r){if(e=Float64Array.from(vSe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Rz(e);if(t>=1)return jz(e);var n,i=(n-1)*t,a=Math.floor(i),o=jz(aX(e,a).subarray(0,a+1)),s=Rz(e.subarray(a+1));return o+(s-o)*(i-a)}}function TSe(e,t,r=nX){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 ASe(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?fx(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?fx(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=MSe.exec(e))?new si(t[1],t[2],t[3],1):(t=PSe.exec(e))?new si(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LSe.exec(e))?fx(t[1],t[2],t[3],t[4]):(t=kSe.exec(e))?fx(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ISe.exec(e))?Wz(t[1],t[2]/100,t[3]/100,1):(t=OSe.exec(e))?Wz(t[1],t[2]/100,t[3]/100,t[4]):Bz.hasOwnProperty(e)?Fz(Bz[e]):e==="transparent"?new si(NaN,NaN,NaN,0):null}function Fz(e){return new si(e>>16&255,e>>8&255,e&255,1)}function fx(e,t,r,n){return n<=0&&(e=t=r=NaN),new si(e,t,r,n)}function NSe(e){return e instanceof Xy||(e=Dm(e)),e?(e=e.rgb(),new si(e.r,e.g,e.b,e.opacity)):new si}function OL(e,t,r,n){return arguments.length===1?NSe(e):new si(e,t,r,n??1)}function si(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}wD(si,OL,sX(Xy,{brighter(e){return e=e==null?s1:Math.pow(s1,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Om:Math.pow(Om,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new si(Ec(this.r),Ec(this.g),Ec(this.b),l1(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:Vz,formatHex:Vz,formatHex8:jSe,formatRgb:Gz,toString:Gz}));function Vz(){return`#${xc(this.r)}${xc(this.g)}${xc(this.b)}`}function jSe(){return`#${xc(this.r)}${xc(this.g)}${xc(this.b)}${xc((isNaN(this.opacity)?1:this.opacity)*255)}`}function Gz(){const e=l1(this.opacity);return`${e===1?"rgb(":"rgba("}${Ec(this.r)}, ${Ec(this.g)}, ${Ec(this.b)}${e===1?")":`, ${e})`}`}function l1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ec(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xc(e){return e=Ec(e),(e<16?"0":"")+e.toString(16)}function Wz(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Na(e,t,r,n)}function lX(e){if(e instanceof Na)return new Na(e.h,e.s,e.l,e.opacity);if(e instanceof Xy||(e=Dm(e)),!e)return new Na;if(e instanceof Na)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 Na(o,s,l,e.opacity)}function RSe(e,t,r,n){return arguments.length===1?lX(e):new Na(e,t,r,n??1)}function Na(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}wD(Na,RSe,sX(Xy,{brighter(e){return e=e==null?s1:Math.pow(s1,e),new Na(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Om:Math.pow(Om,e),new Na(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 si(vC(e>=240?e-240:e+120,i,n),vC(e,i,n),vC(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Na(Hz(this.h),hx(this.s),hx(this.l),l1(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=l1(this.opacity);return`${e===1?"hsl(":"hsla("}${Hz(this.h)}, ${hx(this.s)*100}%, ${hx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Hz(e){return e=(e||0)%360,e<0?e+360:e}function hx(e){return Math.max(0,Math.min(1,e||0))}function vC(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 SD=e=>()=>e;function BSe(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 $Se(e){return(e=+e)==1?uX:function(t,r){return r-t?zSe(t,r,e):SD(isNaN(t)?r:t)}}function uX(e,t){var r=t-e;return r?BSe(e,r):SD(isNaN(e)?t:e)}const Uz=function e(t){var r=$Se(t);function n(i,a){var o=r((i=OL(i)).r,(a=OL(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=uX(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 FSe(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:u1(n,i)})),r=pC.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function QSe(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?JSe:QSe,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),u1)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,c1),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=TD,c()},f.clamp=function(h){return arguments.length?(o=h?!0:Gn,c()):o!==Gn},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 AD(){return WS()(Gn,Gn)}function eTe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function f1(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 Ad(e){return e=f1(Math.abs(e)),e?e[1]:NaN}function tTe(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 rTe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var nTe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Nm(e){if(!(t=nTe.exec(e)))throw new Error("invalid format: "+e);var t;return new CD({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]})}Nm.prototype=CD.prototype;function CD(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+""}CD.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 iTe(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 h1;function aTe(e,t){var r=f1(e,t);if(!r)return h1=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(h1=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")+f1(e,Math.max(0,t+a-1))[0]}function Yz(e,t){var r=f1(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 Xz={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:eTe,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)=>Yz(e*100,t),r:Yz,s:aTe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qz(e){return e}var Kz=Array.prototype.map,Qz=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oTe(e){var t=e.grouping===void 0||e.thousands===void 0?qz:tTe(Kz.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?qz:rTe(Kz.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=Nm(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,A=f.type;A==="n"?(b=!0,A="g"):Xz[A]||(S===void 0&&(S=12),T=!0,A="g"),(y||d==="0"&&v==="=")&&(y=!0,d="0",v="=");var M=(h&&h.prefix!==void 0?h.prefix:"")+(m==="$"?r:m==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),P=(m==="$"?n:/[%p]/.test(A)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),k=Xz[A],I=/[defgprs%]/.test(A);S=S===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function O(D){var N=M,B=P,$,F,G;if(A==="c")B=k(D)+B,D="";else{D=+D;var z=D<0||1/D<0;if(D=isNaN(D)?l:k(Math.abs(D),S),T&&(D=iTe(D)),z&&+D==0&&g!=="+"&&(z=!1),N=(z?g==="("?g:s:g==="-"||g==="("?"":g)+N,B=(A==="s"&&!isNaN(D)&&h1!==void 0?Qz[8+h1/3]:"")+B+(z&&g==="("?")":""),I){for($=-1,F=D.length;++$G||G>57){B=(G===46?i+D.slice($+1):D.slice($))+B,D=D.slice(0,$);break}}}b&&!y&&(D=t(D,1/0));var U=N.length+D.length+B.length,H=U<_?new Array(_-U+1).join(d):"";switch(b&&y&&(D=t(H+D,H.length?_-B.length:1/0),H=""),v){case"<":D=N+D+B+H;break;case"=":D=N+H+D+B;break;case"^":D=H.slice(0,U=H.length>>1)+N+D+B+H.slice(U);break;default:D=H+N+D+B;break}return a(D)}return O.toString=function(){return f+""},O}function c(f,h){var d=Math.max(-8,Math.min(8,Math.floor(Ad(h)/3)))*3,v=Math.pow(10,-d),g=u((f=Nm(f),f.type="f",f),{suffix:Qz[8+d/3]});return function(m){return g(v*m)}}return{format:u,formatPrefix:c}}var dx,MD,cX;sTe({thousands:",",grouping:[3],currency:["$",""]});function sTe(e){return dx=oTe(e),MD=dx.format,cX=dx.formatPrefix,dx}function lTe(e){return Math.max(0,-Ad(Math.abs(e)))}function uTe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ad(t)/3)))*3-Ad(Math.abs(e)))}function cTe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ad(t)-Ad(e))+1}function fX(e,t,r,n){var i=kL(e,t,r),a;switch(n=Nm(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=uTe(i,o))&&(n.precision=a),cX(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=cTe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=lTe(i))&&(n.precision=a-(n.type==="%")*2);break}}return MD(n)}function hu(e){var t=e.domain;return e.ticks=function(r){var n=t();return PL(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return fX(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=LL(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 d1(){var e=AD();return e.copy=function(){return qy(e,d1())},ma.apply(e,arguments),hu(e)}function hX(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,c1),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return hX(e).unknown(t)},e=arguments.length?Array.from(e,c1):[0,1],hu(r)}function dX(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 pTe(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 t4(e){return(t,r)=>-e(-t,r)}function PD(e){const t=e(Jz,e4),r=t.domain;let n=10,i,a;function o(){return i=pTe(n),a=vTe(n),r()[0]<0?(i=t4(i),a=t4(a),e(fTe,hTe)):e(Jz,e4),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=Nm(l)).precision==null&&(l.trim=!0),l=MD(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(dX(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function vX(){const e=PD(WS()).domain([1,10]);return e.copy=()=>qy(e,vX()).base(e.base()),ma.apply(e,arguments),e}function r4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function n4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function LD(e){var t=1,r=e(r4(t),n4(t));return r.constant=function(n){return arguments.length?e(r4(t=+n),n4(t)):t},hu(r)}function pX(){var e=LD(WS());return e.copy=function(){return qy(e,pX()).constant(e.constant())},ma.apply(e,arguments)}function i4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function gTe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function mTe(e){return e<0?-e*e:e*e}function kD(e){var t=e(Gn,Gn),r=1;function n(){return r===1?e(Gn,Gn):r===.5?e(gTe,mTe):e(i4(r),i4(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},hu(t)}function ID(){var e=kD(WS());return e.copy=function(){return qy(e,ID()).exponent(e.exponent())},ma.apply(e,arguments),e}function yTe(){return ID.apply(null,arguments).exponent(.5)}function a4(e){return Math.sign(e)*e*e}function xTe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function gX(){var e=AD(),t=[0,1],r=!1,n;function i(a){var o=xTe(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(a4(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,c1)).map(a4)),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 gX(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ma.apply(i,arguments),hu(i)}function mX(){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 yX().domain([e,t]).range(i).unknown(a)},ma.apply(hu(o),arguments)}function xX(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Yy(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 xX().domain(e).range(t).unknown(r)},ma.apply(i,arguments)}const gC=new Date,mC=new Date;function Yr(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(uYr(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)=>(gC.setTime(+a),mC.setTime(+o),e(gC),e(mC),Math.floor(r(gC,mC))),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 v1=Yr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);v1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):v1);v1.range;const ds=1e3,na=ds*60,vs=na*60,Ns=vs*24,OD=Ns*7,o4=Ns*30,yC=Ns*365,_c=Yr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ds)},(e,t)=>(t-e)/ds,e=>e.getUTCSeconds());_c.range;const ED=Yr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ds)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getMinutes());ED.range;const DD=Yr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*na)},(e,t)=>(t-e)/na,e=>e.getUTCMinutes());DD.range;const ND=Yr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ds-e.getMinutes()*na)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getHours());ND.range;const jD=Yr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getUTCHours());jD.range;const Ky=Yr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*na)/Ns,e=>e.getDate()-1);Ky.range;const HS=Yr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ns,e=>e.getUTCDate()-1);HS.range;const _X=Yr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ns,e=>Math.floor(e/Ns));_X.range;function mf(e){return Yr(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)/OD)}const US=mf(0),p1=mf(1),_Te=mf(2),bTe=mf(3),Cd=mf(4),wTe=mf(5),STe=mf(6);US.range;p1.range;_Te.range;bTe.range;Cd.range;wTe.range;STe.range;function yf(e){return Yr(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)/OD)}const ZS=yf(0),g1=yf(1),TTe=yf(2),ATe=yf(3),Md=yf(4),CTe=yf(5),MTe=yf(6);ZS.range;g1.range;TTe.range;ATe.range;Md.range;CTe.range;MTe.range;const RD=Yr(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());RD.range;const BD=Yr(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());BD.range;const js=Yr(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());js.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yr(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)});js.range;const Rs=Yr(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());Rs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yr(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)});Rs.range;function bX(e,t,r,n,i,a){const o=[[_c,1,ds],[_c,5,5*ds],[_c,15,15*ds],[_c,30,30*ds],[a,1,na],[a,5,5*na],[a,15,15*na],[a,30,30*na],[i,1,vs],[i,3,3*vs],[i,6,6*vs],[i,12,12*vs],[n,1,Ns],[n,2,2*Ns],[r,1,OD],[t,1,o4],[t,3,3*o4],[e,1,yC]];function s(u,c,f){const h=cm).right(o,h);if(d===o.length)return e.every(kL(u/yC,c/yC,f));if(d===0)return v1.every(Math.max(kL(u,c,f),1));const[v,g]=o[h/o[d-1][2]53)return null;"w"in ee||(ee.w=1),"Z"in ee?(Se=_C(_p(ee.y,0,1)),Fe=Se.getUTCDay(),Se=Fe>4||Fe===0?g1.ceil(Se):g1(Se),Se=HS.offset(Se,(ee.V-1)*7),ee.y=Se.getUTCFullYear(),ee.m=Se.getUTCMonth(),ee.d=Se.getUTCDate()+(ee.w+6)%7):(Se=xC(_p(ee.y,0,1)),Fe=Se.getDay(),Se=Fe>4||Fe===0?p1.ceil(Se):p1(Se),Se=Ky.offset(Se,(ee.V-1)*7),ee.y=Se.getFullYear(),ee.m=Se.getMonth(),ee.d=Se.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),Fe="Z"in ee?_C(_p(ee.y,0,1)).getUTCDay():xC(_p(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-(Fe+5)%7:ee.w+ee.U*7-(Fe+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,_C(ee)):xC(ee)}}function P(ne,fe,le,ee){for(var $e=0,Se=fe.length,Fe=le.length,Ye,vt;$e=Fe)return-1;if(Ye=fe.charCodeAt($e++),Ye===37){if(Ye=fe.charAt($e++),vt=T[Ye in s4?fe.charAt($e++):Ye],!vt||(ee=vt(ne,le,ee))<0)return-1}else if(Ye!=le.charCodeAt(ee++))return-1}return ee}function k(ne,fe,le){var ee=u.exec(fe.slice(le));return ee?(ne.p=c.get(ee[0].toLowerCase()),le+ee[0].length):-1}function I(ne,fe,le){var ee=d.exec(fe.slice(le));return ee?(ne.w=v.get(ee[0].toLowerCase()),le+ee[0].length):-1}function O(ne,fe,le){var ee=f.exec(fe.slice(le));return ee?(ne.w=h.get(ee[0].toLowerCase()),le+ee[0].length):-1}function D(ne,fe,le){var ee=y.exec(fe.slice(le));return ee?(ne.m=_.get(ee[0].toLowerCase()),le+ee[0].length):-1}function N(ne,fe,le){var ee=g.exec(fe.slice(le));return ee?(ne.m=m.get(ee[0].toLowerCase()),le+ee[0].length):-1}function B(ne,fe,le){return P(ne,t,fe,le)}function $(ne,fe,le){return P(ne,r,fe,le)}function F(ne,fe,le){return P(ne,n,fe,le)}function G(ne){return o[ne.getDay()]}function z(ne){return a[ne.getDay()]}function U(ne){return l[ne.getMonth()]}function H(ne){return s[ne.getMonth()]}function Y(ne){return i[+(ne.getHours()>=12)]}function Z(ne){return 1+~~(ne.getMonth()/3)}function J(ne){return o[ne.getUTCDay()]}function ae(ne){return a[ne.getUTCDay()]}function ce(ne){return l[ne.getUTCMonth()]}function ge(ne){return s[ne.getUTCMonth()]}function We(ne){return i[+(ne.getUTCHours()>=12)]}function xe(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var fe=A(ne+="",b);return fe.toString=function(){return ne},fe},parse:function(ne){var fe=M(ne+="",!1);return fe.toString=function(){return ne},fe},utcFormat:function(ne){var fe=A(ne+="",S);return fe.toString=function(){return ne},fe},utcParse:function(ne){var fe=M(ne+="",!0);return fe.toString=function(){return ne},fe}}}var s4={"-":"",_:" ",0:"0"},ln=/^\s*\d+/,ETe=/^%/,DTe=/[\\^$*+?|[\]().{}]/g;function Ct(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function jTe(e,t,r){var n=ln.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function RTe(e,t,r){var n=ln.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function BTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function zTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function $Te(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function l4(e,t,r){var n=ln.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function u4(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function FTe(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 VTe(e,t,r){var n=ln.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function GTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function c4(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function WTe(e,t,r){var n=ln.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function f4(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function HTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function UTe(e,t,r){var n=ln.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function ZTe(e,t,r){var n=ln.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function YTe(e,t,r){var n=ln.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function XTe(e,t,r){var n=ETe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function qTe(e,t,r){var n=ln.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function KTe(e,t,r){var n=ln.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function h4(e,t){return Ct(e.getDate(),t,2)}function QTe(e,t){return Ct(e.getHours(),t,2)}function JTe(e,t){return Ct(e.getHours()%12||12,t,2)}function eAe(e,t){return Ct(1+Ky.count(js(e),e),t,3)}function wX(e,t){return Ct(e.getMilliseconds(),t,3)}function tAe(e,t){return wX(e,t)+"000"}function rAe(e,t){return Ct(e.getMonth()+1,t,2)}function nAe(e,t){return Ct(e.getMinutes(),t,2)}function iAe(e,t){return Ct(e.getSeconds(),t,2)}function aAe(e){var t=e.getDay();return t===0?7:t}function oAe(e,t){return Ct(US.count(js(e)-1,e),t,2)}function SX(e){var t=e.getDay();return t>=4||t===0?Cd(e):Cd.ceil(e)}function sAe(e,t){return e=SX(e),Ct(Cd.count(js(e),e)+(js(e).getDay()===4),t,2)}function lAe(e){return e.getDay()}function uAe(e,t){return Ct(p1.count(js(e)-1,e),t,2)}function cAe(e,t){return Ct(e.getFullYear()%100,t,2)}function fAe(e,t){return e=SX(e),Ct(e.getFullYear()%100,t,2)}function hAe(e,t){return Ct(e.getFullYear()%1e4,t,4)}function dAe(e,t){var r=e.getDay();return e=r>=4||r===0?Cd(e):Cd.ceil(e),Ct(e.getFullYear()%1e4,t,4)}function vAe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ct(t/60|0,"0",2)+Ct(t%60,"0",2)}function d4(e,t){return Ct(e.getUTCDate(),t,2)}function pAe(e,t){return Ct(e.getUTCHours(),t,2)}function gAe(e,t){return Ct(e.getUTCHours()%12||12,t,2)}function mAe(e,t){return Ct(1+HS.count(Rs(e),e),t,3)}function TX(e,t){return Ct(e.getUTCMilliseconds(),t,3)}function yAe(e,t){return TX(e,t)+"000"}function xAe(e,t){return Ct(e.getUTCMonth()+1,t,2)}function _Ae(e,t){return Ct(e.getUTCMinutes(),t,2)}function bAe(e,t){return Ct(e.getUTCSeconds(),t,2)}function wAe(e){var t=e.getUTCDay();return t===0?7:t}function SAe(e,t){return Ct(ZS.count(Rs(e)-1,e),t,2)}function AX(e){var t=e.getUTCDay();return t>=4||t===0?Md(e):Md.ceil(e)}function TAe(e,t){return e=AX(e),Ct(Md.count(Rs(e),e)+(Rs(e).getUTCDay()===4),t,2)}function AAe(e){return e.getUTCDay()}function CAe(e,t){return Ct(g1.count(Rs(e)-1,e),t,2)}function MAe(e,t){return Ct(e.getUTCFullYear()%100,t,2)}function PAe(e,t){return e=AX(e),Ct(e.getUTCFullYear()%100,t,2)}function LAe(e,t){return Ct(e.getUTCFullYear()%1e4,t,4)}function kAe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Md(e):Md.ceil(e),Ct(e.getUTCFullYear()%1e4,t,4)}function IAe(){return"+0000"}function v4(){return"%"}function p4(e){return+e}function g4(e){return Math.floor(+e/1e3)}var Vf,CX,MX;OAe({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 OAe(e){return Vf=OTe(e),CX=Vf.format,Vf.parse,MX=Vf.utcFormat,Vf.utcParse,Vf}function EAe(e){return new Date(e)}function DAe(e){return e instanceof Date?+e:+new Date(+e)}function zD(e,t,r,n,i,a,o,s,l,u){var c=AD(),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(A){return(l(A)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>SSe(e,a/n))},r.copy=function(){return IX(t).domain(e)},Xs.apply(r,arguments)}function XS(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Gn,c,f=!1,h;function d(g){return isNaN(g=+g)?h:(g=.5+((g=+c(g))-a)*(n*gt}var VAe=FAe,GAe=NX,WAe=VAe,HAe=wv;function UAe(e){return e&&e.length?GAe(e,HAe,WAe):void 0}var ZAe=UAe;const Al=Ft(ZAe);function YAe(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)*Qt;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 ws(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return Gt(ws(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(wi))throw Error(fa+"NaN");if(r.s<1)throw Error(fa+(r.s?"NaN":"-Infinity"));return r.eq(wi)?new n(0):(rr=!1,t=ws(jm(r,a),jm(e,a),a),rr=!0,Gt(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?zX(t,e):RX(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(fa+"NaN");return r.s?(rr=!1,t=ws(r,e,0,1).times(e),rr=!0,r.minus(t)):Gt(new n(r),i)};je.naturalExponential=je.exp=function(){return BX(this)};je.naturalLogarithm=je.ln=function(){return jm(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?RX(t,e):zX(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(Dc+e);if(t=Er(i)+1,n=i.d.length-1,r=n*Qt+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(fa+"NaN")}for(e=Er(s),rr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=xo(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Cv((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(ws(s,a,o+2)).times(.5),xo(a.d).slice(0,o)===(t=xo(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Gt(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return rr=!0,Gt(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%en|0,t=s/en|0;a[i]=(a[i]+t)%en|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,rr?Gt(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:(jo(e,0,Av),t===void 0?t=n.rounding:jo(t,0,8),Gt(r,e+Er(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Kc(n,!0):(jo(e,0,Av),t===void 0?t=i.rounding:jo(t,0,8),n=Gt(new i(n),e+1,t),r=Kc(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Kc(i):(jo(e,0,Av),t===void 0?t=a.rounding:jo(t,0,8),n=Gt(new a(i),e+Er(i)+1,t),r=Kc(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 Gt(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(wi);if(s=new l(s),!s.s){if(e.s<1)throw Error(fa+"Infinity");return s}if(s.eq(wi))return s;if(n=l.precision,e.eq(wi))return Gt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=c<0?-c:c)<=jX){for(i=new l(wi),t=Math.ceil(n/Qt+4),rr=!1;r%2&&(i=i.times(s),x4(i.d,t)),r=Cv(r/2),r!==0;)s=s.times(s),x4(s.d,t);return rr=!0,e.s<0?new l(wi).div(i):Gt(i,n)}}else if(a<0)throw Error(fa+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,rr=!1,i=e.times(jm(s,n+u)),rr=!0,i=BX(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=Kc(i,r<=a.toExpNeg||r>=a.toExpPos)):(jo(e,1,Av),t===void 0?t=a.rounding:jo(t,0,8),i=Gt(new a(i),e,t),r=Er(i),n=Kc(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):(jo(e,1,Av),t===void 0?t=n.rounding:jo(t,0,8)),Gt(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 Kc(e,t<=r.toExpNeg||t>=r.toExpPos)};function RX(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)),rr?Gt(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/Qt),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)/en|0,l[a]%=en;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,rr?Gt(t,f):t}function jo(e,t,r){if(e!==~~e||er)throw Error(Dc+e)}function xo(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,A,M,P,k=n.constructor,I=n.s==i.s?1:-1,O=n.d,D=i.d;if(!n.s)return new k(n);if(!i.s)throw Error(fa+"Division by zero");for(l=n.e-i.e,M=D.length,T=O.length,d=new k(I),v=d.d=[],u=0;D[u]==(O[u]||0);)++u;if(D[u]>(O[u]||0)&&--l,a==null?_=a=k.precision:o?_=a+(Er(n)-Er(i))+1:_=a,_<0)return new k(0);if(_=_/Qt+2|0,u=0,M==1)for(c=0,D=D[0],_++;(u1&&(D=e(D,c),O=e(O,c),M=D.length,T=O.length),S=M,g=O.slice(0,M),m=g.length;m=en/2&&++A;do c=0,s=t(D,g,M,m),s<0?(y=g[0],M!=m&&(y=y*en+(g[1]||0)),c=y/A|0,c>1?(c>=en&&(c=en-1),f=e(D,c),h=f.length,m=g.length,s=t(f,g,h,m),s==1&&(c--,r(f,M16)throw Error(VD+Er(e));if(!e.s)return new c(wi);for(rr=!1,s=f,o=new c(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(ic(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new c(wi),c.precision=s;;){if(i=Gt(i.times(e),s),r=r.times(++l),o=a.plus(ws(i,r,s)),xo(o.d).slice(0,s)===xo(a.d).slice(0,s)){for(;u--;)a=Gt(a.times(a),s);return c.precision=f,t==null?(rr=!0,Gt(a,f)):a}a=o}}function Er(e){for(var t=e.e*Qt,r=e.d[0];r>=10;r/=10)t++;return t}function bC(e,t,r){if(t>e.LN10.sd())throw rr=!0,r&&(e.precision=r),Error(fa+"LN10 precision limit exceeded");return Gt(new e(e.LN10),t)}function ml(e){for(var t="";e--;)t+="0";return t}function jm(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(fa+(d.s?"NaN":"-Infinity"));if(d.eq(wi))return new g(0);if(t==null?(rr=!1,u=m):u=t,d.eq(10))return t==null&&(rr=!0),bC(g,u);if(u+=h,g.precision=u,r=xo(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=xo(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=bC(g,u+2,m).times(a+""),d=jm(new g(n+"."+r.slice(1)),u-h).plus(l),g.precision=m,t==null?(rr=!0,Gt(d,m)):d;for(s=o=d=ws(d.minus(wi),d.plus(wi),u),c=Gt(d.times(d),u),i=3;;){if(o=Gt(o.times(c),u),l=s.plus(ws(o,new g(i),u)),xo(l.d).slice(0,u)===xo(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(bC(g,u+2,m).times(a+""))),s=ws(s,new g(f),u),g.precision=m,t==null?(rr=!0,Gt(s,m)):s;s=l,i+=2}}function y4(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=Cv(r/Qt),e.d=[],n=(r+1)%Qt,r<0&&(n+=Qt),nm1||e.e<-m1))throw Error(VD+r)}else e.s=0,e.e=0,e.d=[0];return e}function Gt(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+=Qt,i=t,u=f[c=0];else{if(c=Math.ceil((n+1)/Qt),a=f.length,c>=a)return e;for(u=a=f[c],o=1;a>=10;a/=10)o++;n%=Qt,i=n-Qt+o}if(r!==void 0&&(a=ic(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/ic(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]=ic(10,(Qt-t%Qt)%Qt),e.e=Cv(-t/Qt)||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=ic(10,Qt-n),f[c]=i>0?(u/ic(10,o-i)%ic(10,i)|0)*a:0),l)for(;;)if(c==0){(f[0]+=a)==en&&(f[0]=1,++e.e);break}else{if(f[c]+=a,f[c]!=en)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(rr&&(e.e>m1||e.e<-m1))throw Error(VD+Er(e));return e}function zX(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),rr?Gt(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/Qt),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)+ml(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ml(-i-1)+a,r&&(n=r-o)>0&&(a+=ml(n))):i>=o?(a+=ml(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+ml(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=ml(n))),e.s<0?"-"+a:a}function x4(e,t){if(e.length>t)return e.length=t,!0}function $X(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(Dc+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 y4(o,a.toString())}else if(typeof a!="string")throw Error(Dc+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,gCe.test(a))y4(o,a);else throw Error(Dc+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=$X,i.config=i.set=mCe,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(Dc+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Dc+r+": "+n);return this}var GD=$X(pCe);wi=new GD(1);const zt=GD;function yCe(e){return wCe(e)||bCe(e)||_Ce(e)||xCe()}function xCe(){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 _Ce(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 bCe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function wCe(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=t?r.apply(void 0,i):e(t-o,_4(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 RCe(e){if(Array.isArray(e))return e}function HX(e){var t=Rm(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function UX(e,t,r){if(e.lte(0))return new zt(0);var n=QS.getDigitCount(e.toNumber()),i=new zt(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new zt(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new zt(Math.ceil(l))}function BCe(e,t,r){var n=1,i=new zt(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new zt(10).pow(QS.getDigitCount(e)-1),i=new zt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new zt(Math.floor(e)))}else e===0?i=new zt(Math.floor((t-1)/2)):r||(i=new zt(Math.floor(e)));var o=Math.floor((t-1)/2),s=CCe(ACe(function(l){return i.add(new zt(l-o).mul(n)).toNumber()}),jL);return s(0,t)}function ZX(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 zt(0),tickMin:new zt(0),tickMax:new zt(0)};var a=UX(new zt(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new zt(0):(o=new zt(e).add(t).div(2),o=o.sub(new zt(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new zt(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?ZX(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new zt(s).mul(a)),tickMax:o.add(new zt(l).mul(a))})}function zCe(e){var t=Rm(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=HX([r,n]),l=Rm(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(BL(jL(0,i-1).map(function(){return 1/0}))):[].concat(BL(jL(0,i-1).map(function(){return-1/0})),[c]);return r>n?RL(f):f}if(u===c)return BCe(u,i,a);var h=ZX(u,c,o,a),d=h.step,v=h.tickMin,g=h.tickMax,m=QS.rangeStep(v,g.add(new zt(.1).mul(d)),d);return r>n?RL(m):m}function $Ce(e,t){var r=Rm(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=HX([n,i]),s=Rm(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=UX(new zt(u).sub(l).div(c-1),a,0),h=[].concat(BL(QS.rangeStep(new zt(l),new zt(u).sub(new zt(.99).mul(f)),f)),[u]);return n>i?RL(h):h}var FCe=GX(zCe),VCe=GX($Ce),GCe="Invariant failed";function Qc(e,t){throw new Error(GCe)}var WCe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 y1(){return y1=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 KCe(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 QCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JCe(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(ja(f-c)!==ja(h-f)){var v=[];if(ja(h-f)===ja(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},WD=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?pr(pr({},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},g2e=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?pr(pr({},_),y[0].props):y[0].props,S=b.barSize,T=b[m];o[T]||(o[T]=[]);var A=dt(S)?r:S;o[T].push({item:y[0],stackList:y.slice(1),barSize:dt(A)?void 0:qc(A,n,0)})}}return o},m2e=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=qc(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 A={item:T.item,position:{offset:m.offset+m.size+u,size:h?d:T.barSize}},M=[].concat(S4(S),[A]);return m=M[M.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){M.push({item:P,position:m})}),M},f)}else{var y=qc(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,A){var M=[].concat(S4(S),[{item:T.item,position:{offset:y+(_+u)*A+(_-b)/2,size:b}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){M.push({item:P,position:M[M.length-1].position})}),M},f)}return c},y2e=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=KX({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 pr(pr({},t),{},rd({},d,t[d]+(f||0)));if((g==="horizontal"||g==="vertical"&&d==="center")&&v!=="middle"&&we(t[v]))return pr(pr({},t),{},rd({},v,t[v]+(h||0)))}return t},x2e=function(t,r,n){return dt(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},QX=function(t,r,n,i,a){var o=r.props.children,s=oa(o,Qy).filter(function(u){return x2e(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=Un(c,n);if(dt(f))return u;var h=Array.isArray(f)?[qS(f),Al(f)]:[f,f],d=l.reduce(function(v,g){var m=Un(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},_2e=function(t,r,n,i,a){var o=r.map(function(s){return QX(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},JX=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&QX(t,l,u,i)||Ng(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?ja(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!yv(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}})},wC=new WeakMap,vx=function(t,r){if(typeof r!="function")return t;wC.has(t)||wC.set(t,new WeakMap);var n=wC.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},b2e=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:Im(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:d1(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Dg(),realScaleType:"point"}:a==="category"?{scale:Im(),realScaleType:"band"}:{scale:d1(),realScaleType:"linear"};if(Xc(i)){var l="scale".concat(RS(i));return{scale:(m4[l]||Dg)(),realScaleType:m4[l]?l:"point"}}return ft(i)?{scale:i}:{scale:Dg(),realScaleType:"point"}},A4=1e-4,w2e=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])-A4,o=Math.max(i[0],i[1])+A4,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},S2e=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])}},C2e=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)}},M2e={sign:A2e,expand:Fpe,none:_d,silhouette:Vpe,wiggle:Gpe,positive:C2e},P2e=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=M2e[n],o=$pe().keys(i).value(function(s,l){return+Un(s,l,0)}).order(hL).offset(a);return o(t)},L2e=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?pr(pr({},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[xv("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return pr(pr({},f),{},rd({},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 pr(pr({},g),{},rd({},m,{numericAxisId:n,cateAxisId:i,items:y.items,stackedData:P2e(t,y.items,a)}))},v)}return pr(pr({},f),{},rd({},h,d))},c)},k2e=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=FCe(u,a,s);return t.domain([qS(c),Al(c)]),{niceTicks:c}}if(a&&i==="number"){var f=t.domain(),h=VCe(f,a,s);return{niceTicks:h}}return null};function _1(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=Gb(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Un(i,dt(o)?t.dataKey:o);return dt(l)?null:t.scale(l)}var C4=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=Un(o,r.dataKey,r.domain[s]);return dt(l)?null:r.scale(l)-a/2+i},I2e=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]},O2e=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?pr(pr({},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},E2e=function(t){return t.reduce(function(r,n){return[qS(n.concat([r[0]]).filter(we)),Al(n.concat([r[1]]).filter(we))]},[1/0,-1/0])},tq=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=E2e(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})},M4=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,P4=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,VL=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(M4.test(t[0])){var a=+M4.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(P4.test(t[1])){var o=+P4.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},b1=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=yD(r,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;so&&(u=2*Math.PI-u),{radius:s,angle:R2e(u),angleInRadian:u}},$2e=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}},F2e=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},O4=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=$2e(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?I4(I4({},r),{},{radius:o,angle:F2e(d,r)}):null};function Fm(e){"@babel/helpers - typeof";return Fm=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},Fm(e)}var V2e=["offset"];function G2e(e){return Z2e(e)||U2e(e)||H2e(e)||W2e()}function W2e(){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 H2e(e,t){if(e){if(typeof e=="string")return GL(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 GL(e,t)}}function U2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Z2e(e){if(Array.isArray(e))return GL(e)}function GL(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 X2e(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 E4(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=pn(u,c,m,b),A=pn(u,c,m,b+(S?1:-1)*359),M="M".concat(T.x,",").concat(T.y,` A`).concat(m,",").concat(m,",0,1,").concat(S?0:1,`, - `).concat(A.x,",").concat(A.y),P=dt(t.id)?yv("recharts-radial-line-"):t.id;return Q.createElement("text",Fm({},n,{dominantBaseline:"central",className:xt("recharts-radial-bar-label",s)}),Q.createElement("defs",null,Q.createElement("path",{id:P,d:M})),Q.createElement("textPath",{xlinkHref:"#".concat(P)},r))},rMe=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=pn(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=pn(o,s,m,h),x=y.x,b=y.y;return{x,y:b,textAnchor:"middle",verticalAnchor:"middle"}},nMe=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",x=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 A={x:s+u+m,y:l+c/2,textAnchor:x,verticalAnchor:"middle"};return Br(Br({},A),n?{width:Math.max(n.x+n.width-A.x,0),height:c}:{})}var M=n?{width:u,height:c}:{};return a==="insideLeft"?Br({x:s+m,y:l+c/2,textAnchor:x,verticalAnchor:"middle"},M):a==="insideRight"?Br({x:s+u-m,y:l+c/2,textAnchor:y,verticalAnchor:"middle"},M):a==="insideTop"?Br({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},M):a==="insideBottom"?Br({x:s+u/2,y:l+c-h,textAnchor:"middle",verticalAnchor:d},M):a==="insideTopLeft"?Br({x:s+m,y:l+h,textAnchor:x,verticalAnchor:v},M):a==="insideTopRight"?Br({x:s+u-m,y:l+h,textAnchor:y,verticalAnchor:v},M):a==="insideBottomLeft"?Br({x:s+m,y:l+c-h,textAnchor:x,verticalAnchor:d},M):a==="insideBottomRight"?Br({x:s+u-m,y:l+c-h,textAnchor:y,verticalAnchor:d},M):dv(a)&&(we(a.x)||mc(a.x))&&(we(a.y)||mc(a.y))?Br({x:s+Xc(a.x,u),y:l+Xc(a.y,c),textAnchor:"end",verticalAnchor:"end"},M):Br({x:s+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},M)},iMe=function(t){return"cx"in t&&we(t.cx)};function In(e){var t=e.offset,r=t===void 0?5:t,n=Y2e(e,V2e),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=J2e(i);var v=iMe(a),g=ct(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return tMe(i,d,g);var m=v?rMe(i):nMe(i);return Q.createElement(i1,Fm({className:xt("recharts-label",f)},g,m,{breakAll:h}),d)}In.displayName="Label";var nq=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,x=t.labelViewBox;if(x)return x;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:{}},aMe=function(t,r){return t?t===!0?Q.createElement(In,{key:"label-implicit",viewBox:r}):Vr(t)?Q.createElement(In,{key:"label-implicit",viewBox:r,value:t}):W.isValidElement(t)?t.type===In?W.cloneElement(t,{key:"label-implicit",viewBox:r}):Q.createElement(In,{key:"label-implicit",content:t,viewBox:r}):ft(t)?Q.createElement(In,{key:"label-implicit",content:t,viewBox:r}):dv(t)?Q.createElement(In,Fm({viewBox:r},t,{key:"label-implicit"})):null:null},oMe=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=nq(t),o=oa(i,In).map(function(l,u){return W.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=aMe(t.label,r||a);return[s].concat(G2e(o))};In.parseViewBox=nq;In.renderCallByParent=oMe;function sMe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var lMe=sMe;const uMe=$t(lMe);function Vm(e){"@babel/helpers - typeof";return Vm=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},Vm(e)}var cMe=["valueAccessor"],fMe=["data","dataKey","clockWise","id","textBreakAll"];function hMe(e){return gMe(e)||pMe(e)||vMe(e)||dMe()}function dMe(){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 vMe(e,t){if(e){if(typeof e=="string")return WL(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 WL(e,t)}}function pMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gMe(e){if(Array.isArray(e))return WL(e)}function WL(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 _Me(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 bMe=function(t){return Array.isArray(t.value)?uMe(t.value):t.value};function Ss(e){var t=e.valueAccessor,r=t===void 0?bMe:t,n=j4(e,cMe),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=j4(n,fMe);return!i||!i.length?null:Q.createElement(Yt,{className:"recharts-label-list"},i.map(function(c,f){var h=dt(a)?r(c,f):Un(c&&c.payload,a),d=dt(s)?{}:{id:"".concat(s,"-").concat(f)};return Q.createElement(In,w1({},ct(c,!0),u,d,{parentViewBox:c.parentViewBox,value:h,textBreakAll:l,viewBox:In.parseViewBox(dt(o)?c:N4(N4({},c),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Ss.displayName="LabelList";function wMe(e,t){return e?e===!0?Q.createElement(Ss,{key:"labelList-implicit",data:t}):Q.isValidElement(e)||ft(e)?Q.createElement(Ss,{key:"labelList-implicit",data:t,content:e}):dv(e)?Q.createElement(Ss,w1({data:t},e,{key:"labelList-implicit"})):null:null}function SMe(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=oa(n,Ss).map(function(o,s){return W.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=wMe(e.label,t);return[a].concat(hMe(i))}Ss.renderCallByParent=SMe;function Gm(e){"@babel/helpers - typeof";return Gm=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},Gm(e)}function HL(){return HL=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,y=pn(o,s,m,h),_=y.x,b=y.y;return{x:_,y:b,textAnchor:"middle",verticalAnchor:"middle"}},nMe=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 A={x:s+u+m,y:l+c/2,textAnchor:_,verticalAnchor:"middle"};return Br(Br({},A),n?{width:Math.max(n.x+n.width-A.x,0),height:c}:{})}var M=n?{width:u,height:c}:{};return a==="insideLeft"?Br({x:s+m,y:l+c/2,textAnchor:_,verticalAnchor:"middle"},M):a==="insideRight"?Br({x:s+u-m,y:l+c/2,textAnchor:y,verticalAnchor:"middle"},M):a==="insideTop"?Br({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},M):a==="insideBottom"?Br({x:s+u/2,y:l+c-h,textAnchor:"middle",verticalAnchor:d},M):a==="insideTopLeft"?Br({x:s+m,y:l+h,textAnchor:_,verticalAnchor:v},M):a==="insideTopRight"?Br({x:s+u-m,y:l+h,textAnchor:y,verticalAnchor:v},M):a==="insideBottomLeft"?Br({x:s+m,y:l+c-h,textAnchor:_,verticalAnchor:d},M):a==="insideBottomRight"?Br({x:s+u-m,y:l+c-h,textAnchor:y,verticalAnchor:d},M):vv(a)&&(we(a.x)||yc(a.x))&&(we(a.y)||yc(a.y))?Br({x:s+qc(a.x,u),y:l+qc(a.y,c),textAnchor:"end",verticalAnchor:"end"},M):Br({x:s+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},M)},iMe=function(t){return"cx"in t&&we(t.cx)};function In(e){var t=e.offset,r=t===void 0?5:t,n=Y2e(e,V2e),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=J2e(i);var v=iMe(a),g=ct(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return tMe(i,d,g);var m=v?rMe(i):nMe(i);return Q.createElement(a1,Vm({className:xt("recharts-label",f)},g,m,{breakAll:h}),d)}In.displayName="Label";var nq=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:{}},aMe=function(t,r){return t?t===!0?Q.createElement(In,{key:"label-implicit",viewBox:r}):Vr(t)?Q.createElement(In,{key:"label-implicit",viewBox:r,value:t}):W.isValidElement(t)?t.type===In?W.cloneElement(t,{key:"label-implicit",viewBox:r}):Q.createElement(In,{key:"label-implicit",content:t,viewBox:r}):ft(t)?Q.createElement(In,{key:"label-implicit",content:t,viewBox:r}):vv(t)?Q.createElement(In,Vm({viewBox:r},t,{key:"label-implicit"})):null:null},oMe=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=nq(t),o=oa(i,In).map(function(l,u){return W.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=aMe(t.label,r||a);return[s].concat(G2e(o))};In.parseViewBox=nq;In.renderCallByParent=oMe;function sMe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var lMe=sMe;const uMe=Ft(lMe);function Gm(e){"@babel/helpers - typeof";return Gm=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},Gm(e)}var cMe=["valueAccessor"],fMe=["data","dataKey","clockWise","id","textBreakAll"];function hMe(e){return gMe(e)||pMe(e)||vMe(e)||dMe()}function dMe(){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 vMe(e,t){if(e){if(typeof e=="string")return WL(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 WL(e,t)}}function pMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gMe(e){if(Array.isArray(e))return WL(e)}function WL(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 _Me(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 bMe=function(t){return Array.isArray(t.value)?uMe(t.value):t.value};function Ss(e){var t=e.valueAccessor,r=t===void 0?bMe:t,n=j4(e,cMe),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=j4(n,fMe);return!i||!i.length?null:Q.createElement(Xt,{className:"recharts-label-list"},i.map(function(c,f){var h=dt(a)?r(c,f):Un(c&&c.payload,a),d=dt(s)?{}:{id:"".concat(s,"-").concat(f)};return Q.createElement(In,S1({},ct(c,!0),u,d,{parentViewBox:c.parentViewBox,value:h,textBreakAll:l,viewBox:In.parseViewBox(dt(o)?c:N4(N4({},c),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Ss.displayName="LabelList";function wMe(e,t){return e?e===!0?Q.createElement(Ss,{key:"labelList-implicit",data:t}):Q.isValidElement(e)||ft(e)?Q.createElement(Ss,{key:"labelList-implicit",data:t,content:e}):vv(e)?Q.createElement(Ss,S1({data:t},e,{key:"labelList-implicit"})):null:null}function SMe(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=oa(n,Ss).map(function(o,s){return W.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=wMe(e.label,t);return[a].concat(hMe(i))}Ss.renderCallByParent=SMe;function Wm(e){"@babel/helpers - typeof";return Wm=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},Wm(e)}function HL(){return HL=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=pn(r,n,i,o),v=pn(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},PMe=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=ja(c-u),h=vx({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,v=h.lineTangency,g=h.theta,m=vx({cx:r,cy:n,radius:a,angle:c,sign:-f,cornerRadius:o,cornerIsExternal:l}),y=m.circleTangency,x=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},PMe=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=ja(c-u),h=px({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,v=h.lineTangency,g=h.theta,m=px({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,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 `):iq({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(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,` - `);if(i>0){var A=vx({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),M=A.circleTangency,P=A.lineTangency,k=A.theta,I=vx({cx:r,cy:n,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=I.circleTangency,D=I.lineTangency,N=I.theta,B=l?Math.abs(u-c):Math.abs(u-c)-k-N;if(B<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(_.x,",").concat(_.y,` + `);if(i>0){var A=px({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),M=A.circleTangency,P=A.lineTangency,k=A.theta,I=px({cx:r,cy:n,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=I.circleTangency,D=I.lineTangency,N=I.theta,B=l?Math.abs(u-c):Math.abs(u-c)-k-N;if(B<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(O.x,",").concat(O.y,` A`).concat(i,",").concat(i,",0,").concat(+(B>180),",").concat(+(f>0),",").concat(M.x,",").concat(M.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},LMe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},aq=function(t){var r=B4(B4({},LMe),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=PMe({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(g,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):m=iq({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:f}),Q.createElement("path",HL({},ct(r,!0),{className:d,d:m,role:"img"}))};function Wm(e){"@babel/helpers - typeof";return Wm=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},Wm(e)}function UL(){return UL=Object.assign?Object.assign.bind():function(e){for(var t=1;tVMe.call(e,t));function yf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const HMe="__v",UMe="__o",ZMe="_owner",{getOwnPropertyDescriptor:G4,keys:W4}=Object;function YMe(e,t){return e.byteLength===t.byteLength&&S1(new Uint8Array(e),new Uint8Array(t))}function XMe(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 qMe(e,t){return e.byteLength===t.byteLength&&S1(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function KMe(e,t){return yf(e.getTime(),t.getTime())}function QMe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function JMe(e,t){return e===t}function H4(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 ePe=yf;function tPe(e,t,r){const n=W4(e);let i=n.length;if(W4(t).length!==i)return!1;for(;i-- >0;)if(!uq(e,t,r,n[i]))return!1;return!0}function Tp(e,t,r){const n=V4(e);let i=n.length;if(V4(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!uq(e,t,r,a)||(o=G4(e,a),s=G4(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function rPe(e,t){return yf(e.valueOf(),t.valueOf())}function nPe(e,t){return e.source===t.source&&e.flags===t.flags}function U4(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 S1(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 iPe(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 uq(e,t,r,n){return(n===ZMe||n===UMe||n===HMe)&&(e.$$typeof||t.$$typeof)?!0:WMe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const aPe="[object ArrayBuffer]",oPe="[object Arguments]",sPe="[object Boolean]",lPe="[object DataView]",uPe="[object Date]",cPe="[object Error]",fPe="[object Map]",hPe="[object Number]",dPe="[object Object]",vPe="[object RegExp]",pPe="[object Set]",gPe="[object String]",mPe={"[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},yPe="[object URL]",xPe=Object.prototype.toString;function _Pe({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,x){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,x):b==="function"?a(m,y,x):!1;const S=m.constructor;if(S!==y.constructor)return!1;if(S===Object)return l(m,y,x);if(Array.isArray(m))return t(m,y,x);if(S===Date)return n(m,y,x);if(S===RegExp)return c(m,y,x);if(S===Map)return o(m,y,x);if(S===Set)return f(m,y,x);const T=xPe.call(m);if(T===uPe)return n(m,y,x);if(T===vPe)return c(m,y,x);if(T===fPe)return o(m,y,x);if(T===pPe)return f(m,y,x);if(T===dPe)return typeof m.then!="function"&&typeof y.then!="function"&&l(m,y,x);if(T===yPe)return d(m,y,x);if(T===cPe)return i(m,y,x);if(T===oPe)return l(m,y,x);if(mPe[T])return h(m,y,x);if(T===aPe)return e(m,y,x);if(T===lPe)return r(m,y,x);if(T===sPe||T===hPe||T===gPe)return u(m,y,x);if(v){let A=v[T];if(!A){const M=GMe(m);M&&(A=v[M])}if(A)return A(m,y,x)}return!1}}function bPe({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:YMe,areArraysEqual:r?Tp:XMe,areDataViewsEqual:qMe,areDatesEqual:KMe,areErrorsEqual:QMe,areFunctionsEqual:JMe,areMapsEqual:r?wC(H4,Tp):H4,areNumbersEqual:ePe,areObjectsEqual:r?Tp:tPe,arePrimitiveWrappersEqual:rPe,areRegExpsEqual:nPe,areSetsEqual:r?wC(U4,Tp):U4,areTypedArraysEqual:r?wC(S1,Tp):S1,areUrlsEqual:iPe,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=gx(n.areArraysEqual),a=gx(n.areMapsEqual),o=gx(n.areObjectsEqual),s=gx(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function wPe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function SPe({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 TPe=du();du({strict:!0});du({circular:!0});du({circular:!0,strict:!0});du({createInternalComparator:()=>yf});du({strict:!0,createInternalComparator:()=>yf});du({circular:!0,createInternalComparator:()=>yf});du({circular:!0,createInternalComparator:()=>yf,strict:!0});function du(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=bPe(e),o=_Pe(a),s=r?r(o):wPe(o);return SPe({circular:t,comparator:o,createState:n,equals:s,strict:i})}function APe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Z4(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):APe(i)};requestAnimationFrame(n)}function ZL(e){"@babel/helpers - typeof";return ZL=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},ZL(e)}function CPe(e){return kPe(e)||LPe(e)||PPe(e)||MPe()}function MPe(){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 PPe(e,t){if(e){if(typeof e=="string")return Y4(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 Y4(e,t)}}function Y4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&Math.abs(c-f)<360?m=PMe({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(g,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):m=iq({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:f}),Q.createElement("path",HL({},ct(r,!0),{className:d,d:m,role:"img"}))};function Hm(e){"@babel/helpers - typeof";return Hm=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},Hm(e)}function UL(){return UL=Object.assign?Object.assign.bind():function(e){for(var t=1;tVMe.call(e,t));function xf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const HMe="__v",UMe="__o",ZMe="_owner",{getOwnPropertyDescriptor:G4,keys:W4}=Object;function YMe(e,t){return e.byteLength===t.byteLength&&T1(new Uint8Array(e),new Uint8Array(t))}function XMe(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 qMe(e,t){return e.byteLength===t.byteLength&&T1(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function KMe(e,t){return xf(e.getTime(),t.getTime())}function QMe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function JMe(e,t){return e===t}function H4(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 ePe=xf;function tPe(e,t,r){const n=W4(e);let i=n.length;if(W4(t).length!==i)return!1;for(;i-- >0;)if(!uq(e,t,r,n[i]))return!1;return!0}function Ap(e,t,r){const n=V4(e);let i=n.length;if(V4(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!uq(e,t,r,a)||(o=G4(e,a),s=G4(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function rPe(e,t){return xf(e.valueOf(),t.valueOf())}function nPe(e,t){return e.source===t.source&&e.flags===t.flags}function U4(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 T1(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 iPe(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 uq(e,t,r,n){return(n===ZMe||n===UMe||n===HMe)&&(e.$$typeof||t.$$typeof)?!0:WMe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const aPe="[object ArrayBuffer]",oPe="[object Arguments]",sPe="[object Boolean]",lPe="[object DataView]",uPe="[object Date]",cPe="[object Error]",fPe="[object Map]",hPe="[object Number]",dPe="[object Object]",vPe="[object RegExp]",pPe="[object Set]",gPe="[object String]",mPe={"[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},yPe="[object URL]",xPe=Object.prototype.toString;function _Pe({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=xPe.call(m);if(T===uPe)return n(m,y,_);if(T===vPe)return c(m,y,_);if(T===fPe)return o(m,y,_);if(T===pPe)return f(m,y,_);if(T===dPe)return typeof m.then!="function"&&typeof y.then!="function"&&l(m,y,_);if(T===yPe)return d(m,y,_);if(T===cPe)return i(m,y,_);if(T===oPe)return l(m,y,_);if(mPe[T])return h(m,y,_);if(T===aPe)return e(m,y,_);if(T===lPe)return r(m,y,_);if(T===sPe||T===hPe||T===gPe)return u(m,y,_);if(v){let A=v[T];if(!A){const M=GMe(m);M&&(A=v[M])}if(A)return A(m,y,_)}return!1}}function bPe({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:YMe,areArraysEqual:r?Ap:XMe,areDataViewsEqual:qMe,areDatesEqual:KMe,areErrorsEqual:QMe,areFunctionsEqual:JMe,areMapsEqual:r?SC(H4,Ap):H4,areNumbersEqual:ePe,areObjectsEqual:r?Ap:tPe,arePrimitiveWrappersEqual:rPe,areRegExpsEqual:nPe,areSetsEqual:r?SC(U4,Ap):U4,areTypedArraysEqual:r?SC(T1,Ap):T1,areUrlsEqual:iPe,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=mx(n.areArraysEqual),a=mx(n.areMapsEqual),o=mx(n.areObjectsEqual),s=mx(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function wPe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function SPe({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 TPe=vu();vu({strict:!0});vu({circular:!0});vu({circular:!0,strict:!0});vu({createInternalComparator:()=>xf});vu({strict:!0,createInternalComparator:()=>xf});vu({circular:!0,createInternalComparator:()=>xf});vu({circular:!0,createInternalComparator:()=>xf,strict:!0});function vu(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=bPe(e),o=_Pe(a),s=r?r(o):wPe(o);return SPe({circular:t,comparator:o,createState:n,equals:s,strict:i})}function APe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Z4(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):APe(i)};requestAnimationFrame(n)}function ZL(e){"@babel/helpers - typeof";return ZL=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},ZL(e)}function CPe(e){return kPe(e)||LPe(e)||PPe(e)||MPe()}function MPe(){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 PPe(e,t){if(e){if(typeof e=="string")return Y4(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 Y4(e,t)}}function Y4(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 x=y>1?1:y,b=x,S=0;S<8;++S){var T=f(b)-x,A=d(b);if(Math.abs(T-x)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 sLe(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 SC(e){return fLe(e)||cLe(e)||uLe(e)||lLe()}function lLe(){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 uLe(e,t){if(e){if(typeof e=="string")return QL(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 QL(e,t)}}function cLe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fLe(e){if(Array.isArray(e))return QL(e)}function QL(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 C1(e){return C1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},C1(e)}var Ro=function(e){gLe(r,e);var t=mLe(r);function r(n,i){var a;hLe(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(tk(a)),a.changeStyle=a.changeStyle.bind(tk(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:c}),ek(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},ek(a);a.state={style:l?ug({},l,u):u}}else a.state={style:{}};return a}return vLe(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?ug({},l,c):c};this.state&&h&&(l&&h[l]!==c||!l&&h!==c)&&this.setState(d);return}if(!(TPe(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?ug({},l,g):g};(l&&h[l]!==g||!l&&h!==g)&&this.setState(m)}this.runAnimation(Ta(Ta({},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=iLe(o,s,ZPe(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 x=m.duration,b=m.easing,S=b===void 0?"ease":b,T=m.style,A=m.properties,M=m.onAnimationEnd,P=y>0?o[y-1]:m,k=A||Object.keys(T);if(typeof S=="function"||S==="spring")return[].concat(SC(g),[a.runJSAnimation.bind(a,{from:P.style,to:T,duration:x,easing:S}),x]);var I=K4(k,x,S),O=Ta(Ta(Ta({},P.style),T),{},{transition:I});return[].concat(SC(g),[O,x,M]).filter(NPe)};return this.manager.start([l].concat(SC(o.reduce(d,[c,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=IPe());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?ug({},s,l):l,m=K4(Object.keys(g),o,u);v.start([c,a,Ta(Ta({},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=oLe(i,aLe),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,x=W.cloneElement(d,Ta(Ta({},l),{},{style:Ta(Ta({},m),c),className:y}));return x};return u===1?f(W.Children.only(a)):Q.createElement("div",null,W.Children.map(a,function(h){return f(h)}))}}]),r}(W.PureComponent);Ro.displayName="Animate";Ro.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ro.propTypes={from:kt.oneOfType([kt.object,kt.string]),to:kt.oneOfType([kt.object,kt.string]),attributeName:kt.string,duration:kt.number,begin:kt.number,easing:kt.oneOfType([kt.string,kt.func]),steps:kt.arrayOf(kt.shape({duration:kt.number.isRequired,style:kt.object.isRequired,easing:kt.oneOfType([kt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),kt.func]),properties:kt.arrayOf("string"),onAnimationEnd:kt.func})),children:kt.oneOfType([kt.node,kt.func]),isActive:kt.bool,canBegin:kt.bool,onAnimationEnd:kt.func,shouldReAnimate:kt.bool,onAnimationStart:kt.func,onAnimationReStart:kt.func};function Zm(e){"@babel/helpers - typeof";return Zm=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},Zm(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?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,`, +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fq(e,t){if(e){if(typeof e=="string")return YL(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 YL(e,t)}}function GPe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WPe(e){if(Array.isArray(e))return YL(e)}function YL(e,t){(t==null||t>e.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)-_,A=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 sLe(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 TC(e){return fLe(e)||cLe(e)||uLe(e)||lLe()}function lLe(){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 uLe(e,t){if(e){if(typeof e=="string")return QL(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 QL(e,t)}}function cLe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fLe(e){if(Array.isArray(e))return QL(e)}function QL(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 M1(e){return M1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},M1(e)}var Ro=function(e){gLe(r,e);var t=mLe(r);function r(n,i){var a;hLe(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(tk(a)),a.changeStyle=a.changeStyle.bind(tk(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:c}),ek(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},ek(a);a.state={style:l?cg({},l,u):u}}else a.state={style:{}};return a}return vLe(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?cg({},l,c):c};this.state&&h&&(l&&h[l]!==c||!l&&h!==c)&&this.setState(d);return}if(!(TPe(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?cg({},l,g):g};(l&&h[l]!==g||!l&&h!==g)&&this.setState(m)}this.runAnimation(Ta(Ta({},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=iLe(o,s,ZPe(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,A=m.properties,M=m.onAnimationEnd,P=y>0?o[y-1]:m,k=A||Object.keys(T);if(typeof S=="function"||S==="spring")return[].concat(TC(g),[a.runJSAnimation.bind(a,{from:P.style,to:T,duration:_,easing:S}),_]);var I=K4(k,_,S),O=Ta(Ta(Ta({},P.style),T),{},{transition:I});return[].concat(TC(g),[O,_,M]).filter(NPe)};return this.manager.start([l].concat(TC(o.reduce(d,[c,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=IPe());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?cg({},s,l):l,m=K4(Object.keys(g),o,u);v.start([c,a,Ta(Ta({},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=oLe(i,aLe),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,Ta(Ta({},l),{},{style:Ta(Ta({},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);Ro.displayName="Animate";Ro.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ro.propTypes={from:kt.oneOfType([kt.object,kt.string]),to:kt.oneOfType([kt.object,kt.string]),attributeName:kt.string,duration:kt.number,begin:kt.number,easing:kt.oneOfType([kt.string,kt.func]),steps:kt.arrayOf(kt.shape({duration:kt.number.isRequired,style:kt.object.isRequired,easing:kt.oneOfType([kt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),kt.func]),properties:kt.arrayOf("string"),onAnimationEnd:kt.func})),children:kt.oneOfType([kt.node,kt.func]),isActive:kt.bool,canBegin:kt.bool,onAnimationEnd:kt.func,shouldReAnimate:kt.bool,onAnimationStart:kt.func,onAnimationReStart:kt.func};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)}function P1(){return P1=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,` @@ -441,13 +441,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},MLe=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},PLe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},HD=function(t){var r=a$(a$({},PLe),t),n=W.useRef(),i=W.useState(-1),a=xLe(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,x=r.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||c===0||f===0)return null;var b=xt("recharts-rectangle",d);return x?Q.createElement(Ro,{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:x},function(S){var T=S.width,A=S.height,M=S.x,P=S.y;return Q.createElement(Ro,{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",M1({},ct(r,!0),{className:b,d:o$(M,P,T,A,h),ref:n})))}):Q.createElement("path",M1({},ct(r,!0),{className:b,d:o$(l,u,c,f,h)}))};function rk(){return rk=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 NLe(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 jLe=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},RLe=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=DLe(t,LLe),m=kLe({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",nk({},ct(m,!0),{className:xt("recharts-cross",v),d:jLe(n,a,f,d,s,u)}))},BLe=IY,zLe=BLe(Object.getPrototypeOf,Object),$Le=zLe,FLe=Zs,VLe=$Le,GLe=Ys,WLe="[object Object]",HLe=Function.prototype,ULe=Object.prototype,gq=HLe.toString,ZLe=ULe.hasOwnProperty,YLe=gq.call(Object);function XLe(e){if(!GLe(e)||FLe(e)!=WLe)return!1;var t=VLe(e);if(t===null)return!0;var r=ZLe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&gq.call(r)==YLe}var qLe=XLe;const KLe=$t(qLe);var QLe=Zs,JLe=Ys,eke="[object Boolean]";function tke(e){return e===!0||e===!1||JLe(e)&&QLe(e)==eke}var rke=tke;const nke=$t(rke);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 P1(){return P1=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,A=b.height,M=b.x,P=b.y;return Q.createElement(Ro,{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",P1({},ct(r,!0),{className:x,d:f$(M,P,S,T,A),ref:n})))}):Q.createElement("g",null,Q.createElement("path",P1({},ct(r,!0),{className:x,d:f$(l,u,c,f,h)})))},vke=["option","shapeType","propTransformer","activeClassName","isActive"];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 pke(e,t){if(e==null)return{};var r=gke(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 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}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 L1(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),mi(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()}),mi(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),mi(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),mi(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),mi(n,"handleSlideDragStart",function(i){var a=x$(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 tIe(t,e),Kke(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=Un(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=x$(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},x=n.pageX-a;x>0?x=Math.min(x,f+h-d-u):x<0&&(x=Math.max(x,f-u)),y[o]=u+x;var b=this.getIndex(y),S=b.startIndex,T=b.endIndex,A=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(mi(mi({},o,u+x),"brushMoveStartX",n.pageX),function(){v&&A()&&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(mi({},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),x=AC(AC({},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,x))}},{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(i1,I1({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},v),this.getTextOfTick(i)),Q.createElement(i1,I1({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,x=h.isTravellerFocused;if(!i||!i.length||!we(s)||!we(l)||!we(u)||!we(c)||u<=0||c<=0)return null;var b=xt("recharts-brush",a),S=Q.Children.count(o)===1,T=Xke("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||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 AC({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?nIe({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);mi(Id,"displayName","Brush");mi(Id,"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 iIe=mD;function aIe(e,t){var r;return iIe(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var oIe=aIe,sIe=SY,lIe=wv,uIe=oIe,cIe=di,fIe=VS;function hIe(e,t,r){var n=cIe(e)?sIe:uIe;return r&&fIe(e,t,r)&&(t=void 0),n(e,lIe(t))}var dIe=hIe;const vIe=$t(dIe);var ko=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},_$=WY;function pIe(e,t,r){t=="__proto__"&&_$?_$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var gIe=pIe,mIe=gIe,yIe=VY,xIe=wv;function _Ie(e,t){var r={};return t=xIe(t),yIe(e,function(n,i,a){mIe(r,i,t(n,i,a))}),r}var bIe=_Ie;const wIe=$t(bIe);function SIe(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 FIe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function VIe(e,t){var r=e.x,n=e.y,i=$Ie(e,jIe),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 Ap(Ap(Ap(Ap(Ap({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function w$(e){return Q.createElement(Ske,ak({shapeType:"rectangle",propTransformer:VIe,activeClassName:"recharts-active-bar"},e))}var GIe=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)||eve(n);return a?t(n,i):(a||Kc(),r)}},WIe=["value","background"],_q;function Od(e){"@babel/helpers - typeof";return Od=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},Od(e)}function HIe(e,t){if(e==null)return{};var r=UIe(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 UIe(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 E1(){return E1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs($)0&&Math.abs(B)0&&(N=Math.min((ae||0)-(B[ce-1]||0),N))}),Number.isFinite(N)){var $=N/D,F=g.layout==="vertical"?n.height:n.width;if(g.padding==="gap"&&(M=$*F/2),g.padding==="no-gap"){var G=Xc(t.barCategoryGap,$*F),z=$*F/2;M=z-G-(z-G)/F*G}}}i==="xAxis"?P=[n.left+(b.left||0)+(M||0),n.left+n.width-(b.right||0)-(M||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(M||0),n.top+n.height-(b.bottom||0)-(M||0)]:P=g.range,T&&(P=[P[1],P[0]]);var U=b2e(g,a,h),H=U.scale,Y=U.realScaleType;H.domain(y).range(P),w2e(H);var Z=k2e(H,Oa(Oa({},g),{},{realScaleType:Y}));i==="xAxis"?(O=m==="top"&&!S||m==="bottom"&&S,k=n.left,I=f[A]-O*g.height):i==="yAxis"&&(O=m==="left"&&!S||m==="right"&&S,k=f[A]-O*g.width,I=n.top);var J=Oa(Oa(Oa({},g),Z),{},{realScaleType:Y,x:k,y:I,scale:H,width:i==="xAxis"?n.width:g.width,height:i==="yAxis"?n.height:g.height});return J.bandSize=_1(J,Z),!g.hide&&i==="xAxis"?f[A]+=(O?-1:1)*J.height:g.hide||(f[A]+=(O?-1:1)*J.width),Oa(Oa({},d),{},tT({},v,J))},{})},Aq=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)}},nOe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return Aq({x:r,y:n},{x:i,y:a})},Cq=function(){function e(t){eOe(this,e),this.scale=t}return tOe(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)}}])}();tT(Cq,"EPS",1e-4);var UD=function(t){var r=Object.keys(t).reduce(function(n,i){return Oa(Oa({},n),{},tT({},i,Cq.create(t[i])))},{});return Oa(Oa({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return wIe(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return NIe(i,function(a,o){return r[o].isInRange(a)})}})};function iOe(e){return(e%180+180)%180}var aOe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=iOe(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 UOe(e,t){return Gq(e,t+1)}function ZOe(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:Gq(n,u)};var g=l,m,y=function(){return m===void 0&&(m=r(v,g)),m},x=v.coordinate,b=l===0||B1(e,x,y,c,s);b||(l=0,c=o,u+=1),b&&(c=x+e*(y()/2+i),l+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}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 N$(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 Mn(e){for(var t=1;t0?d.coordinate-m*e:d.coordinate})}else a[h]=d=Mn(Mn({},d),{},{tickCoord:d.coordinate});var y=B1(e,d.tickCoord,g,s,l);y&&(l=d.tickCoord-e*(g()/2+i),a[h]=Mn(Mn({},d),{},{isShow:!0}))},c=o-1;c>=0;c--)u(c);return a}function QOe(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=Mn(Mn({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var d=B1(e,c.tickCoord,function(){return f},l,u);d&&(u=c.tickCoord-e*(f/2+i),o[s-1]=Mn(Mn({},c),{},{isShow:!0}))}for(var v=a?s-1:s,g=function(x){var b=o[x],S,T=function(){return S===void 0&&(S=r(b,x)),S};if(x===0){var A=e*(b.coordinate-e*T()/2-l);o[x]=b=Mn(Mn({},b),{},{tickCoord:A<0?b.coordinate-A*e:b.coordinate})}else o[x]=b=Mn(Mn({},b),{},{tickCoord:b.coordinate});var M=B1(e,b.tickCoord,T,l,u);M&&(l=b.tickCoord+e*(T()/2+i),o[x]=Mn(Mn({},b),{},{isShow:!0}))},m=0;m=2?ja(i[1].coordinate-i[0].coordinate):1,y=HOe(a,m,d);return l==="equidistantPreserveStart"?ZOe(m,y,g,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=QOe(m,y,g,i,o,l==="preserveStartEnd"):h=KOe(m,y,g,i,o),h.filter(function(x){return x.isShow}))}var eEe=["viewBox"],tEe=["viewBox"],rEe=["ticks"];function jd(e){"@babel/helpers - typeof";return jd=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},jd(e)}function Nh(){return Nh=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 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 iEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R$(e,t){for(var r=0;r0?l(this.props):l(d)),o<=0||s<=0||!v||!v.length?null:Q.createElement(Yt,{className:xt("recharts-cartesian-axis",u),ref:function(m){n.layerReference=m}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),In.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=xt(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(i1,Nh({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(W.Component);YD(oT,"displayName","CartesianAxis");YD(oT,"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 fEe=["type","layout","connectNulls","ref"],hEe=["key"];function Rd(e){"@babel/helpers - typeof";return Rd=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},Rd(e)}function B$(e,t){if(e==null)return{};var r=dEe(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 dEe(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 jg(){return jg=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(Vf(l.slice(0,v)),[f-g]);break}var m=d.length%2===0?[0,h]:[h];return[].concat(Vf(t.repeat(l,c)),Vf(d),m).map(function(y){return"".concat(y,"px")}).join(", ")}),Ea(r,"id",yv("recharts-line-")),Ea(r,"pathRef",function(o){r.mainCurve=o}),Ea(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Ea(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return SEe(t,e),xEe(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=oa(c,Ky);if(!f)return null;var h=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Un(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=gi(gi(gi({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,jg({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=B$(s,fEe),h=gi(gi(gi({},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(rd,jg({},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,x=y.prevPoints,b=y.totalLength;return Q.createElement(Ro,{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(x){var A=x.length/s.length,M=s.map(function(D,N){var B=Math.floor(N*A);if(x[B]){var $=x[B],F=vn($.x,D.x),G=vn($.y,D.y);return gi(gi({},D),{},{x:F(T),y:G(T)})}if(v){var z=vn(g*2,D.x),U=vn(m/2,D.y);return gi(gi({},D),{},{x:z(T),y:U(T)})}return gi(gi({},D),{},{x:D.x,y:D.y})});return a.renderCurveStatically(M,n,i)}var P=vn(0,b),k=P(T),I;if(l){var O="".concat(l).split(/[,\s]+/gim).map(function(D){return parseFloat(D)});I=a.getStrokeDasharray(k,b,O)}else I=a.generateSimpleStrokeDasharray(b,k);return a.renderCurveStatically(s,n,i,{strokeDasharray:I})})}},{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||!Md(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,x=s.length===1,b=xt("recharts-line",l),S=u&&u.allowDataOverflow,T=c&&c.allowDataOverflow,A=S||T,M=dt(m)?this.id:m,P=(n=ct(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=P.r,I=k===void 0?3:k,O=P.strokeWidth,D=O===void 0?2:O,N=YZ(o)?o:{},B=N.clipDot,$=B===void 0?!0:B,F=I*2+D;return Q.createElement(Yt,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(M)},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})),!$&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(M)},Q.createElement("rect",{x:h-F/2,y:f-F/2,width:d+F,height:v+F}))):null,!x&&this.renderCurve(A,M),this.renderErrorBar(A,M),(x||o)&&this.renderDots(A,$,M),(!g||y)&&Ss.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(Vf(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function MEe(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 bc(){return bc=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Md(c,o)||!Md(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,x=s.length===1,b=xt("recharts-area",l),S=f&&f.allowDataOverflow,T=h&&h.allowDataOverflow,A=S||T,M=dt(m)?this.id:m,P=(n=ct(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=P.r,I=k===void 0?3:k,O=P.strokeWidth,D=O===void 0?2:O,N=YZ(o)?o:{},B=N.clipDot,$=B===void 0?!0:B,F=I*2+D;return Q.createElement(Yt,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(M)},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})),!$&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(M)},Q.createElement("rect",{x:c-F/2,y:u-F/2,width:d+F,height:v+F}))):null,x?null:this.renderArea(A,M),(o||x)&&this.renderDots(A,$,M),(!g||y)&&Ss.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);Yq=vu;_o(vu,"displayName","Area");_o(vu,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!pf.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});_o(vu,"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]});_o(vu,"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=Yq.getBaseValue(t,r,n,i),m=d==="horizontal",y=!1,x=f.map(function(S,T){var A;v?A=u[c+T]:(A=Un(S,l),Array.isArray(A)?y=!0:A=[g,A]);var M=A[1]==null||v&&Un(S,l)==null;return m?{x:x1({axis:n,ticks:a,bandSize:s,entry:S,index:T}),y:M?null:i.scale(A[1]),value:A,payload:S}:{x:M?null:n.scale(A[1]),y:x1({axis:i,ticks:o,bandSize:s,entry:S,index:T}),value:A,payload:S}}),b;return v||y?b=x.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),fl({points:x,baseLine:b,layout:d,isRange:y},h)});_o(vu,"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=xt("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=Xq(t,CEe);r=Q.createElement(QS,bc({},a,{key:i,className:n}))}return r});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 NEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jEe(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 wDe(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 SDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TDe(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 fK(e){return e==="number"?[0,"auto"]:void 0}var Ak=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=Vb(d,o.dataKey,i)}else h=f&&f[n]||s[n];return h?[].concat(Vd(l),[rq(u,h)]):l},[])},Y$=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=jDe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=p2e(o,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,h=Ak(t,r,c,f),d=RDe(n,s,c,a);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},BDe=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=eq(c,a);return n.reduce(function(v,g){var m,y=g.type.defaultProps!==void 0?ue(ue({},g.type.defaultProps),g.props):g.props,x=y.type,b=y.dataKey,S=y.allowDataOverflow,T=y.allowDuplicatedCategory,A=y.scale,M=y.ticks,P=y.includeHidden,k=y[o];if(v[k])return v;var I=sT(t.data,{graphicalItems:i.filter(function(Z){var J,ae=o in Z.props?Z.props[o]:(J=Z.type.defaultProps)===null||J===void 0?void 0:J[o];return ae===k}),dataStartIndex:l,dataEndIndex:u}),O=I.length,D,N,B;cDe(y.domain,S,x)&&(D=VL(y.domain,null,S),d&&(x==="number"||A!=="auto")&&(B=Dg(I,b,"category")));var $=fK(x);if(!D||D.length===0){var F,G=(F=y.domain)!==null&&F!==void 0?F:$;if(b){if(D=Dg(I,b,x),x==="category"&&d){var z=rve(D);T&&z?(N=D,D=k1(0,O)):T||(D=L4(G,D,g).reduce(function(Z,J){return Z.indexOf(J)>=0?Z:[].concat(Vd(Z),[J])},[]))}else if(x==="category")T?D=D.filter(function(Z){return Z!==""&&!dt(Z)}):D=L4(G,D,g).reduce(function(Z,J){return Z.indexOf(J)>=0||J===""||dt(J)?Z:[].concat(Vd(Z),[J])},[]);else if(x==="number"){var U=_2e(I,i.filter(function(Z){var J,ae,ce=o in Z.props?Z.props[o]:(J=Z.type.defaultProps)===null||J===void 0?void 0:J[o],ge="hide"in Z.props?Z.props.hide:(ae=Z.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return ce===k&&(P||!ge)}),b,a,c);U&&(D=U)}d&&(x==="number"||A!=="auto")&&(B=Dg(I,b,"category"))}else d?D=k1(0,O):s&&s[k]&&s[k].hasStack&&x==="number"?D=h==="expand"?[0,1]:tq(s[k].stackGroups,l,u):D=JX(I,i.filter(function(Z){var J=o in Z.props?Z.props[o]:Z.type.defaultProps[o],ae="hide"in Z.props?Z.props.hide:Z.type.defaultProps.hide;return J===k&&(P||!ae)}),x,c,!0);if(x==="number")D=wk(f,D,k,a,M),G&&(D=VL(G,D,S));else if(x==="category"&&G){var H=G,Y=D.every(function(Z){return H.indexOf(Z)>=0});Y&&(D=H)}}return ue(ue({},v),{},Ke({},k,ue(ue({},y),{},{axisType:a,domain:D,categoricalDomain:B,duplicateDomain:N,originalDomain:(m=y.domain)!==null&&m!==void 0?m:$,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=sT(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),d=h.length,v=eq(c,a),g=-1;return n.reduce(function(m,y){var x=y.type.defaultProps!==void 0?ue(ue({},y.type.defaultProps),y.props):y.props,b=x[o],S=fK("number");if(!m[b]){g++;var T;return v?T=k1(0,d):s&&s[b]&&s[b].hasStack?(T=tq(s[b].stackGroups,l,u),T=wk(f,T,b,a)):(T=VL(S,JX(h,n.filter(function(A){var M,P,k=o in A.props?A.props[o]:(M=A.type.defaultProps)===null||M===void 0?void 0:M[o],I="hide"in A.props?A.props.hide:(P=A.type.defaultProps)===null||P===void 0?void 0:P.hide;return k===b&&!I}),"number",c),i.defaultProps.allowDataOverflow),T=wk(f,T,b,a)),ue(ue({},m),{},Ke({},b,ue(ue({axisType:a},i.defaultProps),{},{hide:!0,orientation:aa(DDe,"".concat(a,".").concat(g%2),null),domain:T,originalDomain:S,isCategorical:v,layout:c})))}return m},{})},$De=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=oa(c,a),d={};return h&&h.length?d=BDe(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},FDe=function(t){var r=mh(t),n=_c(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:yD(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:_1(r,n)}},X$=function(t){var r=t.children,n=t.defaultShowTooltip,i=xi(r,Id),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}},VDe=function(t){return!t||!t.length?!1:t.some(function(r){var n=bs(r&&r.type);return n&&n.indexOf("Bar")>=0})},q$=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"}},GDe=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=xi(f,Id),v=xi(f,Jh),g=Object.keys(l).reduce(function(T,A){var M=l[A],P=M.orientation;return!M.mirror&&!M.hide?ue(ue({},T),{},Ke({},P,T[P]+M.width)):T},{left:h.left||0,right:h.right||0}),m=Object.keys(o).reduce(function(T,A){var M=o[A],P=M.orientation;return!M.mirror&&!M.hide?ue(ue({},T),{},Ke({},P,aa(T,"".concat(P))+M.height)):T},{top:h.top||0,bottom:h.bottom||0}),y=ue(ue({},m),g),x=y.bottom;d&&(y.bottom+=d.props.height||Id.defaultProps.height),v&&r&&(y=y2e(y,i,n,r));var b=u-y.left-y.right,S=c-y.top-y.bottom;return ue(ue({brushBottom:x},y),{},{width:Math.max(b,0),height:Math.max(S,0)})},WDe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},hK=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,x){var b=x.graphicalItems,S=x.stackGroups,T=x.offset,A=x.updateId,M=x.dataStartIndex,P=x.dataEndIndex,k=y.barSize,I=y.layout,O=y.barGap,D=y.barCategoryGap,N=y.maxBarSize,B=q$(I),$=B.numericAxisName,F=B.cateAxisName,G=VDe(b),z=[];return b.forEach(function(U,H){var Y=sT(y.data,{graphicalItems:[U],dataStartIndex:M,dataEndIndex:P}),Z=U.type.defaultProps!==void 0?ue(ue({},U.type.defaultProps),U.props):U.props,J=Z.dataKey,ae=Z.maxBarSize,ce=Z["".concat($,"Id")],ge=Z["".concat(F,"Id")],Ge={},xe=l.reduce(function(qr,Jn){var Lf=x["".concat(Jn.axisType,"Map")],w0=Z["".concat(Jn.axisType,"Id")];Lf&&Lf[w0]||Jn.axisType==="zAxis"||Kc();var S0=Lf[w0];return ue(ue({},qr),{},Ke(Ke({},Jn.axisType,S0),"".concat(Jn.axisType,"Ticks"),_c(S0)))},Ge),ne=xe[F],fe=xe["".concat(F,"Ticks")],le=S&&S[ce]&&S[ce].hasStack&&O2e(U,S[ce].stackGroups),ee=bs(U.type).indexOf("Bar")>=0,$e=_1(ne,fe),Se=[],Fe=G&&g2e({barSize:k,stackGroups:S,totalSize:WDe(xe,F)});if(ee){var Ye,vt,Ft=dt(ae)?N:ae,nr=(Ye=(vt=_1(ne,fe,!0))!==null&&vt!==void 0?vt:Ft)!==null&&Ye!==void 0?Ye:0;Se=m2e({barGap:O,barCategoryGap:D,bandSize:nr!==$e?nr:$e,sizeList:Fe[ge],maxBarSize:Ft}),nr!==$e&&(Se=Se.map(function(qr){return ue(ue({},qr),{},{position:ue(ue({},qr.position),{},{offset:qr.position.offset-nr/2})})}))}var jn=U&&U.type&&U.type.getComposedData;jn&&z.push({props:ue(ue({},jn(ue(ue({},xe),{},{displayedData:Y,props:y,dataKey:J,item:U,bandSize:$e,barPosition:Se,offset:T,stackedData:le,layout:I,dataStartIndex:M,dataEndIndex:P}))),{},Ke(Ke(Ke({key:U.key||"item-".concat(H)},$,xe[$]),F,xe[F]),"animationId",A)),childIndex:vve(U,y.children),item:U})}),z},d=function(y,x){var b=y.props,S=y.dataStartIndex,T=y.dataEndIndex,A=y.updateId;if(!S3({props:b}))return null;var M=b.children,P=b.layout,k=b.stackOffset,I=b.data,O=b.reverseStackOrder,D=q$(P),N=D.numericAxisName,B=D.cateAxisName,$=oa(M,n),F=L2e(I,$,"".concat(N,"Id"),"".concat(B,"Id"),k,O),G=l.reduce(function(Z,J){var ae="".concat(J.axisType,"Map");return ue(ue({},Z),{},Ke({},ae,$De(b,ue(ue({},J),{},{graphicalItems:$,stackGroups:J.axisType===N&&F,dataStartIndex:S,dataEndIndex:T}))))},{}),z=GDe(ue(ue({},G),{},{props:b,graphicalItems:$}),x==null?void 0:x.legendBBox);Object.keys(G).forEach(function(Z){G[Z]=c(b,G[Z],z,Z.replace("Map",""),r)});var U=G["".concat(B,"Map")],H=FDe(U),Y=h(b,ue(ue({},G),{},{dataStartIndex:S,dataEndIndex:T,updateId:A,graphicalItems:$,stackGroups:F,offset:z}));return ue(ue({formattedGraphicalItems:Y,graphicalItems:$,offset:z,stackGroups:F},H),G)},v=function(m){function y(x){var b,S,T;return SDe(this,y),T=CDe(this,y,[x]),Ke(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ke(T,"accessibilityManager",new uDe),Ke(T,"handleLegendBBoxUpdate",function(A){if(A){var M=T.state,P=M.dataStartIndex,k=M.dataEndIndex,I=M.updateId;T.setState(ue({legendBBox:A},d({props:T.props,dataStartIndex:P,dataEndIndex:k,updateId:I},ue(ue({},T.state),{},{legendBBox:A}))))}}),Ke(T,"handleReceiveSyncEvent",function(A,M,P){if(T.props.syncId===A){if(P===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(M)}}),Ke(T,"handleBrushChange",function(A){var M=A.startIndex,P=A.endIndex;if(M!==T.state.dataStartIndex||P!==T.state.dataEndIndex){var k=T.state.updateId;T.setState(function(){return ue({dataStartIndex:M,dataEndIndex:P},d({props:T.props,dataStartIndex:M,dataEndIndex:P,updateId:k},T.state))}),T.triggerSyncEvent({dataStartIndex:M,dataEndIndex:P})}}),Ke(T,"handleMouseEnter",function(A){var M=T.getMouseInfo(A);if(M){var P=ue(ue({},M),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var k=T.props.onMouseEnter;ft(k)&&k(P,A)}}),Ke(T,"triggeredAfterMouseMove",function(A){var M=T.getMouseInfo(A),P=M?ue(ue({},M),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(P),T.triggerSyncEvent(P);var k=T.props.onMouseMove;ft(k)&&k(P,A)}),Ke(T,"handleItemMouseEnter",function(A){T.setState(function(){return{isTooltipActive:!0,activeItem:A,activePayload:A.tooltipPayload,activeCoordinate:A.tooltipPosition||{x:A.cx,y:A.cy}}})}),Ke(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),Ke(T,"handleMouseMove",function(A){A.persist(),T.throttleTriggeredAfterMouseMove(A)}),Ke(T,"handleMouseLeave",function(A){T.throttleTriggeredAfterMouseMove.cancel();var M={isTooltipActive:!1};T.setState(M),T.triggerSyncEvent(M);var P=T.props.onMouseLeave;ft(P)&&P(M,A)}),Ke(T,"handleOuterEvent",function(A){var M=dve(A),P=aa(T.props,"".concat(M));if(M&&ft(P)){var k,I;/.*touch.*/i.test(M)?I=T.getMouseInfo(A.changedTouches[0]):I=T.getMouseInfo(A),P((k=I)!==null&&k!==void 0?k:{},A)}}),Ke(T,"handleClick",function(A){var M=T.getMouseInfo(A);if(M){var P=ue(ue({},M),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var k=T.props.onClick;ft(k)&&k(P,A)}}),Ke(T,"handleMouseDown",function(A){var M=T.props.onMouseDown;if(ft(M)){var P=T.getMouseInfo(A);M(P,A)}}),Ke(T,"handleMouseUp",function(A){var M=T.props.onMouseUp;if(ft(M)){var P=T.getMouseInfo(A);M(P,A)}}),Ke(T,"handleTouchMove",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(A.changedTouches[0])}),Ke(T,"handleTouchStart",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&T.handleMouseDown(A.changedTouches[0])}),Ke(T,"handleTouchEnd",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&T.handleMouseUp(A.changedTouches[0])}),Ke(T,"handleDoubleClick",function(A){var M=T.props.onDoubleClick;if(ft(M)){var P=T.getMouseInfo(A);M(P,A)}}),Ke(T,"handleContextMenu",function(A){var M=T.props.onContextMenu;if(ft(M)){var P=T.getMouseInfo(A);M(P,A)}}),Ke(T,"triggerSyncEvent",function(A){T.props.syncId!==void 0&&MC.emit(PC,T.props.syncId,A,T.eventEmitterSymbol)}),Ke(T,"applySyncEvent",function(A){var M=T.props,P=M.layout,k=M.syncMethod,I=T.state.updateId,O=A.dataStartIndex,D=A.dataEndIndex;if(A.dataStartIndex!==void 0||A.dataEndIndex!==void 0)T.setState(ue({dataStartIndex:O,dataEndIndex:D},d({props:T.props,dataStartIndex:O,dataEndIndex:D,updateId:I},T.state)));else if(A.activeTooltipIndex!==void 0){var N=A.chartX,B=A.chartY,$=A.activeTooltipIndex,F=T.state,G=F.offset,z=F.tooltipTicks;if(!G)return;if(typeof k=="function")$=k(z,A);else if(k==="value"){$=-1;for(var U=0;U=0){var le,ee;if(N.dataKey&&!N.allowDuplicatedCategory){var $e=typeof N.dataKey=="function"?fe:"payload.".concat(N.dataKey.toString());le=Vb(U,$e,$),ee=H&&Y&&Vb(Y,$e,$)}else le=U==null?void 0:U[B],ee=H&&Y&&Y[B];if(ge||ce){var Se=A.props.activeIndex!==void 0?A.props.activeIndex:B;return[W.cloneElement(A,ue(ue(ue({},k.props),xe),{},{activeIndex:Se})),null,null]}if(!dt(le))return[ne].concat(Vd(T.renderActivePoints({item:k,activePoint:le,basePoint:ee,childIndex:B,isRange:H})))}else{var Fe,Ye=(Fe=T.getItemByXY(T.state.activeCoordinate))!==null&&Fe!==void 0?Fe:{graphicalItem:ne},vt=Ye.graphicalItem,Ft=vt.item,nr=Ft===void 0?A:Ft,jn=vt.childIndex,qr=ue(ue(ue({},k.props),xe),{},{activeIndex:jn});return[W.cloneElement(nr,qr),null,null]}return H?[ne,null,null]:[ne,null]}),Ke(T,"renderCustomized",function(A,M,P){return W.cloneElement(A,ue(ue({key:"recharts-customized-".concat(P)},T.props),T.state))}),Ke(T,"renderMap",{CartesianGrid:{handler:yx,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:yx},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:yx},YAxis:{handler:yx},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=x.id)!==null&&b!==void 0?b:yv("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=qY(T.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),T.state={},T}return LDe(y,m),ADe(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,A=b.height,M=b.layout,P=xi(S,os);if(P){var k=P.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,O=Ak(this.state,T,k,I),D=this.state.tooltipTicks[k].coordinate,N=(this.state.offset.top+A)/2,B=M==="horizontal",$=B?{x:D,y:N}:{y:D,x:N},F=this.state.formattedGraphicalItems.find(function(z){var U=z.item;return U.type.name==="Scatter"});F&&($=ue(ue({},$),F.props.points[k].tooltipPosition),O=F.props.points[k].tooltipPayload);var G={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:I,activePayload:O,activeCoordinate:$};this.setState(G),this.renderCursor(P),this.accessibilityManager.setIndex(k)}}}},{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,A;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0}})}return null}},{key:"componentDidUpdate",value:function(b){nL([xi(b.children,os)],[xi(this.props.children,os)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=xi(this.props.children,os);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(),A=Fwe(T),M={chartX:Math.round(b.pageX-A.left),chartY:Math.round(b.pageY-A.top)},P=T.width/S.offsetWidth||1,k=this.inRange(M.chartX,M.chartY,P);if(!k)return null;var I=this.state,O=I.xAxisMap,D=I.yAxisMap,N=this.getTooltipEventType(),B=Y$(this.state,this.props.data,this.props.layout,k);if(N!=="axis"&&O&&D){var $=mh(O).scale,F=mh(D).scale,G=$&&$.invert?$.invert(M.chartX):null,z=F&&F.invert?F.invert(M.chartY):null;return ue(ue({},M),{},{xValue:G,yValue:z},B)}return B?ue(ue({},M),B):null}},{key:"inRange",value:function(b,S){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,A=this.props.layout,M=b/T,P=S/T;if(A==="horizontal"||A==="vertical"){var k=this.state.offset,I=M>=k.left&&M<=k.left+k.width&&P>=k.top&&P<=k.top+k.height;return I?{x:M,y:P}:null}var O=this.state,D=O.angleAxisMap,N=O.radiusAxisMap;if(D&&N){var B=mh(D);return O4({x:M,y:P},B)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),T=xi(b,os),A={};T&&S==="axis"&&(T.props.trigger==="click"?A={onClick:this.handleClick}:A={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 M=Gb(this.props,this.handleOuterEvent);return ue(ue({},M),A)}},{key:"addListener",value:function(){MC.on(PC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){MC.removeListener(PC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,T){for(var A=this.state.formattedGraphicalItems,M=0,P=A.length;Ms>=80?"#22c55e":s>=60?"#f59e0b":"#ef4444")(t),a=2*Math.PI*45,o=t/100*a;return _.jsx("div",{className:"flex flex-col items-center",children:_.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[_.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e2a3a",strokeWidth:"8"}),_.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"}),_.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)}),_.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"fill-slate-400 text-xs",style:{fontSize:"10px"},children:r})]})})}function xx({label:e,value:t}){const r=n=>n>=80?"bg-green-500":n>=60?"bg-amber-500":"bg-red-500";return _.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"w-24 text-xs text-slate-400 truncate",children:e}),_.jsx("div",{className:"flex-1 h-2 bg-border rounded-full overflow-hidden",children:_.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),_.jsx("div",{className:"w-12 text-right text-xs font-mono text-slate-300",children:t.toFixed(1)})]})}function YDe({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Hy,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:Ds,iconColor:"text-amber-500"};default:return{bg:"bg-green-500/10",border:"border-green-500",icon:bm,iconColor:"text-green-500"}}})(e.severity),n=r.icon;return _.jsxs("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[_.jsx(n,{size:16,className:r.iconColor}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("div",{className:"text-sm text-slate-200",children:e.message}),_.jsx("div",{className:"text-xs text-slate-500 mt-1",children:e.timestamp||"Just now"})]})]})}function XDe({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-amber-500":"bg-green-500":"bg-red-500";return _.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-hover",children:[_.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.name}),_.jsxs("div",{className:"text-xs text-slate-500",children:[e.node_count," nodes · ",e.type]})]})]})}function _x({icon:e,label:t,value:r,subvalue:n}){return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4",children:[_.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[_.jsx(e,{size:14}),_.jsx("span",{className:"text-xs",children:t})]}),_.jsx("div",{className:"font-mono text-xl text-slate-100",children:r}),n&&_.jsx("div",{className:"text-xs text-slate-500 mt-1",children:n})]})}function kC({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 _.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-medium border ${r()}`,children:[e,t]})}function K$({label:e,value:t,unit:r,getColor:n}){const i=t!==void 0?n(t):"text-slate-400";return _.jsxs("div",{className:"text-center",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:e}),_.jsx("div",{className:`font-mono text-3xl font-bold ${i}`,children:(t==null?void 0:t.toFixed(0))??"—"}),r&&_.jsx("div",{className:"text-xs text-slate-500",children:r})]})}function qDe({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 _.jsxs("div",{className:"h-20 w-full",children:[_.jsx(KY,{width:"100%",height:"100%",children:_.jsxs(UDe,{data:t,margin:{top:5,right:5,bottom:5,left:5},children:[_.jsxs("defs",{children:[_.jsxs("linearGradient",{id:"kpGradientGreen",x1:"0",y1:"0",x2:"0",y2:"1",children:[_.jsx("stop",{offset:"0%",stopColor:"#22c55e",stopOpacity:.4}),_.jsx("stop",{offset:"100%",stopColor:"#22c55e",stopOpacity:.05})]}),_.jsxs("linearGradient",{id:"kpGradientAmber",x1:"0",y1:"0",x2:"0",y2:"1",children:[_.jsx("stop",{offset:"0%",stopColor:"#f59e0b",stopOpacity:.4}),_.jsx("stop",{offset:"100%",stopColor:"#f59e0b",stopOpacity:.05})]}),_.jsxs("linearGradient",{id:"kpGradientRed",x1:"0",y1:"0",x2:"0",y2:"1",children:[_.jsx("stop",{offset:"0%",stopColor:"#ef4444",stopOpacity:.4}),_.jsx("stop",{offset:"100%",stopColor:"#ef4444",stopOpacity:.05})]})]}),_.jsx(Mv,{domain:[0,Math.ceil(r)],hide:!0}),_.jsx(Cv,{dataKey:"idx",hide:!0}),_.jsx(ty,{y:3,stroke:"#f59e0b",strokeDasharray:"3 3",strokeOpacity:.5}),_.jsx(ty,{y:5,stroke:"#ef4444",strokeDasharray:"3 3",strokeOpacity:.5}),_.jsx(vu,{type:"monotone",dataKey:"value",stroke:n>5?"#ef4444":n>3?"#f59e0b":"#22c55e",fill:`url(#${i()})`,strokeWidth:2})]})}),_.jsxs("div",{className:"flex justify-between text-xs text-slate-600 px-1",children:[_.jsx("span",{children:"48h ago"}),_.jsx("span",{children:"now"})]})]})}function KDe({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:_.jsxs("div",{className:"h-24 w-full",children:[_.jsx(KY,{width:"100%",height:"100%",children:_.jsxs(HDe,{data:t,margin:{top:5,right:10,bottom:5,left:5},children:[_.jsx(Cv,{dataKey:"M",type:"number",domain:["dataMin - 20","dataMax + 20"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"}}),_.jsx(Mv,{dataKey:"height",type:"number",domain:[0,"dataMax"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"},tickFormatter:r=>`${(r/1e3).toFixed(1)}k`}),_.jsx(Jy,{type:"monotone",dataKey:"M",stroke:"#3b82f6",strokeWidth:2,dot:{r:3,fill:"#3b82f6"}})]})}),_.jsx("div",{className:"text-center text-xs text-slate-600",children:"M-units vs Height (km)"})]})}function QDe({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 _.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium border ${o[a]||o.normal}`,children:s[a]||a})};return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(wm,{size:14}),"RF Propagation"]}),_.jsxs("div",{className:"flex justify-around mb-4",children:[_.jsx(K$,{label:"SFI",value:e==null?void 0:e.sfi,getColor:r}),_.jsx("div",{className:"w-px bg-border"}),_.jsx(K$,{label:"Kp",value:e==null?void 0:e.kp_current,getColor:n})]}),_.jsxs("div",{className:"flex justify-center gap-2 mb-4",children:[_.jsx(kC,{label:"R",value:(e==null?void 0:e.r_scale)??0}),_.jsx(kC,{label:"S",value:(e==null?void 0:e.s_scale)??0}),_.jsx(kC,{label:"G",value:(e==null?void 0:e.g_scale)??0})]}),(e==null?void 0:e.kp_history)&&e.kp_history.length>0&&_.jsxs("div",{className:"mb-4",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Kp Trend (48h)"}),_.jsx(qDe,{history:e.kp_history})]}),_.jsx("div",{className:"border-t border-border my-3"}),_.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[_.jsx(Zc,{size:14,className:"text-slate-400"}),_.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&&_.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&&_.jsx(KDe,{profile:t.profile}),(e==null?void 0:e.active_warnings)&&e.active_warnings.length>0&&_.jsxs("div",{className:"mt-auto pt-3 border-t border-border",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"SWPC Alerts"}),_.jsx("div",{className:"flex flex-wrap gap-1",children:e.active_warnings.slice(0,3).map((a,o)=>_.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 JDe={nws:{icon:Zc,color:"text-blue-400",label:"NWS"},swpc:{icon:Fb,color:"text-yellow-400",label:"SWPC"},ducting:{icon:eu,color:"text-cyan-400",label:"Tropo"},nifc:{icon:VE,color:"text-orange-400",label:"NIFC"},firms:{icon:WE,color:"text-red-400",label:"FIRMS"},avalanche:{icon:GE,color:"text-slate-300",label:"Avy"},usgs:{icon:zE,color:"text-blue-300",label:"USGS"},traffic:{icon:BE,color:"text-purple-400",label:"Traffic"},roads:{icon:gZ,color:"text-amber-400",label:"511"}},Q$={info:"bg-blue-500/20 text-blue-400 border-blue-500/30",advisory:"bg-amber-500/20 text-amber-400 border-amber-500/30",moderate:"bg-amber-500/20 text-amber-400 border-amber-500/30",watch:"bg-orange-500/20 text-orange-400 border-orange-500/30",warning:"bg-red-500/20 text-red-400 border-red-500/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 eNe({event:e}){var a;const t=JDe[e.source]||{icon:bm,color:"text-slate-400",label:e.source},r=t.icon,n=Q$[(a=e.severity)==null?void 0:a.toLowerCase()]||Q$.info,i=o=>{const s=new Date(o*1e3),u=new Date().getTime()-s.getTime(),c=Math.floor(u/6e4);return c<1?"just now":c<60?`${c}m ago`:c<1440?`${Math.floor(c/60)}h ago`:s.toLocaleDateString(void 0,{month:"short",day:"numeric"})};return _.jsxs("div",{className:"flex items-start gap-2 py-2 border-b border-border/50 last:border-0",children:[_.jsx(r,{size:14,className:`mt-0.5 flex-shrink-0 ${t.color}`}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[_.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs border ${n}`,children:e.severity||"info"}),_.jsx("span",{className:"text-xs text-slate-500",children:t.label}),_.jsx("span",{className:"text-xs text-slate-600 ml-auto",children:i(e.fetched_at)})]}),_.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.headline})]})]})}function tNe({events:e,envStatus:t}){const r=W.useMemo(()=>[...e].sort((i,a)=>(a.fetched_at||0)-(i.fetched_at||0)),[e]),n=W.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const i=t.feeds.length,a=t.feeds.filter(u=>u.is_loaded&&!u.last_error).length,o=t.feeds.filter(u=>u.last_error).map(u=>u.source),s=Math.max(...t.feeds.map(u=>u.last_fetch||0)),l=s?Math.floor(Date.now()/1e3-s):null;return{total:i,active:a,errors:o,secAgo:l}},[t]);return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-3 flex items-center gap-2",children:[_.jsx(Gy,{size:14}),"Live Event Feed"]}),r.length>0?_.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:r.map((i,a)=>_.jsx(eNe,{event:i},i.event_id||a))}):_.jsx("div",{className:"flex-1 flex items-center justify-center",children:_.jsxs("div",{className:"text-center py-8",children:[_.jsx(Kh,{size:24,className:"text-green-500 mx-auto mb-2"}),_.jsx("div",{className:"text-slate-400",children:"No active events"}),_.jsx("div",{className:"text-xs text-slate-500",children:"All clear"})]})}),n&&_.jsxs("div",{className:`text-xs mt-3 pt-3 border-t border-border ${n.errors.length>0?"text-amber-400":"text-slate-500"}`,children:[n.active," of ",n.total," feeds active",n.secAgo!==null&&` · Last update ${n.secAgo}s ago`,n.errors.length>0&&_.jsxs("span",{className:"text-amber-400",children:[" · ",n.errors.join(", "),": error"]})]})]})}function rNe(){var S,T,A,M,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:x,lastMessage:b}=ZE();return W.useEffect(()=>{Promise.all([ace(),lce(),PZ(),LZ(),kZ().catch(()=>[]),IZ().catch(()=>null),OZ().catch(()=>null)]).then(([k,I,O,D,N,B,$])=>{t(k),n(I),a(O),s(D),u(N),f(B),d($),g(!1),document.title="Dashboard — MeshAI"}).catch(k=>{y(k.message),g(!1),document.title="Dashboard — MeshAI"})},[]),W.useEffect(()=>{x&&t(x)},[x]),W.useEffect(()=>{(b==null?void 0:b.type)==="env_update"&&b.event&&u(k=>{const I=b.event,O=k.filter(D=>D.event_id!==I.event_id);return[I,...O].slice(0,100)})},[b]),v?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsx("div",{className:"text-slate-400",children:"Loading..."})}):m?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsxs("div",{className:"text-red-400",children:["Error: ",m]})}):_.jsxs("div",{className:"space-y-6",children:[_.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Mesh Health"}),e&&_.jsxs(_.Fragment,{children:[_.jsx(ZDe,{health:e}),_.jsxs("div",{className:"mt-6 space-y-3",children:[_.jsx(xx,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),_.jsx(xx,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),_.jsx(xx,{label:"Behavior",value:((A=e.pillars)==null?void 0:A.behavior)??0}),_.jsx(xx,{label:"Power",value:((M=e.pillars)==null?void 0:M.power)??0})]})]})]}),_.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Active Alerts"}),i.length>0?_.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:i.map((k,I)=>_.jsx(YDe,{alert:k},I))}):_.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[_.jsx(Kh,{size:16,className:"text-green-500"}),_.jsx("span",{children:"No active alerts"})]})]}),_.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[_.jsx(_x,{icon:eu,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),_.jsx(_x,{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"}),_.jsx(_x,{icon:Gy,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`}),_.jsx(_x,{icon:bZ,label:"Regions",value:(e==null?void 0:e.total_regions)||0,subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),_.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:["Mesh Sources (",r.length,")"]}),r.length>0?_.jsx("div",{className:"space-y-2",children:r.map((k,I)=>_.jsx(XDe,{source:k},I))}):_.jsx("div",{className:"text-slate-500 py-4",children:"No sources configured"})]}),_.jsx(QDe,{swpc:c,ducting:h}),_.jsx(tNe,{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},MLe=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},PLe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},HD=function(t){var r=a$(a$({},PLe),t),n=W.useRef(),i=W.useState(-1),a=xLe(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=xt("recharts-rectangle",d);return _?Q.createElement(Ro,{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,A=S.height,M=S.x,P=S.y;return Q.createElement(Ro,{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",P1({},ct(r,!0),{className:b,d:o$(M,P,T,A,h),ref:n})))}):Q.createElement("path",P1({},ct(r,!0),{className:b,d:o$(l,u,c,f,h)}))};function rk(){return rk=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 NLe(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 jLe=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},RLe=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=DLe(t,LLe),m=kLe({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",nk({},ct(m,!0),{className:xt("recharts-cross",v),d:jLe(n,a,f,d,s,u)}))},BLe=IY,zLe=BLe(Object.getPrototypeOf,Object),$Le=zLe,FLe=Zs,VLe=$Le,GLe=Ys,WLe="[object Object]",HLe=Function.prototype,ULe=Object.prototype,gq=HLe.toString,ZLe=ULe.hasOwnProperty,YLe=gq.call(Object);function XLe(e){if(!GLe(e)||FLe(e)!=WLe)return!1;var t=VLe(e);if(t===null)return!0;var r=ZLe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&gq.call(r)==YLe}var qLe=XLe;const KLe=Ft(qLe);var QLe=Zs,JLe=Ys,eke="[object Boolean]";function tke(e){return e===!0||e===!1||JLe(e)&&QLe(e)==eke}var rke=tke;const nke=Ft(rke);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 L1(){return L1=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,A=b.height,M=b.x,P=b.y;return Q.createElement(Ro,{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",L1({},ct(r,!0),{className:_,d:f$(M,P,S,T,A),ref:n})))}):Q.createElement("g",null,Q.createElement("path",L1({},ct(r,!0),{className:_,d:f$(l,u,c,f,h)})))},vke=["option","shapeType","propTransformer","activeClassName","isActive"];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 pke(e,t){if(e==null)return{};var r=gke(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 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}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 k1(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),mi(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()}),mi(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),mi(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),mi(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),mi(n,"handleSlideDragStart",function(i){var a=x$(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 tIe(t,e),Kke(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=Un(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=x$(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,A=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(mi(mi({},o,u+_),"brushMoveStartX",n.pageX),function(){v&&A()&&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(mi({},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),_=CC(CC({},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(Xt,{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(Xt,{className:"recharts-brush-texts"},Q.createElement(a1,O1({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},v),this.getTextOfTick(i)),Q.createElement(a1,O1({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=xt("recharts-brush",a),S=Q.Children.count(o)===1,T=Xke("userSelect","none");return Q.createElement(Xt,{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 CC({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?nIe({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);mi(Od,"displayName","Brush");mi(Od,"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 iIe=mD;function aIe(e,t){var r;return iIe(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var oIe=aIe,sIe=SY,lIe=Sv,uIe=oIe,cIe=di,fIe=GS;function hIe(e,t,r){var n=cIe(e)?sIe:uIe;return r&&fIe(e,t,r)&&(t=void 0),n(e,lIe(t))}var dIe=hIe;const vIe=Ft(dIe);var ko=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},_$=WY;function pIe(e,t,r){t=="__proto__"&&_$?_$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var gIe=pIe,mIe=gIe,yIe=VY,xIe=Sv;function _Ie(e,t){var r={};return t=xIe(t),yIe(e,function(n,i,a){mIe(r,i,t(n,i,a))}),r}var bIe=_Ie;const wIe=Ft(bIe);function SIe(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 FIe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function VIe(e,t){var r=e.x,n=e.y,i=$Ie(e,jIe),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 Cp(Cp(Cp(Cp(Cp({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function w$(e){return Q.createElement(Ske,ak({shapeType:"rectangle",propTransformer:VIe,activeClassName:"recharts-active-bar"},e))}var GIe=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)||eve(n);return a?t(n,i):(a||Qc(),r)}},WIe=["value","background"],_q;function Ed(e){"@babel/helpers - typeof";return Ed=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},Ed(e)}function HIe(e,t){if(e==null)return{};var r=UIe(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 UIe(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 D1(){return D1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs($)0&&Math.abs(B)0&&(N=Math.min((ae||0)-(B[ce-1]||0),N))}),Number.isFinite(N)){var $=N/D,F=g.layout==="vertical"?n.height:n.width;if(g.padding==="gap"&&(M=$*F/2),g.padding==="no-gap"){var G=qc(t.barCategoryGap,$*F),z=$*F/2;M=z-G-(z-G)/F*G}}}i==="xAxis"?P=[n.left+(b.left||0)+(M||0),n.left+n.width-(b.right||0)-(M||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(M||0),n.top+n.height-(b.bottom||0)-(M||0)]:P=g.range,T&&(P=[P[1],P[0]]);var U=b2e(g,a,h),H=U.scale,Y=U.realScaleType;H.domain(y).range(P),w2e(H);var Z=k2e(H,Oa(Oa({},g),{},{realScaleType:Y}));i==="xAxis"?(O=m==="top"&&!S||m==="bottom"&&S,k=n.left,I=f[A]-O*g.height):i==="yAxis"&&(O=m==="left"&&!S||m==="right"&&S,k=f[A]-O*g.width,I=n.top);var J=Oa(Oa(Oa({},g),Z),{},{realScaleType:Y,x:k,y:I,scale:H,width:i==="xAxis"?n.width:g.width,height:i==="yAxis"?n.height:g.height});return J.bandSize=b1(J,Z),!g.hide&&i==="xAxis"?f[A]+=(O?-1:1)*J.height:g.hide||(f[A]+=(O?-1:1)*J.width),Oa(Oa({},d),{},rT({},v,J))},{})},Aq=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)}},nOe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return Aq({x:r,y:n},{x:i,y:a})},Cq=function(){function e(t){eOe(this,e),this.scale=t}return tOe(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)}}])}();rT(Cq,"EPS",1e-4);var UD=function(t){var r=Object.keys(t).reduce(function(n,i){return Oa(Oa({},n),{},rT({},i,Cq.create(t[i])))},{});return Oa(Oa({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return wIe(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return NIe(i,function(a,o){return r[o].isInRange(a)})}})};function iOe(e){return(e%180+180)%180}var aOe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=iOe(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 UOe(e,t){return Gq(e,t+1)}function ZOe(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:Gq(n,u)};var g=l,m,y=function(){return m===void 0&&(m=r(v,g)),m},_=v.coordinate,b=l===0||z1(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 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 N$(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 Mn(e){for(var t=1;t0?d.coordinate-m*e:d.coordinate})}else a[h]=d=Mn(Mn({},d),{},{tickCoord:d.coordinate});var y=z1(e,d.tickCoord,g,s,l);y&&(l=d.tickCoord-e*(g()/2+i),a[h]=Mn(Mn({},d),{},{isShow:!0}))},c=o-1;c>=0;c--)u(c);return a}function QOe(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=Mn(Mn({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var d=z1(e,c.tickCoord,function(){return f},l,u);d&&(u=c.tickCoord-e*(f/2+i),o[s-1]=Mn(Mn({},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 A=e*(b.coordinate-e*T()/2-l);o[_]=b=Mn(Mn({},b),{},{tickCoord:A<0?b.coordinate-A*e:b.coordinate})}else o[_]=b=Mn(Mn({},b),{},{tickCoord:b.coordinate});var M=z1(e,b.tickCoord,T,l,u);M&&(l=b.tickCoord+e*(T()/2+i),o[_]=Mn(Mn({},b),{},{isShow:!0}))},m=0;m=2?ja(i[1].coordinate-i[0].coordinate):1,y=HOe(a,m,d);return l==="equidistantPreserveStart"?ZOe(m,y,g,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=QOe(m,y,g,i,o,l==="preserveStartEnd"):h=KOe(m,y,g,i,o),h.filter(function(_){return _.isShow}))}var eEe=["viewBox"],tEe=["viewBox"],rEe=["ticks"];function Rd(e){"@babel/helpers - typeof";return Rd=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},Rd(e)}function jh(){return jh=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 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 iEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R$(e,t){for(var r=0;r0?l(this.props):l(d)),o<=0||s<=0||!v||!v.length?null:Q.createElement(Xt,{className:xt("recharts-cartesian-axis",u),ref:function(m){n.layerReference=m}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),In.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=xt(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(a1,jh({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(W.Component);YD(sT,"displayName","CartesianAxis");YD(sT,"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 fEe=["type","layout","connectNulls","ref"],hEe=["key"];function Bd(e){"@babel/helpers - typeof";return Bd=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},Bd(e)}function B$(e,t){if(e==null)return{};var r=dEe(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 dEe(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 Rg(){return Rg=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(Gf(l.slice(0,v)),[f-g]);break}var m=d.length%2===0?[0,h]:[h];return[].concat(Gf(t.repeat(l,c)),Gf(d),m).map(function(y){return"".concat(y,"px")}).join(", ")}),Ea(r,"id",xv("recharts-line-")),Ea(r,"pathRef",function(o){r.mainCurve=o}),Ea(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Ea(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return SEe(t,e),xEe(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=oa(c,Qy);if(!f)return null;var h=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Un(g.payload,m)}},d={clipPath:n?"url(#clipPath-".concat(i,")"):null};return Q.createElement(Xt,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=gi(gi(gi({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(Xt,Rg({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=B$(s,fEe),h=gi(gi(gi({},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(nd,Rg({},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(Ro,{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 A=_.length/s.length,M=s.map(function(D,N){var B=Math.floor(N*A);if(_[B]){var $=_[B],F=vn($.x,D.x),G=vn($.y,D.y);return gi(gi({},D),{},{x:F(T),y:G(T)})}if(v){var z=vn(g*2,D.x),U=vn(m/2,D.y);return gi(gi({},D),{},{x:z(T),y:U(T)})}return gi(gi({},D),{},{x:D.x,y:D.y})});return a.renderCurveStatically(M,n,i)}var P=vn(0,b),k=P(T),I;if(l){var O="".concat(l).split(/[,\s]+/gim).map(function(D){return parseFloat(D)});I=a.getStrokeDasharray(k,b,O)}else I=a.generateSimpleStrokeDasharray(b,k);return a.renderCurveStatically(s,n,i,{strokeDasharray:I})})}},{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||!Pd(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=xt("recharts-line",l),S=u&&u.allowDataOverflow,T=c&&c.allowDataOverflow,A=S||T,M=dt(m)?this.id:m,P=(n=ct(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=P.r,I=k===void 0?3:k,O=P.strokeWidth,D=O===void 0?2:O,N=YZ(o)?o:{},B=N.clipDot,$=B===void 0?!0:B,F=I*2+D;return Q.createElement(Xt,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(M)},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})),!$&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(M)},Q.createElement("rect",{x:h-F/2,y:f-F/2,width:d+F,height:v+F}))):null,!_&&this.renderCurve(A,M),this.renderErrorBar(A,M),(_||o)&&this.renderDots(A,$,M),(!g||y)&&Ss.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(Gf(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function MEe(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 wc(){return wc=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Pd(c,o)||!Pd(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=xt("recharts-area",l),S=f&&f.allowDataOverflow,T=h&&h.allowDataOverflow,A=S||T,M=dt(m)?this.id:m,P=(n=ct(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=P.r,I=k===void 0?3:k,O=P.strokeWidth,D=O===void 0?2:O,N=YZ(o)?o:{},B=N.clipDot,$=B===void 0?!0:B,F=I*2+D;return Q.createElement(Xt,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(M)},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})),!$&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(M)},Q.createElement("rect",{x:c-F/2,y:u-F/2,width:d+F,height:v+F}))):null,_?null:this.renderArea(A,M),(o||_)&&this.renderDots(A,$,M),(!g||y)&&Ss.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);Yq=pu;_o(pu,"displayName","Area");_o(pu,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!gf.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});_o(pu,"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]});_o(pu,"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=Yq.getBaseValue(t,r,n,i),m=d==="horizontal",y=!1,_=f.map(function(S,T){var A;v?A=u[c+T]:(A=Un(S,l),Array.isArray(A)?y=!0:A=[g,A]);var M=A[1]==null||v&&Un(S,l)==null;return m?{x:_1({axis:n,ticks:a,bandSize:s,entry:S,index:T}),y:M?null:i.scale(A[1]),value:A,payload:S}:{x:M?null:n.scale(A[1]),y:_1({axis:i,ticks:o,bandSize:s,entry:S,index:T}),value:A,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),hl({points:_,baseLine:b,layout:d,isRange:y},h)});_o(pu,"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=xt("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=Xq(t,CEe);r=Q.createElement(JS,wc({},a,{key:i,className:n}))}return r});function $d(e){"@babel/helpers - typeof";return $d=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},$d(e)}function NEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jEe(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 wDe(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 SDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TDe(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 fK(e){return e==="number"?[0,"auto"]:void 0}var Ak=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=lT(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=Gb(d,o.dataKey,i)}else h=f&&f[n]||s[n];return h?[].concat(Gd(l),[rq(u,h)]):l},[])},Y$=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=jDe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=p2e(o,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,h=Ak(t,r,c,f),d=RDe(n,s,c,a);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},BDe=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=eq(c,a);return n.reduce(function(v,g){var m,y=g.type.defaultProps!==void 0?ue(ue({},g.type.defaultProps),g.props):g.props,_=y.type,b=y.dataKey,S=y.allowDataOverflow,T=y.allowDuplicatedCategory,A=y.scale,M=y.ticks,P=y.includeHidden,k=y[o];if(v[k])return v;var I=lT(t.data,{graphicalItems:i.filter(function(Z){var J,ae=o in Z.props?Z.props[o]:(J=Z.type.defaultProps)===null||J===void 0?void 0:J[o];return ae===k}),dataStartIndex:l,dataEndIndex:u}),O=I.length,D,N,B;cDe(y.domain,S,_)&&(D=VL(y.domain,null,S),d&&(_==="number"||A!=="auto")&&(B=Ng(I,b,"category")));var $=fK(_);if(!D||D.length===0){var F,G=(F=y.domain)!==null&&F!==void 0?F:$;if(b){if(D=Ng(I,b,_),_==="category"&&d){var z=rve(D);T&&z?(N=D,D=I1(0,O)):T||(D=L4(G,D,g).reduce(function(Z,J){return Z.indexOf(J)>=0?Z:[].concat(Gd(Z),[J])},[]))}else if(_==="category")T?D=D.filter(function(Z){return Z!==""&&!dt(Z)}):D=L4(G,D,g).reduce(function(Z,J){return Z.indexOf(J)>=0||J===""||dt(J)?Z:[].concat(Gd(Z),[J])},[]);else if(_==="number"){var U=_2e(I,i.filter(function(Z){var J,ae,ce=o in Z.props?Z.props[o]:(J=Z.type.defaultProps)===null||J===void 0?void 0:J[o],ge="hide"in Z.props?Z.props.hide:(ae=Z.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return ce===k&&(P||!ge)}),b,a,c);U&&(D=U)}d&&(_==="number"||A!=="auto")&&(B=Ng(I,b,"category"))}else d?D=I1(0,O):s&&s[k]&&s[k].hasStack&&_==="number"?D=h==="expand"?[0,1]:tq(s[k].stackGroups,l,u):D=JX(I,i.filter(function(Z){var J=o in Z.props?Z.props[o]:Z.type.defaultProps[o],ae="hide"in Z.props?Z.props.hide:Z.type.defaultProps.hide;return J===k&&(P||!ae)}),_,c,!0);if(_==="number")D=wk(f,D,k,a,M),G&&(D=VL(G,D,S));else if(_==="category"&&G){var H=G,Y=D.every(function(Z){return H.indexOf(Z)>=0});Y&&(D=H)}}return ue(ue({},v),{},Ke({},k,ue(ue({},y),{},{axisType:a,domain:D,categoricalDomain:B,duplicateDomain:N,originalDomain:(m=y.domain)!==null&&m!==void 0?m:$,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=lT(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),d=h.length,v=eq(c,a),g=-1;return n.reduce(function(m,y){var _=y.type.defaultProps!==void 0?ue(ue({},y.type.defaultProps),y.props):y.props,b=_[o],S=fK("number");if(!m[b]){g++;var T;return v?T=I1(0,d):s&&s[b]&&s[b].hasStack?(T=tq(s[b].stackGroups,l,u),T=wk(f,T,b,a)):(T=VL(S,JX(h,n.filter(function(A){var M,P,k=o in A.props?A.props[o]:(M=A.type.defaultProps)===null||M===void 0?void 0:M[o],I="hide"in A.props?A.props.hide:(P=A.type.defaultProps)===null||P===void 0?void 0:P.hide;return k===b&&!I}),"number",c),i.defaultProps.allowDataOverflow),T=wk(f,T,b,a)),ue(ue({},m),{},Ke({},b,ue(ue({axisType:a},i.defaultProps),{},{hide:!0,orientation:aa(DDe,"".concat(a,".").concat(g%2),null),domain:T,originalDomain:S,isCategorical:v,layout:c})))}return m},{})},$De=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=oa(c,a),d={};return h&&h.length?d=BDe(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},FDe=function(t){var r=yh(t),n=bc(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:yD(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:b1(r,n)}},X$=function(t){var r=t.children,n=t.defaultShowTooltip,i=xi(r,Od),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}},VDe=function(t){return!t||!t.length?!1:t.some(function(r){var n=bs(r&&r.type);return n&&n.indexOf("Bar")>=0})},q$=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"}},GDe=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=xi(f,Od),v=xi(f,ed),g=Object.keys(l).reduce(function(T,A){var M=l[A],P=M.orientation;return!M.mirror&&!M.hide?ue(ue({},T),{},Ke({},P,T[P]+M.width)):T},{left:h.left||0,right:h.right||0}),m=Object.keys(o).reduce(function(T,A){var M=o[A],P=M.orientation;return!M.mirror&&!M.hide?ue(ue({},T),{},Ke({},P,aa(T,"".concat(P))+M.height)):T},{top:h.top||0,bottom:h.bottom||0}),y=ue(ue({},m),g),_=y.bottom;d&&(y.bottom+=d.props.height||Od.defaultProps.height),v&&r&&(y=y2e(y,i,n,r));var b=u-y.left-y.right,S=c-y.top-y.bottom;return ue(ue({brushBottom:_},y),{},{width:Math.max(b,0),height:Math.max(S,0)})},WDe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},hK=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,A=_.updateId,M=_.dataStartIndex,P=_.dataEndIndex,k=y.barSize,I=y.layout,O=y.barGap,D=y.barCategoryGap,N=y.maxBarSize,B=q$(I),$=B.numericAxisName,F=B.cateAxisName,G=VDe(b),z=[];return b.forEach(function(U,H){var Y=lT(y.data,{graphicalItems:[U],dataStartIndex:M,dataEndIndex:P}),Z=U.type.defaultProps!==void 0?ue(ue({},U.type.defaultProps),U.props):U.props,J=Z.dataKey,ae=Z.maxBarSize,ce=Z["".concat($,"Id")],ge=Z["".concat(F,"Id")],We={},xe=l.reduce(function(qr,Jn){var kf=_["".concat(Jn.axisType,"Map")],S0=Z["".concat(Jn.axisType,"Id")];kf&&kf[S0]||Jn.axisType==="zAxis"||Qc();var T0=kf[S0];return ue(ue({},qr),{},Ke(Ke({},Jn.axisType,T0),"".concat(Jn.axisType,"Ticks"),bc(T0)))},We),ne=xe[F],fe=xe["".concat(F,"Ticks")],le=S&&S[ce]&&S[ce].hasStack&&O2e(U,S[ce].stackGroups),ee=bs(U.type).indexOf("Bar")>=0,$e=b1(ne,fe),Se=[],Fe=G&&g2e({barSize:k,stackGroups:S,totalSize:WDe(xe,F)});if(ee){var Ye,vt,Vt=dt(ae)?N:ae,nr=(Ye=(vt=b1(ne,fe,!0))!==null&&vt!==void 0?vt:Vt)!==null&&Ye!==void 0?Ye:0;Se=m2e({barGap:O,barCategoryGap:D,bandSize:nr!==$e?nr:$e,sizeList:Fe[ge],maxBarSize:Vt}),nr!==$e&&(Se=Se.map(function(qr){return ue(ue({},qr),{},{position:ue(ue({},qr.position),{},{offset:qr.position.offset-nr/2})})}))}var jn=U&&U.type&&U.type.getComposedData;jn&&z.push({props:ue(ue({},jn(ue(ue({},xe),{},{displayedData:Y,props:y,dataKey:J,item:U,bandSize:$e,barPosition:Se,offset:T,stackedData:le,layout:I,dataStartIndex:M,dataEndIndex:P}))),{},Ke(Ke(Ke({key:U.key||"item-".concat(H)},$,xe[$]),F,xe[F]),"animationId",A)),childIndex:vve(U,y.children),item:U})}),z},d=function(y,_){var b=y.props,S=y.dataStartIndex,T=y.dataEndIndex,A=y.updateId;if(!S3({props:b}))return null;var M=b.children,P=b.layout,k=b.stackOffset,I=b.data,O=b.reverseStackOrder,D=q$(P),N=D.numericAxisName,B=D.cateAxisName,$=oa(M,n),F=L2e(I,$,"".concat(N,"Id"),"".concat(B,"Id"),k,O),G=l.reduce(function(Z,J){var ae="".concat(J.axisType,"Map");return ue(ue({},Z),{},Ke({},ae,$De(b,ue(ue({},J),{},{graphicalItems:$,stackGroups:J.axisType===N&&F,dataStartIndex:S,dataEndIndex:T}))))},{}),z=GDe(ue(ue({},G),{},{props:b,graphicalItems:$}),_==null?void 0:_.legendBBox);Object.keys(G).forEach(function(Z){G[Z]=c(b,G[Z],z,Z.replace("Map",""),r)});var U=G["".concat(B,"Map")],H=FDe(U),Y=h(b,ue(ue({},G),{},{dataStartIndex:S,dataEndIndex:T,updateId:A,graphicalItems:$,stackGroups:F,offset:z}));return ue(ue({formattedGraphicalItems:Y,graphicalItems:$,offset:z,stackGroups:F},H),G)},v=function(m){function y(_){var b,S,T;return SDe(this,y),T=CDe(this,y,[_]),Ke(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ke(T,"accessibilityManager",new uDe),Ke(T,"handleLegendBBoxUpdate",function(A){if(A){var M=T.state,P=M.dataStartIndex,k=M.dataEndIndex,I=M.updateId;T.setState(ue({legendBBox:A},d({props:T.props,dataStartIndex:P,dataEndIndex:k,updateId:I},ue(ue({},T.state),{},{legendBBox:A}))))}}),Ke(T,"handleReceiveSyncEvent",function(A,M,P){if(T.props.syncId===A){if(P===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(M)}}),Ke(T,"handleBrushChange",function(A){var M=A.startIndex,P=A.endIndex;if(M!==T.state.dataStartIndex||P!==T.state.dataEndIndex){var k=T.state.updateId;T.setState(function(){return ue({dataStartIndex:M,dataEndIndex:P},d({props:T.props,dataStartIndex:M,dataEndIndex:P,updateId:k},T.state))}),T.triggerSyncEvent({dataStartIndex:M,dataEndIndex:P})}}),Ke(T,"handleMouseEnter",function(A){var M=T.getMouseInfo(A);if(M){var P=ue(ue({},M),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var k=T.props.onMouseEnter;ft(k)&&k(P,A)}}),Ke(T,"triggeredAfterMouseMove",function(A){var M=T.getMouseInfo(A),P=M?ue(ue({},M),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(P),T.triggerSyncEvent(P);var k=T.props.onMouseMove;ft(k)&&k(P,A)}),Ke(T,"handleItemMouseEnter",function(A){T.setState(function(){return{isTooltipActive:!0,activeItem:A,activePayload:A.tooltipPayload,activeCoordinate:A.tooltipPosition||{x:A.cx,y:A.cy}}})}),Ke(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),Ke(T,"handleMouseMove",function(A){A.persist(),T.throttleTriggeredAfterMouseMove(A)}),Ke(T,"handleMouseLeave",function(A){T.throttleTriggeredAfterMouseMove.cancel();var M={isTooltipActive:!1};T.setState(M),T.triggerSyncEvent(M);var P=T.props.onMouseLeave;ft(P)&&P(M,A)}),Ke(T,"handleOuterEvent",function(A){var M=dve(A),P=aa(T.props,"".concat(M));if(M&&ft(P)){var k,I;/.*touch.*/i.test(M)?I=T.getMouseInfo(A.changedTouches[0]):I=T.getMouseInfo(A),P((k=I)!==null&&k!==void 0?k:{},A)}}),Ke(T,"handleClick",function(A){var M=T.getMouseInfo(A);if(M){var P=ue(ue({},M),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var k=T.props.onClick;ft(k)&&k(P,A)}}),Ke(T,"handleMouseDown",function(A){var M=T.props.onMouseDown;if(ft(M)){var P=T.getMouseInfo(A);M(P,A)}}),Ke(T,"handleMouseUp",function(A){var M=T.props.onMouseUp;if(ft(M)){var P=T.getMouseInfo(A);M(P,A)}}),Ke(T,"handleTouchMove",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(A.changedTouches[0])}),Ke(T,"handleTouchStart",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&T.handleMouseDown(A.changedTouches[0])}),Ke(T,"handleTouchEnd",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&T.handleMouseUp(A.changedTouches[0])}),Ke(T,"handleDoubleClick",function(A){var M=T.props.onDoubleClick;if(ft(M)){var P=T.getMouseInfo(A);M(P,A)}}),Ke(T,"handleContextMenu",function(A){var M=T.props.onContextMenu;if(ft(M)){var P=T.getMouseInfo(A);M(P,A)}}),Ke(T,"triggerSyncEvent",function(A){T.props.syncId!==void 0&&PC.emit(LC,T.props.syncId,A,T.eventEmitterSymbol)}),Ke(T,"applySyncEvent",function(A){var M=T.props,P=M.layout,k=M.syncMethod,I=T.state.updateId,O=A.dataStartIndex,D=A.dataEndIndex;if(A.dataStartIndex!==void 0||A.dataEndIndex!==void 0)T.setState(ue({dataStartIndex:O,dataEndIndex:D},d({props:T.props,dataStartIndex:O,dataEndIndex:D,updateId:I},T.state)));else if(A.activeTooltipIndex!==void 0){var N=A.chartX,B=A.chartY,$=A.activeTooltipIndex,F=T.state,G=F.offset,z=F.tooltipTicks;if(!G)return;if(typeof k=="function")$=k(z,A);else if(k==="value"){$=-1;for(var U=0;U=0){var le,ee;if(N.dataKey&&!N.allowDuplicatedCategory){var $e=typeof N.dataKey=="function"?fe:"payload.".concat(N.dataKey.toString());le=Gb(U,$e,$),ee=H&&Y&&Gb(Y,$e,$)}else le=U==null?void 0:U[B],ee=H&&Y&&Y[B];if(ge||ce){var Se=A.props.activeIndex!==void 0?A.props.activeIndex:B;return[W.cloneElement(A,ue(ue(ue({},k.props),xe),{},{activeIndex:Se})),null,null]}if(!dt(le))return[ne].concat(Gd(T.renderActivePoints({item:k,activePoint:le,basePoint:ee,childIndex:B,isRange:H})))}else{var Fe,Ye=(Fe=T.getItemByXY(T.state.activeCoordinate))!==null&&Fe!==void 0?Fe:{graphicalItem:ne},vt=Ye.graphicalItem,Vt=vt.item,nr=Vt===void 0?A:Vt,jn=vt.childIndex,qr=ue(ue(ue({},k.props),xe),{},{activeIndex:jn});return[W.cloneElement(nr,qr),null,null]}return H?[ne,null,null]:[ne,null]}),Ke(T,"renderCustomized",function(A,M,P){return W.cloneElement(A,ue(ue({key:"recharts-customized-".concat(P)},T.props),T.state))}),Ke(T,"renderMap",{CartesianGrid:{handler:xx,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:xx},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:xx},YAxis:{handler:xx},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:xv("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=qY(T.triggeredAfterMouseMove,(S=_.throttleDelay)!==null&&S!==void 0?S:1e3/60),T.state={},T}return LDe(y,m),ADe(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,A=b.height,M=b.layout,P=xi(S,os);if(P){var k=P.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,O=Ak(this.state,T,k,I),D=this.state.tooltipTicks[k].coordinate,N=(this.state.offset.top+A)/2,B=M==="horizontal",$=B?{x:D,y:N}:{y:D,x:N},F=this.state.formattedGraphicalItems.find(function(z){var U=z.item;return U.type.name==="Scatter"});F&&($=ue(ue({},$),F.props.points[k].tooltipPosition),O=F.props.points[k].tooltipPayload);var G={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:I,activePayload:O,activeCoordinate:$};this.setState(G),this.renderCursor(P),this.accessibilityManager.setIndex(k)}}}},{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,A;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0}})}return null}},{key:"componentDidUpdate",value:function(b){nL([xi(b.children,os)],[xi(this.props.children,os)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=xi(this.props.children,os);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(),A=Fwe(T),M={chartX:Math.round(b.pageX-A.left),chartY:Math.round(b.pageY-A.top)},P=T.width/S.offsetWidth||1,k=this.inRange(M.chartX,M.chartY,P);if(!k)return null;var I=this.state,O=I.xAxisMap,D=I.yAxisMap,N=this.getTooltipEventType(),B=Y$(this.state,this.props.data,this.props.layout,k);if(N!=="axis"&&O&&D){var $=yh(O).scale,F=yh(D).scale,G=$&&$.invert?$.invert(M.chartX):null,z=F&&F.invert?F.invert(M.chartY):null;return ue(ue({},M),{},{xValue:G,yValue:z},B)}return B?ue(ue({},M),B):null}},{key:"inRange",value:function(b,S){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,A=this.props.layout,M=b/T,P=S/T;if(A==="horizontal"||A==="vertical"){var k=this.state.offset,I=M>=k.left&&M<=k.left+k.width&&P>=k.top&&P<=k.top+k.height;return I?{x:M,y:P}:null}var O=this.state,D=O.angleAxisMap,N=O.radiusAxisMap;if(D&&N){var B=yh(D);return O4({x:M,y:P},B)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),T=xi(b,os),A={};T&&S==="axis"&&(T.props.trigger==="click"?A={onClick:this.handleClick}:A={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 M=Wb(this.props,this.handleOuterEvent);return ue(ue({},M),A)}},{key:"addListener",value:function(){PC.on(LC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){PC.removeListener(LC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,T){for(var A=this.state.formattedGraphicalItems,M=0,P=A.length;Ms>=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 _x({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 YDe({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Uy,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:Ds,iconColor:"text-amber-500"};default:return{bg:"bg-green-500/10",border:"border-green-500",icon:wm,iconColor:"text-green-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 XDe({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 bx({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 IC({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 K$({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 qDe({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(KY,{width:"100%",height:"100%",children:x.jsxs(UDe,{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(Pv,{domain:[0,Math.ceil(r)],hide:!0}),x.jsx(Mv,{dataKey:"idx",hide:!0}),x.jsx(ry,{y:3,stroke:"#f59e0b",strokeDasharray:"3 3",strokeOpacity:.5}),x.jsx(ry,{y:5,stroke:"#ef4444",strokeDasharray:"3 3",strokeOpacity:.5}),x.jsx(pu,{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 KDe({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(KY,{width:"100%",height:"100%",children:x.jsxs(HDe,{data:t,margin:{top:5,right:10,bottom:5,left:5},children:[x.jsx(Mv,{dataKey:"M",type:"number",domain:["dataMin - 20","dataMax + 20"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"}}),x.jsx(Pv,{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(e0,{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 QDe({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(Sm,{size:14}),"RF Propagation"]}),x.jsxs("div",{className:"flex justify-around mb-4",children:[x.jsx(K$,{label:"SFI",value:e==null?void 0:e.sfi,getColor:r}),x.jsx("div",{className:"w-px bg-border"}),x.jsx(K$,{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(IC,{label:"R",value:(e==null?void 0:e.r_scale)??0}),x.jsx(IC,{label:"S",value:(e==null?void 0:e.s_scale)??0}),x.jsx(IC,{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(qDe,{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(Yc,{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(KDe,{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 JDe={nws:{icon:Yc,color:"text-blue-400",label:"NWS"},swpc:{icon:Vb,color:"text-yellow-400",label:"SWPC"},ducting:{icon:tu,color:"text-cyan-400",label:"Tropo"},nifc:{icon:VE,color:"text-orange-400",label:"NIFC"},firms:{icon:WE,color:"text-red-400",label:"FIRMS"},avalanche:{icon:GE,color:"text-slate-300",label:"Avy"},usgs:{icon:zE,color:"text-blue-300",label:"USGS"},traffic:{icon:BE,color:"text-purple-400",label:"Traffic"},roads:{icon:gZ,color:"text-amber-400",label:"511"}},Q$={info:"bg-blue-500/20 text-blue-400 border-blue-500/30",advisory:"bg-amber-500/20 text-amber-400 border-amber-500/30",moderate:"bg-amber-500/20 text-amber-400 border-amber-500/30",watch:"bg-orange-500/20 text-orange-400 border-orange-500/30",warning:"bg-red-500/20 text-red-400 border-red-500/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 eNe({event:e}){var a;const t=JDe[e.source]||{icon:wm,color:"text-slate-400",label:e.source},r=t.icon,n=Q$[(a=e.severity)==null?void 0:a.toLowerCase()]||Q$.info,i=o=>{const s=new Date(o*1e3),u=new Date().getTime()-s.getTime(),c=Math.floor(u/6e4);return c<1?"just now":c<60?`${c}m ago`:c<1440?`${Math.floor(c/60)}h ago`:s.toLocaleDateString(void 0,{month:"short",day:"numeric"})};return x.jsxs("div",{className:"flex items-start gap-2 py-2 border-b border-border/50 last:border-0",children:[x.jsx(r,{size:14,className:`mt-0.5 flex-shrink-0 ${t.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 ${n}`,children:e.severity||"info"}),x.jsx("span",{className:"text-xs text-slate-500",children:t.label}),x.jsx("span",{className:"text-xs text-slate-600 ml-auto",children:i(e.fetched_at)})]}),x.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.headline})]})]})}function tNe({events:e,envStatus:t}){const r=W.useMemo(()=>[...e].sort((i,a)=>(a.fetched_at||0)-(i.fetched_at||0)),[e]),n=W.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const i=t.feeds.length,a=t.feeds.filter(u=>u.is_loaded&&!u.last_error).length,o=t.feeds.filter(u=>u.last_error).map(u=>u.source),s=Math.max(...t.feeds.map(u=>u.last_fetch||0)),l=s?Math.floor(Date.now()/1e3-s):null;return{total:i,active:a,errors:o,secAgo:l}},[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(Wy,{size:14}),"Live Event Feed"]}),r.length>0?x.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:r.map((i,a)=>x.jsx(eNe,{event:i},i.event_id||a))}):x.jsx("div",{className:"flex-1 flex items-center justify-center",children:x.jsxs("div",{className:"text-center py-8",children:[x.jsx(Qh,{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"})]})}),n&&x.jsxs("div",{className:`text-xs mt-3 pt-3 border-t border-border ${n.errors.length>0?"text-amber-400":"text-slate-500"}`,children:[n.active," of ",n.total," feeds active",n.secAgo!==null&&` · Last update ${n.secAgo}s ago`,n.errors.length>0&&x.jsxs("span",{className:"text-amber-400",children:[" · ",n.errors.join(", "),": error"]})]})]})}function rNe(){var S,T,A,M,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}=ZE();return W.useEffect(()=>{Promise.all([ace(),lce(),PZ(),LZ(),kZ().catch(()=>[]),IZ().catch(()=>null),OZ().catch(()=>null)]).then(([k,I,O,D,N,B,$])=>{t(k),n(I),a(O),s(D),u(N),f(B),d($),g(!1),document.title="Dashboard — MeshAI"}).catch(k=>{y(k.message),g(!1),document.title="Dashboard — MeshAI"})},[]),W.useEffect(()=>{_&&t(_)},[_]),W.useEffect(()=>{(b==null?void 0:b.type)==="env_update"&&b.event&&u(k=>{const I=b.event,O=k.filter(D=>D.event_id!==I.event_id);return[I,...O].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(ZDe,{health:e}),x.jsxs("div",{className:"mt-6 space-y-3",children:[x.jsx(_x,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),x.jsx(_x,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),x.jsx(_x,{label:"Behavior",value:((A=e.pillars)==null?void 0:A.behavior)??0}),x.jsx(_x,{label:"Power",value:((M=e.pillars)==null?void 0:M.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((k,I)=>x.jsx(YDe,{alert:k},I))}):x.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[x.jsx(Qh,{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(bx,{icon:tu,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),x.jsx(bx,{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(bx,{icon:Wy,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(bx,{icon:bZ,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((k,I)=>x.jsx(XDe,{source:k},I))}):x.jsx("div",{className:"text-slate-500 py-4",children:"No sources configured"})]}),x.jsx(QDe,{swpc:c,ducting:h}),x.jsx(tNe,{events:l,envStatus:o})]})]})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -460,8 +460,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 Ck=function(e,t){return Ck=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])},Ck(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");Ck(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Rg=function(){return Rg=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):oNe(navigator.userAgent,nt);function oNe(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 XD=12,dK="sans-serif",Bs=XD+"px "+dK,sNe=20,lNe=100,uNe="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function cNe(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(){R(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function DNe(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?rF(s,o):rF(o,s))}function SK(e){return e.nodeName.toUpperCase()==="CANVAS"}var NNe=/([&<>"'])/g,jNe={"&":"&","<":"<",">":">",'"':""","'":"'"};function On(e){return e==null?"":(e+"").replace(NNe,function(t,r){return jNe[r]})}var RNe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,OC=[],BNe=nt.browser.firefox&&+nt.browser.version.split(".")[0]<39;function Ik(e,t,r,n){return r=r||{},n?nF(e,t,r):BNe&&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):nF(e,t,r),r}function nF(e,t,r){if(nt.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(SK(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(kk(OC,e,n,i)){r.zrX=OC[0],r.zrY=OC[1];return}}r.zrX=r.zrY=0}function rN(e){return e||window.event}function Zi(e,t,r){if(t=rN(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&&Ik(e,o,t,r)}else{Ik(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&&RNe.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 Ok(e,t,r,n){e.addEventListener(t,r,n)}function $Ne(e,t,r,n){e.removeEventListener(t,r,n)}var zs=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function iF(e){return e.which===2||e.which===3}var FNe=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=aF(n)/aF(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=VNe(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 n0(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function i0(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 Fa(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 Ua(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 dT(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 da(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 TK(e){var t=Wr();return i0(t,e),t}const GNe=Object.freeze(Object.defineProperty({__proto__:null,clone:TK,copy:i0,create:Wr,identity:n0,invert:da,mul:Fa,rotate:qs,scale:dT,translate:Ua},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}(),wc=Math.min,Rh=Math.max,Ek=Math.abs,oF=["x","y"],WNe=["width","height"],Mu=new Ie,Pu=new Ie,Lu=new Ie,ku=new Ie,bi=AK(),cg=bi.minTv,Dk=bi.maxTv,Fg=[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=wc(t.x,this.x),n=wc(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Rh(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Rh(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 Ua(a,a,[-r.x,-r.y]),dT(a,a,[n,i]),Ua(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(HNe,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(UNe,r.x,r.y,r.width,r.height));var s=!!n;bi.reset(i,s);var l=bi.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}Mu.x=Lu.x=r.x,Mu.y=ku.y=r.y,Pu.x=ku.x=r.x+r.width,Pu.y=Lu.y=r.y+r.height,Mu.transform(n),ku.transform(n),Pu.transform(n),Lu.transform(n),t.x=wc(Mu.x,Pu.x,Lu.x,ku.x),t.y=wc(Mu.y,Pu.y,Lu.y,ku.y);var l=Rh(Mu.x,Pu.x,Lu.x,ku.x),u=Rh(Mu.y,Pu.y,Lu.y,ku.y);t.width=l-t.x,t.height=u-t.y},e}(),HNe=new Oe(0,0,0,0),UNe=new Oe(0,0,0,0);function sF(e,t,r,n,i,a,o,s){var l=Ek(t-r),u=Ek(n-e),c=wc(l,u),f=oF[i],h=oF[1-i],d=WNe[i];t=u||!bi.bidirectional)&&(cg[f]=-u,cg[h]=0,bi.useDir&&bi.calcDirMTV())))}function AK(){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=Rh(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)&&(DC.copy(h.getBoundingRect()),h.transform&&DC.applyTransform(h.transform),DC.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 KNe(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?CK:!0}return!1}function lF(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=KNe(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==CK)){t.target=o;break}}}function PK(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var LK=32,Mp=7;function QNe(e){for(var t=0;e>=LK;)t|=e&1,e>>=1;return e+t}function uF(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 JNe(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 NC(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 jC(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 eje(e,t){var r=Mp,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]=Mp||M>=Mp);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[A+y]=e[T+y];e[S]=o[b];return}for(var M=r;;){var P=0,k=0,I=!1;do if(t(o[b],e[x])<0){if(e[S--]=e[x--],P++,k=0,--v===0){I=!0;break}}else if(e[S--]=o[b--],k++,P=0,--m===1){I=!0;break}while((P|k)=0;y--)e[A+y]=e[T+y];if(v===0){I=!0;break}}if(e[S--]=o[b--],--m===1){I=!0;break}if(k=m-NC(e[x],o,0,m,m-1,t),k!==0){for(S-=k,b-=k,m-=k,A=S+1,T=b+1,y=0;y=Mp||k>=Mp);if(I)break;M<0&&(M=0),M+=2}if(r=M,r<1&&(r=1),m===1){for(S-=v,x-=v,A=S+1,T=x+1,y=v-1;y>=0;y--)e[A+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),cF(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 Si=1,fg=2,yh=4,fF=!1;function RC(){fF||(fF=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function hF(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var tje=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=hF}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}(),X1;X1=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 Vg={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-Vg.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?Vg.bounceIn(e*2)*.5:Vg.bounceOut(e*2-1)*.5+.5}},Sx=Math.pow,Wl=Math.sqrt,q1=1e-8,kK=1e-4,dF=Wl(3),Tx=1/3,go=gu(),Ji=gu(),id=gu();function Ml(e){return e>-q1&&eq1||e<-q1}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 vF(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function K1(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(Ml(c)&&Ml(f))if(Ml(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(Ml(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 x=Wl(g),b=c*s+1.5*o*(-f+x),S=c*s+1.5*o*(-f-x);b<0?b=-Sx(-b,Tx):b=Sx(b,Tx),S<0?S=-Sx(-S,Tx):S=Sx(S,Tx);var v=(-s-(b+S))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var T=(2*c*s-3*o*f)/(2*Wl(c*c*c)),A=Math.acos(T)/3,M=Wl(c),P=Math.cos(A),v=(-s-2*M*P)/(3*o),y=(-s+M*(P+dF*Math.sin(A)))/(3*o),k=(-s+M*(P-dF*Math.sin(A)))/(3*o);v>=0&&v<=1&&(a[d++]=v),y>=0&&y<=1&&(a[d++]=y),k>=0&&k<=1&&(a[d++]=k)}}return d}function OK(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(Ml(o)){if(IK(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Ml(c))i[0]=-a/(2*o);else if(c>0){var f=Wl(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 tu(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 EK(e,t,r,n,i,a,o,s,l,u,c){var f,h=.005,d=1/0,v,g,m,y;go[0]=l,go[1]=u;for(var x=0;x<1;x+=.05)Ji[0]=$r(e,r,i,o,x),Ji[1]=$r(t,n,a,s,x),m=Gl(go,Ji),m=0&&m=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Ml(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var f=Wl(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 DK(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function sy(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 NK(e,t,r,n,i,a,o,s,l){var u,c=.005,f=1/0;go[0]=o,go[1]=s;for(var h=0;h<1;h+=.05){Ji[0]=rn(e,r,i,h),Ji[1]=rn(t,n,a,h);var d=Gl(go,Ji);d=0&&d=1?1:K1(0,n,a,1,l,s)&&$r(0,i,o,1,s[0])}}}var oje=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||lr,this.ondestroy=t.ondestroy||lr,this.onrestart=t.onrestart||lr,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=Ae(t)?t:Vg[t]||nN(t)},e}(),jK=function(){function e(t){this.value=t}return e}(),sje=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new jK(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}(),Wd=function(){function e(t){this._list=new sje,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 jK(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}(),pF={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 Va(e){return e=Math.round(e),e<0?0:e>255?255:e}function lje(e){return e=Math.round(e),e<0?0:e>360?360:e}function ly(e){return e<0?0:e>1?1:e}function X_(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Va(parseFloat(t)/100*255):Va(parseInt(t,10))}function Ts(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?ly(parseFloat(t)/100):ly(parseFloat(t))}function BC(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 Pl(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 jk(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var RK=new Wd(20),Ax=null;function Wf(e,t){Ax&&jk(Ax,t),Ax=RK.put(e,Ax||t.slice())}function En(e,t){if(e){t=t||[];var r=RK.get(e);if(r)return jk(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in pF)return jk(t,pF[n]),Wf(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),Wf(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),Wf(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=Ts(u.pop());case"rgb":if(u.length>=3)return Ui(t,X_(u[0]),X_(u[1]),X_(u[2]),u.length===3?c:Ts(u[3])),Wf(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]=Ts(u[3]),Rk(u,t),Wf(e,t),t;case"hsl":if(u.length!==3){Ui(t,0,0,0,1);return}return Rk(u,t),Wf(e,t),t;default:return}}Ui(t,0,0,0,1)}}function Rk(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Ts(e[1]),i=Ts(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],Ui(t,Va(BC(o,a,r+1/3)*255),Va(BC(o,a,r)*255),Va(BC(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function uje(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 Q1(e,t){var r=En(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 sa(r,r.length===4?"rgba":"rgb")}}function cje(e){var t=En(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function Gg(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]=Va(Pl(o[0],s[0],l)),r[1]=Va(Pl(o[1],s[1],l)),r[2]=Va(Pl(o[2],s[2],l)),r[3]=ly(Pl(o[3],s[3],l)),r}}var fje=Gg;function iN(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=En(t[i]),s=En(t[a]),l=n-i,u=sa([Va(Pl(o[0],s[0],l)),Va(Pl(o[1],s[1],l)),Va(Pl(o[2],s[2],l)),ly(Pl(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var hje=iN;function As(e,t,r,n){var i=En(e);if(e)return i=uje(i),t!=null&&(i[0]=lje(Ae(t)?t(i[0]):t)),r!=null&&(i[1]=Ts(Ae(r)?r(i[1]):r)),n!=null&&(i[2]=Ts(Ae(n)?n(i[2]):n)),sa(Rk(i),"rgba")}function uy(e,t){var r=En(e);if(r&&t!=null)return r[3]=ly(t),sa(r,"rgba")}function sa(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 cy(e,t){var r=En(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function dje(){return sa([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var gF=new Wd(100);function J1(e){if(ve(e)){var t=gF.get(e);return t||(t=Q1(e,-.1),gF.put(e,t)),t}else if(e0(e)){var r=re({},e);return r.colorStops=se(e.colorStops,function(n){return{offset:n.offset,color:Q1(n.color,-.1)}}),r}return e}const vje=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:Gg,fastMapToColor:fje,lerp:iN,lift:Q1,liftColor:J1,lum:cy,mapToColor:hje,modifyAlpha:uy,modifyHSL:As,parse:En,parseCssFloat:Ts,parseCssInt:X_,random:dje,stringify:sa,toHex:cje},Symbol.toStringTag,{value:"Module"}));var ew=Math.round;function fy(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=En(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var mF=1e-4;function Ll(e){return e-mF}function Cx(e){return ew(e*1e3)/1e3}function Bk(e){return ew(e*1e4)/1e4}function pje(e){return"matrix("+Cx(e[0])+","+Cx(e[1])+","+Cx(e[2])+","+Cx(e[3])+","+Bk(e[4])+","+Bk(e[5])+")"}var gje={left:"start",right:"end",center:"middle",middle:"middle"};function mje(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function yje(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function xje(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 BK(e){return e&&!!e.image}function _je(e){return e&&!!e.svgElement}function aN(e){return BK(e)||_je(e)}function zK(e){return e.type==="linear"}function $K(e){return e.type==="radial"}function FK(e){return e&&(e.type==="linear"||e.type==="radial")}function vT(e){return"url(#"+e+")"}function VK(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 GK(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*Bg,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("+ew(o*Bg)+"deg, "+ew(s*Bg)+"deg)"),l.join(" ")}var bje=function(){return nt.hasGlobalWindow&&Ae(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}}(),zk=Array.prototype.slice;function ss(e,t,r){return(t-e)*r+e}function zC(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=xF,l=r;if(xn(r)){var u=Aje(r);s=u,(u===1&&!ot(r[0])||u===2&&!ot(r[0][0]))&&(o=!0)}else if(ot(r)&&!mn(r))s=Px;else if(ve(r))if(!isNaN(+r))s=Px;else{var c=En(r);c&&(l=c,s=hg)}else if(e0(r)){var f=re({},l);f.colorStops=se(r.colorStops,function(d){return{offset:d.offset,color:En(d.color)}}),zK(r)?s=$k:$K(r)&&(s=Fk),l=f}a===0?this.valType=s:(s!==this.valType||s===xF)&&(o=!0),this.discrete=this.discrete||o;var h={time:t,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=Ae(n)?n:Vg[n]||nN(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=Lx(i),u=_F(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 x=n?this._additiveValue:u?Pp:t[l];if((Lx(a)||u)&&!x&&(x=this._additiveValue=[]),this.discrete)t[l]=y<1?d.rawValue:v.rawValue;else if(Lx(a))a===K_?zC(x,d[i],v[i],y):wje(x,d[i],v[i],y);else if(_F(a)){var b=d[i],S=v[i],T=a===$k;t[l]={type:T?"linear":"radial",x:ss(b.x,S.x,y),y:ss(b.y,S.y,y),colorStops:se(b.colorStops,function(M,P){var k=S.colorStops[P];return{offset:ss(M.offset,k.offset,y),color:q_(zC([],M.color,k.color,y))}}),global:S.global},T?(t[l].x2=ss(b.x2,S.x2,y),t[l].y2=ss(b.y2,S.y2,y)):t[l].r=ss(b.r,S.r,y)}else if(u)zC(x,d[i],v[i],y),n||(t[l]=q_(x));else{var A=ss(d[i],v[i],y);n?this._additiveValue=A:t[l]=A}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===Px?t[n]=t[n]+i:r===hg?(En(t[n],Pp),Mx(Pp,Pp,i,1),t[n]=q_(Pp)):r===K_?Mx(t[n],t[n],i,1):r===WK&&yF(t[n],t[n],i,1)},e}(),oN=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){uT("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,Wg(u),i),this._trackKeys.push(s)}l.addKeyframe(t,Wg(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 Bh(){return new Date().getTime()}var Mje=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=Bh()-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&&(X1(n),!r._paused&&r.update())}X1(n)},t.prototype.start=function(){this._running||(this._time=Bh(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Bh(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Bh()-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 oN(r,n.loop);return this.addAnimator(i),i},t}(ya),Pje=300,$C=nt.domSupported,FC=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}}(),bF={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},wF=!1;function Vk(e){var t=e.pointerType;return t==="pen"||t==="touch"}function Lje(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 VC(e){e&&(e.zrByTouch=!0)}function kje(e,t){return Zi(e.dom,new Ije(e,t),!0)}function HK(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 Ije=function(){function e(t,r){this.stopPropagation=lr,this.stopImmediatePropagation=lr,this.preventDefault=lr,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),Ma={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;HK(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){wF=!0,e=Zi(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){wF||(e=Zi(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=Zi(this.dom,e),VC(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Ma.mousemove.call(this,e),Ma.mousedown.call(this,e)},touchmove:function(e){e=Zi(this.dom,e),VC(e),this.handler.processGesture(e,"change"),Ma.mousemove.call(this,e)},touchend:function(e){e=Zi(this.dom,e),VC(e),this.handler.processGesture(e,"end"),Ma.mouseup.call(this,e),+new Date-+this.__lastTouchMomentAF||e<-AF}var Ou=[],Hf=[],WC=Wr(),HC=Math.abs,ys=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 Iu(this.rotation)||Iu(this.x)||Iu(this.y)||Iu(this.scaleX-1)||Iu(this.scaleY-1)||Iu(this.skewX)||Iu(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(TF(n),this.invTransform=null);return}n=n||Wr(),r?this.getLocalTransform(n):TF(n),t&&(r?Fa(n,t,n):i0(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Ou);var n=Ou[0]<0?-1:1,i=Ou[1]<0?-1:1,a=((Ou[0]-n)*r+n)/Ou[0]||0,o=((Ou[1]-i)*r+i)/Ou[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Wr(),da(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(),Fa(Hf,t.invTransform,r),r=Hf);var n=this.originX,i=this.originY;(n||i)&&(WC[4]=n,WC[5]=i,Fa(Hf,r,WC),Hf[4]-=n,Hf[5]-=i,r=Hf),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&&ur(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&ur(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&HC(t[0]-1)>1e-10&&HC(t[3]-1)>1e-10?Math.sqrt(HC(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){rw(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}(),Bo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function rw(e,t){for(var r=0;r=CF)){e=e||Bs;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=hi.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?UC=CF:i>2&&UC++,t}}var UC=0,CF=5;function ZK(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=jje(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Eo(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=hi.measureText(t,e.font).width,r.put(t,n)),n}function MF(e,t,r,n){var i=Eo(Oo(t),e),a=a0(t),o=Hd(0,i,r),s=Dc(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 MF(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 nw(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+=Za(n[0],r.width),u+=Za(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 ZC="__zr_normal__",YC=Bo.concat(["ignore"]),Rje=ha(Bo,function(e,t){return e[t]=!0,e},{ignore:!1}),Uf={},Bje=new Oe(0,0,0,0),Ix=[],gT=function(){function e(t){this.id=QD(),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=Bje,n.layoutRect?h.copy(n.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(Uf,n,h):nw(Uf,n,h),a.x=Uf.x,a.y=Uf.y,o=Uf.align,s=Uf.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=Za(d[0],h.width),g=Za(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 x=y.overflowRect=y.overflowRect||new Oe(0,0,0,0);a.getLocalTransform(Ix),da(Ix,Ix),Oe.copy(x,h),x.applyTransform(Ix)}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,A=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),A=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),A=!0)),S=S||"#000",(S!==y.fill||T!==y.stroke||A!==y.autoStroke||o!==y.align||s!==y.verticalAlign)&&(l=!0,y.fill=S,y.stroke=T,y.autoStroke=A,y.align=o,y.verticalAlign=s,r.setDefaultTextStyle(y)),r.__dirty|=Si,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()?Uk:Hk},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&En(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,sa(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||{},re(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(Le(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(ZC,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===ZC,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Ve(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){uT("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&=~Si),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&=~Si)}},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=Ve(i,t),o=Ve(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,k=void 0,I=void 0;if(s){k={},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=Ve(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=Ve(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):oNe(navigator.userAgent,nt);function oNe(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 XD=12,dK="sans-serif",Bs=XD+"px "+dK,sNe=20,lNe=100,uNe="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function cNe(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(){R(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function DNe(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?rF(s,o):rF(o,s))}function SK(e){return e.nodeName.toUpperCase()==="CANVAS"}var NNe=/([&<>"'])/g,jNe={"&":"&","<":"<",">":">",'"':""","'":"'"};function On(e){return e==null?"":(e+"").replace(NNe,function(t,r){return jNe[r]})}var RNe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,EC=[],BNe=nt.browser.firefox&&+nt.browser.version.split(".")[0]<39;function Ik(e,t,r,n){return r=r||{},n?nF(e,t,r):BNe&&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):nF(e,t,r),r}function nF(e,t,r){if(nt.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(SK(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(kk(EC,e,n,i)){r.zrX=EC[0],r.zrY=EC[1];return}}r.zrX=r.zrY=0}function rN(e){return e||window.event}function Zi(e,t,r){if(t=rN(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&&Ik(e,o,t,r)}else{Ik(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&&RNe.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 Ok(e,t,r,n){e.addEventListener(t,r,n)}function $Ne(e,t,r,n){e.removeEventListener(t,r,n)}var zs=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function iF(e){return e.which===2||e.which===3}var FNe=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=aF(n)/aF(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=VNe(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 i0(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function a0(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 Fa(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 Ua(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 vT(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 da(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 TK(e){var t=Wr();return a0(t,e),t}const GNe=Object.freeze(Object.defineProperty({__proto__:null,clone:TK,copy:a0,create:Wr,identity:i0,invert:da,mul:Fa,rotate:qs,scale:vT,translate:Ua},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}(),Sc=Math.min,Bh=Math.max,Ek=Math.abs,oF=["x","y"],WNe=["width","height"],Pu=new Ie,Lu=new Ie,ku=new Ie,Iu=new Ie,bi=AK(),fg=bi.minTv,Dk=bi.maxTv,Vg=[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=Sc(t.x,this.x),n=Sc(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Bh(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Bh(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 Ua(a,a,[-r.x,-r.y]),vT(a,a,[n,i]),Ua(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(HNe,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(UNe,r.x,r.y,r.width,r.height));var s=!!n;bi.reset(i,s);var l=bi.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}Pu.x=ku.x=r.x,Pu.y=Iu.y=r.y,Lu.x=Iu.x=r.x+r.width,Lu.y=ku.y=r.y+r.height,Pu.transform(n),Iu.transform(n),Lu.transform(n),ku.transform(n),t.x=Sc(Pu.x,Lu.x,ku.x,Iu.x),t.y=Sc(Pu.y,Lu.y,ku.y,Iu.y);var l=Bh(Pu.x,Lu.x,ku.x,Iu.x),u=Bh(Pu.y,Lu.y,ku.y,Iu.y);t.width=l-t.x,t.height=u-t.y},e}(),HNe=new Oe(0,0,0,0),UNe=new Oe(0,0,0,0);function sF(e,t,r,n,i,a,o,s){var l=Ek(t-r),u=Ek(n-e),c=Sc(l,u),f=oF[i],h=oF[1-i],d=WNe[i];t=u||!bi.bidirectional)&&(fg[f]=-u,fg[h]=0,bi.useDir&&bi.calcDirMTV())))}function AK(){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=Bh(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)&&(NC.copy(h.getBoundingRect()),h.transform&&NC.applyTransform(h.transform),NC.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 KNe(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?CK:!0}return!1}function lF(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=KNe(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==CK)){t.target=o;break}}}function PK(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var LK=32,Pp=7;function QNe(e){for(var t=0;e>=LK;)t|=e&1,e>>=1;return e+t}function uF(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 JNe(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 jC(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 RC(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 eje(e,t){var r=Pp,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]=Pp||M>=Pp);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[A+y]=e[T+y];e[S]=o[b];return}for(var M=r;;){var P=0,k=0,I=!1;do if(t(o[b],e[_])<0){if(e[S--]=e[_--],P++,k=0,--v===0){I=!0;break}}else if(e[S--]=o[b--],k++,P=0,--m===1){I=!0;break}while((P|k)=0;y--)e[A+y]=e[T+y];if(v===0){I=!0;break}}if(e[S--]=o[b--],--m===1){I=!0;break}if(k=m-jC(e[_],o,0,m,m-1,t),k!==0){for(S-=k,b-=k,m-=k,A=S+1,T=b+1,y=0;y=Pp||k>=Pp);if(I)break;M<0&&(M=0),M+=2}if(r=M,r<1&&(r=1),m===1){for(S-=v,_-=v,A=S+1,T=_+1,y=v-1;y>=0;y--)e[A+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),cF(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 Si=1,hg=2,xh=4,fF=!1;function BC(){fF||(fF=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function hF(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var tje=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=hF}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}(),q1;q1=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 Gg={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-Gg.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?Gg.bounceIn(e*2)*.5:Gg.bounceOut(e*2-1)*.5+.5}},Tx=Math.pow,Hl=Math.sqrt,K1=1e-8,kK=1e-4,dF=Hl(3),Ax=1/3,go=mu(),Ji=mu(),ad=mu();function Pl(e){return e>-K1&&eK1||e<-K1}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 vF(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function Q1(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(Pl(c)&&Pl(f))if(Pl(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(Pl(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 _=Hl(g),b=c*s+1.5*o*(-f+_),S=c*s+1.5*o*(-f-_);b<0?b=-Tx(-b,Ax):b=Tx(b,Ax),S<0?S=-Tx(-S,Ax):S=Tx(S,Ax);var v=(-s-(b+S))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var T=(2*c*s-3*o*f)/(2*Hl(c*c*c)),A=Math.acos(T)/3,M=Hl(c),P=Math.cos(A),v=(-s-2*M*P)/(3*o),y=(-s+M*(P+dF*Math.sin(A)))/(3*o),k=(-s+M*(P-dF*Math.sin(A)))/(3*o);v>=0&&v<=1&&(a[d++]=v),y>=0&&y<=1&&(a[d++]=y),k>=0&&k<=1&&(a[d++]=k)}}return d}function OK(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(Pl(o)){if(IK(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Pl(c))i[0]=-a/(2*o);else if(c>0){var f=Hl(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 ru(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 EK(e,t,r,n,i,a,o,s,l,u,c){var f,h=.005,d=1/0,v,g,m,y;go[0]=l,go[1]=u;for(var _=0;_<1;_+=.05)Ji[0]=$r(e,r,i,o,_),Ji[1]=$r(t,n,a,s,_),m=Wl(go,Ji),m=0&&m=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Pl(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var f=Hl(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 DK(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function ly(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 NK(e,t,r,n,i,a,o,s,l){var u,c=.005,f=1/0;go[0]=o,go[1]=s;for(var h=0;h<1;h+=.05){Ji[0]=rn(e,r,i,h),Ji[1]=rn(t,n,a,h);var d=Wl(go,Ji);d=0&&d=1?1:Q1(0,n,a,1,l,s)&&$r(0,i,o,1,s[0])}}}var oje=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||lr,this.ondestroy=t.ondestroy||lr,this.onrestart=t.onrestart||lr,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=Ae(t)?t:Gg[t]||nN(t)},e}(),jK=function(){function e(t){this.value=t}return e}(),sje=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new jK(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}(),Hd=function(){function e(t){this._list=new sje,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 jK(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}(),pF={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 Va(e){return e=Math.round(e),e<0?0:e>255?255:e}function lje(e){return e=Math.round(e),e<0?0:e>360?360:e}function uy(e){return e<0?0:e>1?1:e}function q_(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Va(parseFloat(t)/100*255):Va(parseInt(t,10))}function Ts(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?uy(parseFloat(t)/100):uy(parseFloat(t))}function zC(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 Ll(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 jk(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var RK=new Hd(20),Cx=null;function Hf(e,t){Cx&&jk(Cx,t),Cx=RK.put(e,Cx||t.slice())}function En(e,t){if(e){t=t||[];var r=RK.get(e);if(r)return jk(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in pF)return jk(t,pF[n]),Hf(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),Hf(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),Hf(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=Ts(u.pop());case"rgb":if(u.length>=3)return Ui(t,q_(u[0]),q_(u[1]),q_(u[2]),u.length===3?c:Ts(u[3])),Hf(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]=Ts(u[3]),Rk(u,t),Hf(e,t),t;case"hsl":if(u.length!==3){Ui(t,0,0,0,1);return}return Rk(u,t),Hf(e,t),t;default:return}}Ui(t,0,0,0,1)}}function Rk(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Ts(e[1]),i=Ts(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],Ui(t,Va(zC(o,a,r+1/3)*255),Va(zC(o,a,r)*255),Va(zC(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function uje(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 J1(e,t){var r=En(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 sa(r,r.length===4?"rgba":"rgb")}}function cje(e){var t=En(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function Wg(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]=Va(Ll(o[0],s[0],l)),r[1]=Va(Ll(o[1],s[1],l)),r[2]=Va(Ll(o[2],s[2],l)),r[3]=uy(Ll(o[3],s[3],l)),r}}var fje=Wg;function iN(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=En(t[i]),s=En(t[a]),l=n-i,u=sa([Va(Ll(o[0],s[0],l)),Va(Ll(o[1],s[1],l)),Va(Ll(o[2],s[2],l)),uy(Ll(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var hje=iN;function As(e,t,r,n){var i=En(e);if(e)return i=uje(i),t!=null&&(i[0]=lje(Ae(t)?t(i[0]):t)),r!=null&&(i[1]=Ts(Ae(r)?r(i[1]):r)),n!=null&&(i[2]=Ts(Ae(n)?n(i[2]):n)),sa(Rk(i),"rgba")}function cy(e,t){var r=En(e);if(r&&t!=null)return r[3]=uy(t),sa(r,"rgba")}function sa(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 fy(e,t){var r=En(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function dje(){return sa([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var gF=new Hd(100);function ew(e){if(ve(e)){var t=gF.get(e);return t||(t=J1(e,-.1),gF.put(e,t)),t}else if(t0(e)){var r=re({},e);return r.colorStops=se(e.colorStops,function(n){return{offset:n.offset,color:J1(n.color,-.1)}}),r}return e}const vje=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:Wg,fastMapToColor:fje,lerp:iN,lift:J1,liftColor:ew,lum:fy,mapToColor:hje,modifyAlpha:cy,modifyHSL:As,parse:En,parseCssFloat:Ts,parseCssInt:q_,random:dje,stringify:sa,toHex:cje},Symbol.toStringTag,{value:"Module"}));var tw=Math.round;function hy(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=En(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var mF=1e-4;function kl(e){return e-mF}function Mx(e){return tw(e*1e3)/1e3}function Bk(e){return tw(e*1e4)/1e4}function pje(e){return"matrix("+Mx(e[0])+","+Mx(e[1])+","+Mx(e[2])+","+Mx(e[3])+","+Bk(e[4])+","+Bk(e[5])+")"}var gje={left:"start",right:"end",center:"middle",middle:"middle"};function mje(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function yje(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function xje(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 BK(e){return e&&!!e.image}function _je(e){return e&&!!e.svgElement}function aN(e){return BK(e)||_je(e)}function zK(e){return e.type==="linear"}function $K(e){return e.type==="radial"}function FK(e){return e&&(e.type==="linear"||e.type==="radial")}function pT(e){return"url(#"+e+")"}function VK(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 GK(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("+tw(o*zg)+"deg, "+tw(s*zg)+"deg)"),l.join(" ")}var bje=function(){return nt.hasGlobalWindow&&Ae(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}}(),zk=Array.prototype.slice;function ss(e,t,r){return(t-e)*r+e}function $C(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=xF,l=r;if(xn(r)){var u=Aje(r);s=u,(u===1&&!ot(r[0])||u===2&&!ot(r[0][0]))&&(o=!0)}else if(ot(r)&&!mn(r))s=Lx;else if(ve(r))if(!isNaN(+r))s=Lx;else{var c=En(r);c&&(l=c,s=dg)}else if(t0(r)){var f=re({},l);f.colorStops=se(r.colorStops,function(d){return{offset:d.offset,color:En(d.color)}}),zK(r)?s=$k:$K(r)&&(s=Fk),l=f}a===0?this.valType=s:(s!==this.valType||s===xF)&&(o=!0),this.discrete=this.discrete||o;var h={time:t,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=Ae(n)?n:Gg[n]||nN(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=kx(i),u=_F(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?Lp:t[l];if((kx(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[l]=y<1?d.rawValue:v.rawValue;else if(kx(a))a===Q_?$C(_,d[i],v[i],y):wje(_,d[i],v[i],y);else if(_F(a)){var b=d[i],S=v[i],T=a===$k;t[l]={type:T?"linear":"radial",x:ss(b.x,S.x,y),y:ss(b.y,S.y,y),colorStops:se(b.colorStops,function(M,P){var k=S.colorStops[P];return{offset:ss(M.offset,k.offset,y),color:K_($C([],M.color,k.color,y))}}),global:S.global},T?(t[l].x2=ss(b.x2,S.x2,y),t[l].y2=ss(b.y2,S.y2,y)):t[l].r=ss(b.r,S.r,y)}else if(u)$C(_,d[i],v[i],y),n||(t[l]=K_(_));else{var A=ss(d[i],v[i],y);n?this._additiveValue=A:t[l]=A}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===Lx?t[n]=t[n]+i:r===dg?(En(t[n],Lp),Px(Lp,Lp,i,1),t[n]=K_(Lp)):r===Q_?Px(t[n],t[n],i,1):r===WK&&yF(t[n],t[n],i,1)},e}(),oN=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,Hg(u),i),this._trackKeys.push(s)}l.addKeyframe(t,Hg(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 Mje=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&&(q1(n),!r._paused&&r.update())}q1(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 oN(r,n.loop);return this.addAnimator(i),i},t}(ya),Pje=300,FC=nt.domSupported,VC=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}}(),bF={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},wF=!1;function Vk(e){var t=e.pointerType;return t==="pen"||t==="touch"}function Lje(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 GC(e){e&&(e.zrByTouch=!0)}function kje(e,t){return Zi(e.dom,new Ije(e,t),!0)}function HK(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 Ije=function(){function e(t,r){this.stopPropagation=lr,this.stopImmediatePropagation=lr,this.preventDefault=lr,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),Ma={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;HK(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){wF=!0,e=Zi(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){wF||(e=Zi(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=Zi(this.dom,e),GC(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Ma.mousemove.call(this,e),Ma.mousedown.call(this,e)},touchmove:function(e){e=Zi(this.dom,e),GC(e),this.handler.processGesture(e,"change"),Ma.mousemove.call(this,e)},touchend:function(e){e=Zi(this.dom,e),GC(e),this.handler.processGesture(e,"end"),Ma.mouseup.call(this,e),+new Date-+this.__lastTouchMomentAF||e<-AF}var Eu=[],Uf=[],HC=Wr(),UC=Math.abs,ys=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 Ou(this.rotation)||Ou(this.x)||Ou(this.y)||Ou(this.scaleX-1)||Ou(this.scaleY-1)||Ou(this.skewX)||Ou(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(TF(n),this.invTransform=null);return}n=n||Wr(),r?this.getLocalTransform(n):TF(n),t&&(r?Fa(n,t,n):a0(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Eu);var n=Eu[0]<0?-1:1,i=Eu[1]<0?-1:1,a=((Eu[0]-n)*r+n)/Eu[0]||0,o=((Eu[1]-i)*r+i)/Eu[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Wr(),da(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(),Fa(Uf,t.invTransform,r),r=Uf);var n=this.originX,i=this.originY;(n||i)&&(HC[4]=n,HC[5]=i,Fa(Uf,r,HC),Uf[4]-=n,Uf[5]-=i,r=Uf),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&&ur(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&ur(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&UC(t[0]-1)>1e-10&&UC(t[3]-1)>1e-10?Math.sqrt(UC(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){nw(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}(),Bo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function nw(e,t){for(var r=0;r=CF)){e=e||Bs;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=hi.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?ZC=CF:i>2&&ZC++,t}}var ZC=0,CF=5;function ZK(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=jje(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Eo(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=hi.measureText(t,e.font).width,r.put(t,n)),n}function MF(e,t,r,n){var i=Eo(Oo(t),e),a=o0(t),o=Ud(0,i,r),s=Nc(0,a,n),l=new Oe(o,s,i,a);return l}function gT(e,t,r,n){var i=((e||"")+"").split(` +`),a=i.length;if(a===1)return MF(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 iw(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+=Za(n[0],r.width),u+=Za(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 YC="__zr_normal__",XC=Bo.concat(["ignore"]),Rje=ha(Bo,function(e,t){return e[t]=!0,e},{ignore:!1}),Zf={},Bje=new Oe(0,0,0,0),Ox=[],mT=function(){function e(t){this.id=QD(),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=Bje,n.layoutRect?h.copy(n.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(Zf,n,h):iw(Zf,n,h),a.x=Zf.x,a.y=Zf.y,o=Zf.align,s=Zf.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=Za(d[0],h.width),g=Za(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(Ox),da(Ox,Ox),Oe.copy(_,h),_.applyTransform(Ox)}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,A=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),A=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),A=!0)),S=S||"#000",(S!==y.fill||T!==y.stroke||A!==y.autoStroke||o!==y.align||s!==y.verticalAlign)&&(l=!0,y.fill=S,y.stroke=T,y.autoStroke=A,y.align=o,y.verticalAlign=s,r.setDefaultTextStyle(y)),r.__dirty|=Si,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()?Uk:Hk},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&En(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,sa(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||{},re(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(Le(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(YC,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===YC,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Ge(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&=~Si),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&=~Si)}},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=Ge(i,t),o=Ge(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,k=void 0,I=void 0;if(s){k={},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=Ge(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=Ge(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 de=Qje;function Qje(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 iw(e,t,r)}function iw(e,t,r){return ve(e)?Kje(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function mr(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),QK),e=(+e).toFixed(t),r?e:+e}function Mi(e){return e.sort(function(t,r){return t-r}),e}function Ra(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 JK(e)}function JK(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 sN(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(bo(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function Jje(e,t,r){if(!e[t])return 0;var n=eQ(e,r);return n[t]||0}function eQ(e,t){var r=ha(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=ha(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 eRe(e,t){var r=Math.max(Ra(e),Ra(t)),n=e+t;return r>QK?n:mr(n,r)}var Xk=9007199254740991;function lN(e){var t=Math.PI*2;return(e%t+t)%t}function Ud(e){return e>-PF&&e=10&&t++,t}function uN(e,t){var r=mT(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 eb(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 qk(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 KC(e){e.option=e.parentModel=e.ecModel=null}var _Re=".",Eu="___EC__COMPONENT__CONTAINER___",fQ="___EC__EXTENDED_CLASS___";function wo(e){var t={main:"",sub:""};if(e){var r=e.split(_Re);t.main=r[0]||"",t.sub=r[1]||""}return t}function bRe(e){_n(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function wRe(e){return!!(e&&e[fQ])}function dN(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return SRe(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)},JD(i,this)),re(i.prototype,r),i[fQ]=!0,i.extend=this.extend,i.superCall=CRe,i.superApply=MRe,i.superClass=n,i}}function SRe(e){return Ae(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function hQ(e,t){e.extend=t.extend}var TRe=Math.round(Math.random()*10);function ARe(e){var t=["__\0is_clz",TRe++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function CRe(e,t){for(var r=[],n=2;n=0||a&&Ve(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var PRe=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],LRe=tf(PRe),kRe=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return LRe(this,t,r)},e}(),Qk=new Wd(50);function IRe(e){if(typeof e=="string"){var t=Qk.get(e);return t&&t.image}else return e}function vN(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=Qk.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!xT(t)&&a.pending.push(o)):(t=hi.loadImage(e,OF,OF),t.__zrImageSrc=e,Qk.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function OF(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t0&&(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 de=Qje;function Qje(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 aw(e,t,r)}function aw(e,t,r){return ve(e)?Kje(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function mr(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),QK),e=(+e).toFixed(t),r?e:+e}function Mi(e){return e.sort(function(t,r){return t-r}),e}function Ra(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 JK(e)}function JK(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 sN(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(bo(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function Jje(e,t,r){if(!e[t])return 0;var n=eQ(e,r);return n[t]||0}function eQ(e,t){var r=ha(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=ha(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 eRe(e,t){var r=Math.max(Ra(e),Ra(t)),n=e+t;return r>QK?n:mr(n,r)}var Xk=9007199254740991;function lN(e){var t=Math.PI*2;return(e%t+t)%t}function Zd(e){return e>-PF&&e=10&&t++,t}function uN(e,t){var r=yT(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 tb(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 qk(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 QC(e){e.option=e.parentModel=e.ecModel=null}var _Re=".",Du="___EC__COMPONENT__CONTAINER___",fQ="___EC__EXTENDED_CLASS___";function wo(e){var t={main:"",sub:""};if(e){var r=e.split(_Re);t.main=r[0]||"",t.sub=r[1]||""}return t}function bRe(e){_n(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function wRe(e){return!!(e&&e[fQ])}function dN(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return SRe(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)},JD(i,this)),re(i.prototype,r),i[fQ]=!0,i.extend=this.extend,i.superCall=CRe,i.superApply=MRe,i.superClass=n,i}}function SRe(e){return Ae(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function hQ(e,t){e.extend=t.extend}var TRe=Math.round(Math.random()*10);function ARe(e){var t=["__\0is_clz",TRe++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function CRe(e,t){for(var r=[],n=2;n=0||a&&Ge(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var PRe=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],LRe=rf(PRe),kRe=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return LRe(this,t,r)},e}(),Qk=new Hd(50);function IRe(e){if(typeof e=="string"){var t=Qk.get(e);return t&&t.image}else return e}function vN(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=Qk.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!_T(t)&&a.pending.push(o)):(t=hi.loadImage(e,OF,OF),t.__zrImageSrc=e,Qk.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function OF(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var c=Eo(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 pQ(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=Eo(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?ERe(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=Eo(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function ERe(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),x=y.length*h}if(i&&c&&g!=null)for(var S=vQ(g,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},A=0;Av&&JC(a,o.substring(v,m),t,d),JC(a,g[2],t,d,g[1]),v=QC.lastIndex}vf){var U=a.lines.length;D>0?(k.tokens=k.tokens.slice(0,D),M(k,O,I),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(` +`),e.isTruncated=s}function vQ(e,t,r,n){n=n||{};var i=re({},n);r=be(r,"..."),i.maxIterations=be(n.maxIterations,2);var a=i.minChar=be(n.minChar,0),o=i.fontMeasureInfo=Oo(t),s=o.asciiCharWidth;i.placeholder=be(n.placeholder,"");for(var l=e=Math.max(0,e-1),u=0;u=s;u++)l-=s;var c=Eo(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 pQ(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=Eo(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?ERe(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=Eo(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function ERe(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=vQ(g,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},A=0;Av&&e2(a,o.substring(v,m),t,d),e2(a,g[2],t,d,g[1]),v=JC.lastIndex}vf){var U=a.lines.length;D>0?(k.tokens=k.tokens.slice(0,D),M(k,O,I),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=gQ(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=Oo(l),y=0;y=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var zRe=ha(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function $Re(e){return BRe(e)?!!zRe[e]:!0}function gQ(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,f=Oo(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 DF(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(NF,Hd(r,o,i),Dc(n,s,a),o,s),Oe.intersect(t,NF,null,jF);var l=jF.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=Hd(l.x,l.width,i,!0),e.baseY=Dc(l.y,l.height,a,!0)}}var NF=new Oe(0,0,0,0),jF={outIntersectRect:{},clamp:!0};function pN(e){return e!=null?e+="":e=""}function FRe(e){var t=pN(e.text),r=e.font,n=Eo(Oo(r),t),i=a0(r);return Jk(e,n,i,null)}function Jk(e,t,r,n){var i=new Oe(Hd(e.x||0,t,e.textAlign),Dc(e.y||0,r,e.textBaseline),t,r),a=n??(mQ(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function mQ(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var eI="__zr_style_"+Math.round(Math.random()*10),Nc={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},_T={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Nc[eI]=!0;var RF=["z","z2","invisible"],VRe=["invisible"],va=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(Ox[0]=n2(i)*r+e,Ox[1]=r2(i)*n+t,Ex[0]=n2(a)*r+e,Ex[1]=r2(a)*n+t,u(s,Ox,Ex),c(l,Ox,Ex),i=i%Du,i<0&&(i=i+Du),a=a%Du,a<0&&(a=a+Du),i>a&&!o?a+=Du:ii&&(Dx[0]=n2(d)*r+e,Dx[1]=r2(d)*n+t,u(s,Dx,s),c(l,Dx,l))}var It={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Nu=[],ju=[],no=[],rl=[],io=[],ao=[],i2=Math.min,a2=Math.max,Ru=Math.cos,Bu=Math.sin,es=Math.abs,tI=Math.PI,hl=tI*2,o2=typeof Float32Array<"u",Lp=[];function s2(e){var t=Math.round(e/tI*1e8)/1e8;return t%2*tI}function wT(e,t){var r=s2(e[0]);r<0&&(r+=hl);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=hl?i=r+hl:t&&r-i>=hl?i=r-hl:!t&&r>i?i=r+(hl-s2(r-i)):t&&r0&&(this._ux=es(n/tw/t)||0,this._uy=es(n/tw/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=es(t-this._xi),i=es(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(),Lp[0]=i,Lp[1]=a,wT(Lp,o),i=Lp[0],a=Lp[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=Ru(a)*n+t,this._yi=Bu(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)&&o2&&(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(){no[0]=no[1]=io[0]=io[1]=Number.MAX_VALUE,rl[0]=rl[1]=ao[0]=ao[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||es(b)>i||h===r-1)&&(g=Math.sqrt(x*x+b*b),a=m,o=y);break}case It.C:{var S=t[h++],T=t[h++],m=t[h++],y=t[h++],A=t[h++],M=t[h++];g=rje(a,o,S,T,m,y,A,M,10),a=A,o=M;break}case It.Q:{var S=t[h++],T=t[h++],m=t[h++],y=t[h++];g=ije(a,o,S,T,m,y,10),a=m,o=y;break}case It.A:var P=t[h++],k=t[h++],I=t[h++],O=t[h++],D=t[h++],N=t[h++],B=N+D;h+=1,v&&(s=Ru(D)*I+P,l=Bu(D)*O+k),g=a2(I,O)*i2(hl,Math.abs(N)),a=Ru(B)*I+P,o=Bu(B)*O+k;break;case It.R:{s=a=t[h++],l=o=t[h++];var $=t[h++],F=t[h++];g=$*2+F*2;break}case It.Z:{var x=s-a,b=l-o;g=Math.sqrt(x*x+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,x,b=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,g=this._pathLen,x=r*g,!x)))e:for(var A=0;A0&&(t.lineTo(S,T),b=0),M){case It.M:s=u=n[A++],l=c=n[A++],t.moveTo(u,c);break;case It.L:{f=n[A++],h=n[A++];var k=es(f-u),I=es(h-c);if(k>i||I>a){if(d){var O=v[y++];if(m+O>x){var D=(x-m)/O;t.lineTo(u*(1-D)+f*D,c*(1-D)+h*D);break e}m+=O}t.lineTo(f,h),u=f,c=h,b=0}else{var N=k*k+I*I;N>b&&(S=f,T=h,b=N)}break}case It.C:{var B=n[A++],$=n[A++],F=n[A++],G=n[A++],z=n[A++],U=n[A++];if(d){var O=v[y++];if(m+O>x){var D=(x-m)/O;tu(u,B,F,z,D,Nu),tu(c,$,G,U,D,ju),t.bezierCurveTo(Nu[1],ju[1],Nu[2],ju[2],Nu[3],ju[3]);break e}m+=O}t.bezierCurveTo(B,$,F,G,z,U),u=z,c=U;break}case It.Q:{var B=n[A++],$=n[A++],F=n[A++],G=n[A++];if(d){var O=v[y++];if(m+O>x){var D=(x-m)/O;sy(u,B,F,D,Nu),sy(c,$,G,D,ju),t.quadraticCurveTo(Nu[1],ju[1],Nu[2],ju[2]);break e}m+=O}t.quadraticCurveTo(B,$,F,G),u=F,c=G;break}case It.A:var H=n[A++],Y=n[A++],Z=n[A++],J=n[A++],ae=n[A++],ce=n[A++],ge=n[A++],Ge=!n[A++],xe=Z>J?Z:J,ne=es(Z-J)>.001,fe=ae+ce,le=!1;if(d){var O=v[y++];m+O>x&&(fe=ae+ce*(x-m)/O,le=!0),m+=O}if(ne&&t.ellipse?t.ellipse(H,Y,Z,J,ge,ae,fe,Ge):t.arc(H,Y,xe,ae,fe,Ge),le)break e;P&&(s=Ru(ae)*Z+H,l=Bu(ae)*J+Y),u=Ru(fe)*Z+H,c=Bu(fe)*J+Y;break;case It.R:s=u=n[A],l=c=n[A+1],f=n[A++],h=n[A++];var ee=n[A++],$e=n[A++];if(d){var O=v[y++];if(m+O>x){var Se=x-m;t.moveTo(f,h),t.lineTo(f+i2(Se,ee),h),Se-=ee,Se>0&&t.lineTo(f+ee,h+i2(Se,$e)),Se-=$e,Se>0&&t.lineTo(f+a2(ee-Se,0),h+$e),Se-=ee,Se>0&&t.lineTo(f,h+a2($e-Se,0));break e}m+=O}t.rect(f,h,ee,$e);break;case It.Z:if(d){var O=v[y++];if(m+O>x){var D=(x-m)/O;t.lineTo(u*(1-D)+s*D,c*(1-D)+l*D);break e}m+=O}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 ml(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+=kp);var h=Math.atan2(l,s);return h<0&&(h+=kp),h>=n&&h<=i||h+kp>=n&&h+kp<=i}function ls(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var nl=$o.CMD,zu=Math.PI*2,XRe=1e-4;function qRe(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&KRe(),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=rn(t,n,a,u),h=0;hr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);$n[0]=-l,$n[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=zu-1e-4){n=0,i=zu;var c=a?1:-1;return o>=$n[0]+e&&o<=$n[1]+e?c:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=zu,i+=zu);for(var h=0,d=0;d<2;d++){var v=$n[d];if(v+e>o){var g=Math.atan2(s,v),c=a?1:-1;g<0&&(g=zu+g),(g>=n&&g<=i||g+zu>=n&&g+zu<=i)&&(g>Math.PI/2&&g1&&(r||(s+=ls(l,u,c,f,n,i))),m&&(l=a[v],u=a[v+1],c=l,f=u),g){case nl.M:c=a[v++],f=a[v++],l=c,u=f;break;case nl.L:if(r){if(ml(l,u,a[v],a[v+1],t,n,i))return!0}else s+=ls(l,u,a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case nl.C:if(r){if(ZRe(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=QRe(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 nl.Q:if(r){if(yQ(l,u,a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=JRe(l,u,a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case nl.A:var y=a[v++],x=a[v++],b=a[v++],S=a[v++],T=a[v++],A=a[v++];v+=1;var M=!!(1-a[v++]);h=Math.cos(T)*b+y,d=Math.sin(T)*S+x,m?(c=h,f=d):s+=ls(l,u,h,d,n,i);var P=(n-y)*S/b+y;if(r){if(YRe(y,x,S,T,T+A,M,t,P,i))return!0}else s+=e5e(y,x,S,T,T+A,M,P,i);l=Math.cos(T+A)*b+y,u=Math.sin(T+A)*S+x;break;case nl.R:c=l=a[v++],f=u=a[v++];var k=a[v++],I=a[v++];if(h=c+k,d=f+I,r){if(ml(c,f,h,f,t,n,i)||ml(h,f,h,d,t,n,i)||ml(h,d,c,d,t,n,i)||ml(c,d,c,f,t,n,i))return!0}else s+=ls(h,f,h,d,n,i),s+=ls(c,d,c,f,n,i);break;case nl.Z:if(r){if(ml(l,u,c,f,t,n,i))return!0}else s+=ls(l,u,c,f,n,i);l=c,u=f;break}}return!r&&!qRe(u,f)&&(s+=ls(l,u,c,f,n,i)||0),s!==0}function t5e(e,t,r){return xQ(e,0,!1,t,r)}function r5e(e,t,r,n){return xQ(e,t,!0,r,n)}var aw=Pe({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Nc),n5e={style:Pe({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},_T.style)},l2=Bo.concat(["invisible","culling","z","z2","zlevel","parent"]),rt=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?Hk:n>.2?Nje:Uk}else if(r)return Uk}return Hk},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(ve(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=cy(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&yh)&&(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)),r5e(s,l/u,r,n)))return!0}if(this.hasFill())return t5e(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=yh,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:re(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&yh)},t.prototype.createStyle=function(r){return r0(aw,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=re({},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=re({},i.shape),re(u,n.shape)):(u=re({},a?this.shape:i.shape),re(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=re({},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 zh=Math.round;function ST(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&&(zh(n*2)===zh(i*2)&&(e.x1=e.x2=Li(n,s,!0)),zh(a*2)===zh(o*2)&&(e.y1=e.y2=Li(a,s,!0))),e}}function _Q(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=Li(n,s,!0),e.y=Li(i,s,!0),e.width=Math.max(Li(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Li(i+o,s,!1)-e.y,o===0?0:1)),e}}function Li(e,t,r){if(!t)return e;var n=zh(e*2);return(n+zh(t))%2===0?n/2:(n+(r?1:-1))/2}var u5e=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),c5e={},Xe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new u5e},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=_Q(c5e,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?l5e(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(rt);Xe.prototype.type="rect";var VF={fill:"#000"},GF=2,oo={},f5e={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},_T.style)},at=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=VF,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&&(B=A[N],B.align==="right");)this._placeToken(B,r,P,y,D,"right",b),k-=B.width,D-=B.width,N--;for(O+=(c-(O-m)-(x-D)-k)/2;I<=N;)B=A[I],this._placeToken(B,r,P,y,O+B.width/2,"center",b),O+=B.width,I++;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&&u2(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=XF(o,s,v),f-=r.height/2-v[0]-r.innerHeight/2);var g=this._getOrCreateChild(Zd),m=g.createStyle();g.useStyle(m);var y=this._defaultStyle,x=!1,b=0,S=!1,T=YF("fill"in u?u.fill:"fill"in n?n.fill:(x=!0,y.fill)),A=ZF("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!y.autoStroke||x)?(b=GF,S=!0,y.stroke):null),M=u.textShadowBlur>0||n.textShadowBlur>0;m.text=r.text,m.x=o,m.y=f,M&&(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||Bs,m.opacity=fi(u.opacity,n.opacity,1),HF(m,u),A&&(m.lineWidth=fi(u.lineWidth,n.lineWidth,b),m.lineDash=be(u.lineDash,n.lineDash),m.lineDashOffset=n.lineDashOffset||0,m.stroke=A),T&&(m.fill=T),g.setBoundingRect(Jk(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 x=g.style;x.fill=l||null,x.fillOpacity=be(r.fillOpacity,1)}else if(f){m=this._getOrCreateChild(Xr),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 x=g.style;x.lineWidth=u,x.stroke=c,x.strokeOpacity=be(r.strokeOpacity,1),x.lineDash=r.borderDash,x.lineDashOffset=r.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(x.strokeFirst=!0,x.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=fi(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return wQ(r)&&(n=[r.fontStyle,r.fontWeight,bQ(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Ci(n)||r.textFont||r.font},t}(va),h5e={left:!0,right:1,center:1},d5e={top:1,bottom:1,middle:1},WF=["fontStyle","fontWeight","fontSize","fontFamily"];function bQ(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?XD+"px":e+"px"}function HF(e,t){for(var r=0;r=0,a=!1;if(e instanceof rt){var o=SQ(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(Zf(s)||Zf(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=re({},n),u=re({},u),u.fill=s):!Zf(u.fill)&&Zf(s)?(a=!0,n=re({},n),u=re({},u),u.fill=J1(s)):!Zf(u.stroke)&&Zf(l)&&(a||(n=re({},n),u=re({},u)),u.stroke=J1(l)),n.style=u}}if(n&&n.z2==null){a||(n=re({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??Iv)}return n}function _5e(e,t,r){if(r&&r.z2==null){r=re({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??p5e)}return r}function b5e(e,t,r){var n=Ve(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:y5e(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=re({},r),o=re({opacity:n?i:a.opacity*.1},o),r.style=o),r}function c2(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return x5e(this,e,t,r);if(e==="blur")return b5e(this,e,r);if(e==="select")return _5e(this,e,r)}return r}function rf(e){e.stateProxy=c2;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=c2),r&&(r.stateProxy=c2)}function eV(e,t){!kQ(e,t)&&!e.__highByOuter&&Ks(e,TQ)}function tV(e,t){!kQ(e,t)&&!e.__highByOuter&&Ks(e,AQ)}function $s(e,t){e.__highByOuter|=1<<(t||0),Ks(e,TQ)}function Fs(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Ks(e,AQ)}function MQ(e){Ks(e,xN)}function _N(e){Ks(e,CQ)}function PQ(e){Ks(e,g5e)}function LQ(e){Ks(e,m5e)}function kQ(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function IQ(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=gN(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){CQ(u)}),s&&r.push(a)),o.isBlured=!1}),R(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function iI(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 Ul(e,t,r){Tc(e,!0),Ks(e,rf),oI(e,t,r)}function M5e(e){Tc(e,!1)}function Gt(e,t,r,n){n?M5e(e):Ul(e,t,r)}function oI(e,t,r){var n=De(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var nV=["emphasis","blur","select"],P5e={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Dr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=f2(v),s*=f2(v));var g=(i===a?-1:1)*f2((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,x=(e+r)/2+jx(f)*m-Nx(f)*y,b=(t+n)/2+Nx(f)*m+jx(f)*y,S=sV([1,0],[(h-m)/o,(d-y)/s]),T=[(h-m)/o,(d-y)/s],A=[(-1*h-m)/o,(-1*d-y)/s],M=sV(T,A);if(lI(T,A)<=-1&&(M=Ip),lI(T,A)>=1&&(M=0),M<0){var P=Math.round(M/Ip*1e6)/1e6;M=Ip*2+P%2*Ip}c.addData(u,x,b,o,s,S,M,f,a)}var D5e=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,N5e=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function j5e(e){var t=new $o;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=$o.CMD,l=e.match(D5e);if(!l)return t;for(var u=0;uB*B+$*$&&(P=I,k=O),{cx:P,cy:k,x0:-c,y0:-f,x1:P*(i/T-1),y1:k*(i/T-1)}}function G5e(e){var t;if(ie(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 W5e(e,t){var r,n=dg(t.r,0),i=dg(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=uV(u-l),v=d>h2&&d%h2;if(v>Ca&&(d=v),!(n>Ca))e.moveTo(c,f);else if(d>h2-Ca)e.moveTo(c+n*Xf(l),f+n*$u(l)),e.arc(c,f,n,l,u,!h),i>Ca&&(e.moveTo(c+i*Xf(u),f+i*$u(u)),e.arc(c,f,i,u,l,h));else{var g=void 0,m=void 0,y=void 0,x=void 0,b=void 0,S=void 0,T=void 0,A=void 0,M=void 0,P=void 0,k=void 0,I=void 0,O=void 0,D=void 0,N=void 0,B=void 0,$=n*Xf(l),F=n*$u(l),G=i*Xf(u),z=i*$u(u),U=d>Ca;if(U){var H=t.cornerRadius;H&&(r=G5e(H),g=r[0],m=r[1],y=r[2],x=r[3]);var Y=uV(n-i)/2;if(b=so(Y,y),S=so(Y,x),T=so(Y,g),A=so(Y,m),k=M=dg(b,S),I=P=dg(T,A),(M>Ca||P>Ca)&&(O=n*Xf(u),D=n*$u(u),N=i*Xf(l),B=i*$u(l),dCa){var ne=so(y,k),fe=so(x,k),le=Rx(N,B,$,F,n,ne,h),ee=Rx(O,D,G,z,n,fe,h);e.moveTo(c+le.cx+le.x0,f+le.cy+le.y0),k0&&e.arc(c+le.cx,f+le.cy,ne,An(le.y0,le.x0),An(le.y1,le.x1),!h),e.arc(c,f,n,An(le.cy+le.y1,le.cx+le.x1),An(ee.cy+ee.y1,ee.cx+ee.x1),!h),fe>0&&e.arc(c+ee.cx,f+ee.cy,fe,An(ee.y1,ee.x1),An(ee.y0,ee.x0),!h))}else e.moveTo(c+$,f+F),e.arc(c,f,n,l,u,!h);if(!(i>Ca)||!U)e.lineTo(c+G,f+z);else if(I>Ca){var ne=so(g,I),fe=so(m,I),le=Rx(G,z,O,D,i,-fe,h),ee=Rx($,F,N,B,i,-ne,h);e.lineTo(c+le.cx+le.x0,f+le.cy+le.y0),I0&&e.arc(c+le.cx,f+le.cy,fe,An(le.y0,le.x0),An(le.y1,le.x1),!h),e.arc(c,f,i,An(le.cy+le.y1,le.cx+le.x1),An(ee.cy+ee.y1,ee.cx+ee.x1),h),ne>0&&e.arc(c+ee.cx,f+ee.cy,ne,An(ee.y1,ee.x1),An(ee.y0,ee.x0),!h))}else e.lineTo(c+G,f+z),e.arc(c,f,i,u,l,h)}e.closePath()}}}var H5e=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}(),bn=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new H5e},t.prototype.buildPath=function(r,n){W5e(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(rt);bn.prototype.type="sector";var U5e=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),Ov=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new U5e},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}(rt);Ov.prototype.type="ring";function Z5e(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=Z5e(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;sVu[1]){if(a=!1,Jr.negativeSize||n)return a;var l=Bx(Vu[0]-Fu[1]),u=Bx(Fu[0]-Vu[1]);d2(l,u)>$x.len()&&(l=u||!Jr.bidirectional)&&(Ie.scale(zx,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){TN("update",e,t,r,n,i,a)}function Nt(e,t,r,n,i,a){TN("enter",e,t,r,n,i,a)}function od(e){if(!e.__zr)return!0;for(var t=0;tbo(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function hV(e){return!e.isGroup}function aBe(e){return e.shape!=null}function c0(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){hV(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return aBe(o)&&(s.shape=Ce(o.shape)),s}var a=n(e);t.traverse(function(o){if(hV(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 MN(e,t){return se(e,function(r){var n=r[0];n=gr(n,t.x),n=Ii(n,t.x+t.width);var i=r[1];return i=gr(i,t.y),i=Ii(i,t.y+t.height),[n,i]})}function UQ(e,t){var r=gr(e.x,t.x),n=Ii(e.x+e.width,t.x+t.width),i=gr(e.y,t.y),a=Ii(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 Nv(e,t,r){var n=re({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 Xr(n)):Yd(e.replace("path://",""),n,r,"center")}function vg(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var m=v2(d,v,c,f)/h;return!(m<0||m>1)}function v2(e,t,r,n){return e*n-r*t}function oBe(e){return e<=1e-6&&e>=-1e-6}function nf(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]=gr(0,Ht[0]),Ht[1]=gr(0,Ht[1]),Ht[2]=gr(0,Ht[2]),Ht[3]=gr(0,Ht[3])),r&&(Ht[0]=-Ht[0],Ht[1]=-Ht[1],Ht[2]=-Ht[2],Ht[3]=-Ht[3]),dV(e,Ht,"x","width",3,1,i&&i[0]||0),dV(e,Ht,"y","height",0,2,i&&i[1]||0)),e}var Ht=[0,0,0,0];function dV(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=gr(0,Ii(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:bo(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=ve(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&&R(it(l),function(c){ye(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 cI(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function mu(e,t){if(e)if(ie(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function MT(e,t,r){XQ(e,t,r,-1/0)}function XQ(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 yu(e,t){return We(We({},e,!0),t,!0)}const yBe={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:". "}}}},xBe={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 cw="ZH",IN="EN",sd=IN,nb={},ON={},tJ=nt.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||sd).toUpperCase();return e.indexOf(cw)>-1?cw:sd}():sd;function EN(e,t){e=e.toUpperCase(),ON[e]=new tt(t),nb[e]=t}function _Be(e){if(ve(e)){var t=nb[e.toUpperCase()]||{};return e===cw||e===IN?Ce(t):We(Ce(t),Ce(nb[sd]),!1)}else return We(Ce(e),Ce(nb[sd]),!1)}function hI(e){return ON[e]}function bBe(){return ON[sd]}EN(IN,yBe);EN(cw,xBe);var dI=null;function wBe(e){dI||(dI=e)}function Sr(){return dI}var DN=1e3,NN=DN*60,Zg=NN*60,ta=Zg*24,yV=ta*365,SBe={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})/},ib={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},TBe="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",Vx="{yyyy}-{MM}-{dd}",xV={year:"{yyyy}",month:"{yyyy}-{MM}",day:Vx,hour:Vx+" "+ib.hour,minute:Vx+" "+ib.minute,second:Vx+" "+ib.second,millisecond:TBe},_i=["year","month","day","hour","minute","second","millisecond"],ABe=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function CBe(e){return!ve(e)&&!Ae(e)?MBe(e):e}function MBe(e){e=e||{};var t={},r=!0;return R(_i,function(n){r&&(r=e[n]==null)}),R(_i,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=_i[s],u=Le(a)&&!ie(a)?a[l]:a,c=void 0;ie(u)?(c=u.slice(),o=c[0]||""):ve(u)?(o=u,c=[o]):(o==null?o=ib[n]:SBe[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function Fn(e,t){return e+="","0000".substr(0,t-e.length)+e}function Yg(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 PBe(e){return e===Yg(e)}function LBe(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function f0(e,t,r,n){var i=Uo(e),a=i[rJ(r)](),o=i[jN(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[RN(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[BN(r)](),f=(c-1)%12+1,h=i[zN(r)](),d=i[$N(r)](),v=i[FN(r)](),g=c>=12?"pm":"am",m=g.toUpperCase(),y=n instanceof tt?n:hI(n||tJ)||bBe(),x=y.getModel("time"),b=x.get("month"),S=x.get("monthAbbr"),T=x.get("dayOfWeek"),A=x.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Fn(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,Fn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Fn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,A[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Fn(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Fn(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,Fn(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,Fn(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,Fn(v,3)).replace(/{S}/g,v+"")}function kBe(e,t,r,n,i){var a=null;if(ve(r))a=r;else if(Ae(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=Fh(e.value,i);a=r[c][c][0]}}return f0(new Date(e.value),a,i,n)}function Fh(e,t){var r=Uo(e),n=r[jN(t)]()+1,i=r[RN(t)](),a=r[BN(t)](),o=r[zN(t)](),s=r[$N(t)](),l=r[FN(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 fw(e,t,r){switch(t){case"year":e[nJ(r)](0);case"month":e[iJ(r)](1);case"day":e[aJ(r)](0);case"hour":e[oJ(r)](0);case"minute":e[sJ(r)](0);case"second":e[lJ(r)](0)}return e}function rJ(e){return e?"getUTCFullYear":"getFullYear"}function jN(e){return e?"getUTCMonth":"getMonth"}function RN(e){return e?"getUTCDate":"getDate"}function BN(e){return e?"getUTCHours":"getHours"}function zN(e){return e?"getUTCMinutes":"getMinutes"}function $N(e){return e?"getUTCSeconds":"getSeconds"}function FN(e){return e?"getUTCMilliseconds":"getMilliseconds"}function IBe(e){return e?"setUTCFullYear":"setFullYear"}function nJ(e){return e?"setUTCMonth":"setMonth"}function iJ(e){return e?"setUTCDate":"setDate"}function aJ(e){return e?"setUTCHours":"setHours"}function oJ(e){return e?"setUTCMinutes":"setMinutes"}function sJ(e){return e?"setUTCSeconds":"setSeconds"}function lJ(e){return e?"setUTCMilliseconds":"setMilliseconds"}function OBe(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 VN(e){if(!cN(e))return ve(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function GN(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 Bv=t0;function vI(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?Uo(e):e;if(isNaN(+l)){if(s)return"-"}else return f0(l,n,r)}if(t==="ordinal")return H1(e)?i(e):ot(e)&&a(e)?e+"":"-";var u=zo(e);return a(u)?VN(u):H1(e)?i(e):typeof e=="boolean"?e+"":"-"}var _V=["a","b","c","d","e","f","g"],m2=function(e,t){return"{"+e+(t??"")+"}"};function WN(e,t,r){ie(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 DBe(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd -yyyy`);var n=Uo(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",Fn(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Fn(a%100+"",2)).replace("dd",Fn(s,2)).replace("d",s).replace("hh",Fn(l,2)).replace("h",l).replace("mm",Fn(u,2)).replace("m",u).replace("ss",Fn(c,2)).replace("s",c).replace("SSS",Fn(f,3)),e}function NBe(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function of(e,t){return t=t||"transparent",ve(e)?e:Le(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function hw(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var ab={},y2={},zv=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(ab),this._normalMasterList=n(y2);function n(i,a){var o=[];return R(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){R(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"){ab[t]=r;return}y2[t]=r},e.get=function(t){return y2[t]||ab[t]},e}();function jBe(e){return!!ab[e]}var pI={coord:1,coord2:2};function RBe(e){cJ.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var cJ=_e();function BBe(e){var t=e.getShallow("coord",!0),r=pI.coord;if(t==null){var n=cJ.get(e.type);n&&n.getCoord2&&(r=pI.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var mo={none:0,dataCoordSys:1,boxCoordSys:2};function fJ(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=mo.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=mo.dataCoordSys,a||(i=mo.none)):n==="box"&&(i=mo.boxCoordSys,!a&&!jBe(r)&&(i=mo.none))}return{coordSysType:r,kind:i}}function h0(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=fJ(t),o=a.kind,s=a.coordSysType;if(i&&o!==mo.dataCoordSys&&(o=mo.dataCoordSys,s=r),o===mo.none||s!==r)return!1;var l=n(r,t);return l?(o===mo.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var hJ=function(e,t){var r=t.getReferringComponents(e,tr).models[0];return r&&r.coordinateSystem},ob=R,dJ=["left","right","top","bottom","width","height"],Ac=[["width","left","right"],["height","top","bottom"]];function HN(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 Rc=HN;Be(HN,"vertical");Be(HN,"horizontal");function vJ(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===pg.point)a=r.refPoint,i=zt(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=ie(o)?o:[o,o];i=zt(n,r.refContainer),a=r.boxCoordFrom===pI.coord2?r.refPoint:[de(s[0],i.width)+i.x,de(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function pJ(e,t){var r=zBe(e,t),n=r.viewRect,i=r.center,a=e.get("radius");ie(a)||(a=[0,a]);var o=de(n.width,t.getWidth()),s=de(n.height,t.getHeight()),l=Math.min(o,s),u=de(a[0],l/2),c=de(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function zt(e,t,r){r=Bv(r||0);var n=t.width,i=t.height,a=de(e.left,n),o=de(e.top,i),s=de(e.right,n),l=de(e.bottom,i),u=de(e.width,n),c=de(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 gJ(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=We(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return kv(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return vJ(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}(tt);hQ(Qe,tt);yT(Qe);gBe(Qe);mBe(Qe,VBe);function VBe(e){var t=[];return R(Qe.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=se(t,function(r){return wo(r).main}),e!=="dataset"&&Ve(t,"dataset")<=0&&t.unshift("dataset"),t}var K={color:{},darkColor:{},size:{}},hr=K.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)"};re(hr,{primary:hr.neutral80,secondary:hr.neutral70,tertiary:hr.neutral60,quaternary:hr.neutral50,disabled:hr.neutral20,border:hr.neutral30,borderTint:hr.neutral20,borderShade:hr.neutral40,background:hr.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:hr.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:hr.neutral70,axisLineTint:hr.neutral40,axisTick:hr.neutral70,axisTickMinor:hr.neutral60,axisLabel:hr.neutral70,axisSplitLine:hr.neutral15,axisMinorSplitLine:hr.neutral05});for(var Gu in hr)if(hr.hasOwnProperty(Gu)){var bV=hr[Gu];Gu==="theme"?K.darkColor.theme=hr.theme.slice():Gu==="highlight"?K.darkColor.highlight="rgba(255,231,130,0.4)":Gu.indexOf("accent")===0?K.darkColor[Gu]=As(bV,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):K.darkColor[Gu]=As(bV,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}K.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var yJ="";typeof navigator<"u"&&(yJ=navigator.platform||"");var qf="rgba(0, 0, 0, 0.2)",xJ=K.color.theme[0],GBe=As(xJ,null,null,.9);const WBe={darkMode:"auto",colorBy:"series",color:K.color.theme,gradientColor:[GBe,xJ],aria:{decal:{decals:[{color:qf,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:qf,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:qf,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:qf,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:qf,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:qf,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:yJ.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 _J=_e(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Ni="original",sn="arrayRows",ji="objectRows",qa="keyedColumns",Yl="typedArray",bJ="unknown",Wa="column",Sf="row",hn={Must:1,Might:2,Not:3},wJ=Je();function HBe(e){wJ(e).datasetMap=_e()}function SJ(e,t,r){var n={},i=ZN(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=wJ(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,f;e=e.slice(),R(e,function(g,m){var y=Le(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});R(e,function(g,m){var y=g.name,x=v(g);if(c==null){var b=h.valueWayDim;d(n[y],b,x),d(o,b,x),h.valueWayDim+=x}else if(c===m)d(n[y],0,x),d(a,0,x);else{var b=h.categoryWayDim;d(n[y],b,x),d(o,b,x),h.categoryWayDim+=x}});function d(g,m,y){for(var x=0;xt)return e[n];return e[r-1]}function CJ(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:qBe(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 KBe(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var Gx,Op,SV,TV="\0_ec_inner",QBe=1,XN=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 tt(a),this._locale=new tt(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=MV(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,MV(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"?SV(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&&R(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;HBe(this),R(r,function(f,h){f!=null&&(Qe.hasClass(h)?h&&(s.push(h),l.set(h,!0)):i[h]=i[h]==null?Ce(f):We(i[h],f,!0))}),u&&u.each(function(f,h){Qe.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Qe.topologicalTravel(s,Qe.getAllClassMainTypes(),c,this);function c(f){var h=YBe(this,f,Pt(r[f])),d=a.get(f),v=d?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",g=sQ(d,h,v);dRe(g,f,Qe),i[f]=null,a.set(f,null),o.set(f,0);var m=[],y=[],x=0,b;R(g,function(S,T){var A=S.existing,M=S.newOption;if(!M)A&&(A.mergeOption({},this),A.optionUpdated({},!1));else{var P=f==="series",k=Qe.getClass(f,S.keyInfo.subType,!P);if(!k)return;if(f==="tooltip"){if(b)return;b=!0}if(A&&A.constructor===k)A.name=S.keyInfo.name,A.mergeOption(M,this),A.optionUpdated(M,!1);else{var I=re({componentIndex:T},S.keyInfo);A=new k(M,this,this,I),re(A,I),S.brandNew&&(A.__requireNewView=!0),A.init(M,this,this),A.optionUpdated(null,!0)}}A?(m.push(A.option),y.push(A),x++):(m.push(void 0),y.push(void 0))},this),i[f]=m,a.set(f,y),o.set(f,x),f==="series"&&Gx(this)}this._seriesIndices||Gx(this)},t.prototype.getOption=function(){var r=Ce(this.option);return R(r,function(n,i){if(Qe.hasClass(i)){for(var a=Pt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!hy(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[TV],r},t.prototype.setTheme=function(r){this._theme=new tt(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 s3e(e,t){return e.join(",")===t.join(",")}var Aa=R,yy=Le,PV=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function x2(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=PV.length;r0?r[o-1].seriesModel:null)}),g3e(r)}})}function g3e(e){R(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 x=y.data.getByRawIndex(y.stackResultDimension,v);if(l==="all"||l==="positive"&&x>0||l==="negative"&&x<0||l==="samesign"&&h>=0&&x>0||l==="samesign"&&h<=0&&x<0){h=eRe(h,x),g=x;break}}}return n[0]=h,n[1]=g,n})})}var kT=function(){function e(t){this.data=t.data||(t.sourceFormat===qa?{}:[]),this.sourceFormat=t.sourceFormat||bJ,this.seriesLayoutBy=t.seriesLayoutBy||Wa,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};NV=(t={},t[sn+"_"+Wa]={pure:!0,appendData:a},t[sn+"_"+Sf]={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;R(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[Yl]={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 qd(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function zV(e){var t,r;return Le(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function Xg(e){return new T3e(e)}var T3e=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(x){return!(x>=1)&&(x=1),x}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}},C3e=function(){function e(t,r){if(!ot(r)){var n="";mt(n)}this._opFn=RJ[t],this._rvalFloat=zo(r)}return e.prototype.evaluate=function(t){return ot(t)?this._opFn(t,this._rvalFloat):this._opFn(zo(t),this._rvalFloat)},e}(),BJ=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:zo(t),i=ot(r)?r:zo(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=ve(t),l=ve(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),M3e=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=zo(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=zo(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function P3e(e,t){return e==="eq"||e==="ne"?new M3e(e==="eq",t):ye(RJ,e)?new C3e(e,t):null}var L3e=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 Xl(t,r)},e}();function k3e(e,t){var r=new L3e,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==Wa&&mt(o);var s=[],l={},u=e.dimensionsDefine;if(u)R(u,function(g,m){var y=g.name,x={index:m,name:y,displayName:g.displayName};if(s.push(x),y!=null){var b="";ye(l,y)&&mt(b),l[y]=x}});else for(var c=0;c65535?B3e:z3e}function Qf(){return[1/0,-1/0]}function $3e(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function VV(e,t,r,n,i){var a=FJ[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(x){return x.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&&x<=h||isNaN(x))&&(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&&x<=h||isNaN(x))&&(A>=S&&A<=T||isNaN(A))&&(l[u++]=g),g++}v=!0}}if(!v)if(a===1)for(var y=0;y=f&&x<=h||isNaN(x))&&(l[u++]=M)}else for(var y=0;yt[I][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(Kf(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var v=1;vc&&(c=f,h=S)}O>0&&Os&&(g=s-c);for(var m=0;mv&&(v=x,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++]=x}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 Xl(r[a],this._dimensions[a])}w2={arrayRows:t,objectRows:function(r,n,i,a){return Xl(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return Xl(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),VJ=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(Hx(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=Zn(s)?Yl: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?[yI(s,{seriesLayoutBy:d,sourceHeader:v,dimensions:g},l)]:[]}else{var y=t;if(n){var x=this._applyTransform(r);i=x.sourceList,a=x.upstreamSignList}else{var b=y.get("source",!0);i=[yI(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&&WV(a)}var o,s=[],l=[];return R(t,function(u){u.prepareSource();var c=u.getSource(i||0),f="";i!=null&&!c&&WV(f),s.push(c),l.push(u._getVersionSign())}),n?o=j3e(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[m3e(s[0])]),{sourceList:o,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),r=0;r=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var zRe=ha(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function $Re(e){return BRe(e)?!!zRe[e]:!0}function gQ(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,f=Oo(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 DF(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(NF,Ud(r,o,i),Nc(n,s,a),o,s),Oe.intersect(t,NF,null,jF);var l=jF.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=Ud(l.x,l.width,i,!0),e.baseY=Nc(l.y,l.height,a,!0)}}var NF=new Oe(0,0,0,0),jF={outIntersectRect:{},clamp:!0};function pN(e){return e!=null?e+="":e=""}function FRe(e){var t=pN(e.text),r=e.font,n=Eo(Oo(r),t),i=o0(r);return Jk(e,n,i,null)}function Jk(e,t,r,n){var i=new Oe(Ud(e.x||0,t,e.textAlign),Nc(e.y||0,r,e.textBaseline),t,r),a=n??(mQ(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function mQ(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var eI="__zr_style_"+Math.round(Math.random()*10),jc={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},bT={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};jc[eI]=!0;var RF=["z","z2","invisible"],VRe=["invisible"],va=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(Ex[0]=i2(i)*r+e,Ex[1]=n2(i)*n+t,Dx[0]=i2(a)*r+e,Dx[1]=n2(a)*n+t,u(s,Ex,Dx),c(l,Ex,Dx),i=i%Nu,i<0&&(i=i+Nu),a=a%Nu,a<0&&(a=a+Nu),i>a&&!o?a+=Nu:ii&&(Nx[0]=i2(d)*r+e,Nx[1]=n2(d)*n+t,u(s,Nx,s),c(l,Nx,l))}var It={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},ju=[],Ru=[],no=[],rl=[],io=[],ao=[],a2=Math.min,o2=Math.max,Bu=Math.cos,zu=Math.sin,es=Math.abs,tI=Math.PI,dl=tI*2,s2=typeof Float32Array<"u",kp=[];function l2(e){var t=Math.round(e/tI*1e8)/1e8;return t%2*tI}function ST(e,t){var r=l2(e[0]);r<0&&(r+=dl);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=dl?i=r+dl:t&&r-i>=dl?i=r-dl:!t&&r>i?i=r+(dl-l2(r-i)):t&&r0&&(this._ux=es(n/rw/t)||0,this._uy=es(n/rw/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=es(t-this._xi),i=es(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(),kp[0]=i,kp[1]=a,ST(kp,o),i=kp[0],a=kp[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=Bu(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)&&s2&&(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(){no[0]=no[1]=io[0]=io[1]=Number.MAX_VALUE,rl[0]=rl[1]=ao[0]=ao[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||es(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++],A=t[h++],M=t[h++];g=rje(a,o,S,T,m,y,A,M,10),a=A,o=M;break}case It.Q:{var S=t[h++],T=t[h++],m=t[h++],y=t[h++];g=ije(a,o,S,T,m,y,10),a=m,o=y;break}case It.A:var P=t[h++],k=t[h++],I=t[h++],O=t[h++],D=t[h++],N=t[h++],B=N+D;h+=1,v&&(s=Bu(D)*I+P,l=zu(D)*O+k),g=o2(I,O)*a2(dl,Math.abs(N)),a=Bu(B)*I+P,o=zu(B)*O+k;break;case It.R:{s=a=t[h++],l=o=t[h++];var $=t[h++],F=t[h++];g=$*2+F*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 A=0;A0&&(t.lineTo(S,T),b=0),M){case It.M:s=u=n[A++],l=c=n[A++],t.moveTo(u,c);break;case It.L:{f=n[A++],h=n[A++];var k=es(f-u),I=es(h-c);if(k>i||I>a){if(d){var O=v[y++];if(m+O>_){var D=(_-m)/O;t.lineTo(u*(1-D)+f*D,c*(1-D)+h*D);break e}m+=O}t.lineTo(f,h),u=f,c=h,b=0}else{var N=k*k+I*I;N>b&&(S=f,T=h,b=N)}break}case It.C:{var B=n[A++],$=n[A++],F=n[A++],G=n[A++],z=n[A++],U=n[A++];if(d){var O=v[y++];if(m+O>_){var D=(_-m)/O;ru(u,B,F,z,D,ju),ru(c,$,G,U,D,Ru),t.bezierCurveTo(ju[1],Ru[1],ju[2],Ru[2],ju[3],Ru[3]);break e}m+=O}t.bezierCurveTo(B,$,F,G,z,U),u=z,c=U;break}case It.Q:{var B=n[A++],$=n[A++],F=n[A++],G=n[A++];if(d){var O=v[y++];if(m+O>_){var D=(_-m)/O;ly(u,B,F,D,ju),ly(c,$,G,D,Ru),t.quadraticCurveTo(ju[1],Ru[1],ju[2],Ru[2]);break e}m+=O}t.quadraticCurveTo(B,$,F,G),u=F,c=G;break}case It.A:var H=n[A++],Y=n[A++],Z=n[A++],J=n[A++],ae=n[A++],ce=n[A++],ge=n[A++],We=!n[A++],xe=Z>J?Z:J,ne=es(Z-J)>.001,fe=ae+ce,le=!1;if(d){var O=v[y++];m+O>_&&(fe=ae+ce*(_-m)/O,le=!0),m+=O}if(ne&&t.ellipse?t.ellipse(H,Y,Z,J,ge,ae,fe,We):t.arc(H,Y,xe,ae,fe,We),le)break e;P&&(s=Bu(ae)*Z+H,l=zu(ae)*J+Y),u=Bu(fe)*Z+H,c=zu(fe)*J+Y;break;case It.R:s=u=n[A],l=c=n[A+1],f=n[A++],h=n[A++];var ee=n[A++],$e=n[A++];if(d){var O=v[y++];if(m+O>_){var Se=_-m;t.moveTo(f,h),t.lineTo(f+a2(Se,ee),h),Se-=ee,Se>0&&t.lineTo(f+ee,h+a2(Se,$e)),Se-=$e,Se>0&&t.lineTo(f+o2(ee-Se,0),h+$e),Se-=ee,Se>0&&t.lineTo(f,h+o2($e-Se,0));break e}m+=O}t.rect(f,h,ee,$e);break;case It.Z:if(d){var O=v[y++];if(m+O>_){var D=(_-m)/O;t.lineTo(u*(1-D)+s*D,c*(1-D)+l*D);break e}m+=O}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 yl(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+=Ip);var h=Math.atan2(l,s);return h<0&&(h+=Ip),h>=n&&h<=i||h+Ip>=n&&h+Ip<=i}function ls(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var nl=$o.CMD,$u=Math.PI*2,XRe=1e-4;function qRe(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&KRe(),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=rn(t,n,a,u),h=0;hr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);$n[0]=-l,$n[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=$u-1e-4){n=0,i=$u;var c=a?1:-1;return o>=$n[0]+e&&o<=$n[1]+e?c:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=$u,i+=$u);for(var h=0,d=0;d<2;d++){var v=$n[d];if(v+e>o){var g=Math.atan2(s,v),c=a?1:-1;g<0&&(g=$u+g),(g>=n&&g<=i||g+$u>=n&&g+$u<=i)&&(g>Math.PI/2&&g1&&(r||(s+=ls(l,u,c,f,n,i))),m&&(l=a[v],u=a[v+1],c=l,f=u),g){case nl.M:c=a[v++],f=a[v++],l=c,u=f;break;case nl.L:if(r){if(yl(l,u,a[v],a[v+1],t,n,i))return!0}else s+=ls(l,u,a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case nl.C:if(r){if(ZRe(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=QRe(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 nl.Q:if(r){if(yQ(l,u,a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=JRe(l,u,a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case nl.A:var y=a[v++],_=a[v++],b=a[v++],S=a[v++],T=a[v++],A=a[v++];v+=1;var M=!!(1-a[v++]);h=Math.cos(T)*b+y,d=Math.sin(T)*S+_,m?(c=h,f=d):s+=ls(l,u,h,d,n,i);var P=(n-y)*S/b+y;if(r){if(YRe(y,_,S,T,T+A,M,t,P,i))return!0}else s+=e5e(y,_,S,T,T+A,M,P,i);l=Math.cos(T+A)*b+y,u=Math.sin(T+A)*S+_;break;case nl.R:c=l=a[v++],f=u=a[v++];var k=a[v++],I=a[v++];if(h=c+k,d=f+I,r){if(yl(c,f,h,f,t,n,i)||yl(h,f,h,d,t,n,i)||yl(h,d,c,d,t,n,i)||yl(c,d,c,f,t,n,i))return!0}else s+=ls(h,f,h,d,n,i),s+=ls(c,d,c,f,n,i);break;case nl.Z:if(r){if(yl(l,u,c,f,t,n,i))return!0}else s+=ls(l,u,c,f,n,i);l=c,u=f;break}}return!r&&!qRe(u,f)&&(s+=ls(l,u,c,f,n,i)||0),s!==0}function t5e(e,t,r){return xQ(e,0,!1,t,r)}function r5e(e,t,r,n){return xQ(e,t,!0,r,n)}var ow=Pe({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},jc),n5e={style:Pe({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},bT.style)},u2=Bo.concat(["invisible","culling","z","z2","zlevel","parent"]),rt=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?Hk:n>.2?Nje:Uk}else if(r)return Uk}return Hk},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(ve(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=fy(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&xh)&&(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)),r5e(s,l/u,r,n)))return!0}if(this.hasFill())return t5e(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=xh,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:re(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&xh)},t.prototype.createStyle=function(r){return n0(ow,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=re({},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=re({},i.shape),re(u,n.shape)):(u=re({},a?this.shape:i.shape),re(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=re({},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 $h=Math.round;function TT(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&&($h(n*2)===$h(i*2)&&(e.x1=e.x2=Li(n,s,!0)),$h(a*2)===$h(o*2)&&(e.y1=e.y2=Li(a,s,!0))),e}}function _Q(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=Li(n,s,!0),e.y=Li(i,s,!0),e.width=Math.max(Li(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Li(i+o,s,!1)-e.y,o===0?0:1)),e}}function Li(e,t,r){if(!t)return e;var n=$h(e*2);return(n+$h(t))%2===0?n/2:(n+(r?1:-1))/2}var u5e=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),c5e={},Xe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new u5e},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=_Q(c5e,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?l5e(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(rt);Xe.prototype.type="rect";var VF={fill:"#000"},GF=2,oo={},f5e={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},bT.style)},at=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=VF,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&&(B=A[N],B.align==="right");)this._placeToken(B,r,P,y,D,"right",b),k-=B.width,D-=B.width,N--;for(O+=(c-(O-m)-(_-D)-k)/2;I<=N;)B=A[I],this._placeToken(B,r,P,y,O+B.width/2,"center",b),O+=B.width,I++;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&&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=XF(o,s,v),f-=r.height/2-v[0]-r.innerHeight/2);var g=this._getOrCreateChild(Yd),m=g.createStyle();g.useStyle(m);var y=this._defaultStyle,_=!1,b=0,S=!1,T=YF("fill"in u?u.fill:"fill"in n?n.fill:(_=!0,y.fill)),A=ZF("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!y.autoStroke||_)?(b=GF,S=!0,y.stroke):null),M=u.textShadowBlur>0||n.textShadowBlur>0;m.text=r.text,m.x=o,m.y=f,M&&(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||Bs,m.opacity=fi(u.opacity,n.opacity,1),HF(m,u),A&&(m.lineWidth=fi(u.lineWidth,n.lineWidth,b),m.lineDash=be(u.lineDash,n.lineDash),m.lineDashOffset=n.lineDashOffset||0,m.stroke=A),T&&(m.fill=T),g.setBoundingRect(Jk(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(Xr),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=fi(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return wQ(r)&&(n=[r.fontStyle,r.fontWeight,bQ(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Ci(n)||r.textFont||r.font},t}(va),h5e={left:!0,right:1,center:1},d5e={top:1,bottom:1,middle:1},WF=["fontStyle","fontWeight","fontSize","fontFamily"];function bQ(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?XD+"px":e+"px"}function HF(e,t){for(var r=0;r=0,a=!1;if(e instanceof rt){var o=SQ(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(Yf(s)||Yf(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=re({},n),u=re({},u),u.fill=s):!Yf(u.fill)&&Yf(s)?(a=!0,n=re({},n),u=re({},u),u.fill=ew(s)):!Yf(u.stroke)&&Yf(l)&&(a||(n=re({},n),u=re({},u)),u.stroke=ew(l)),n.style=u}}if(n&&n.z2==null){a||(n=re({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??Ov)}return n}function _5e(e,t,r){if(r&&r.z2==null){r=re({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??p5e)}return r}function b5e(e,t,r){var n=Ge(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:y5e(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=re({},r),o=re({opacity:n?i:a.opacity*.1},o),r.style=o),r}function f2(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return x5e(this,e,t,r);if(e==="blur")return b5e(this,e,r);if(e==="select")return _5e(this,e,r)}return r}function nf(e){e.stateProxy=f2;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=f2),r&&(r.stateProxy=f2)}function eV(e,t){!kQ(e,t)&&!e.__highByOuter&&Ks(e,TQ)}function tV(e,t){!kQ(e,t)&&!e.__highByOuter&&Ks(e,AQ)}function $s(e,t){e.__highByOuter|=1<<(t||0),Ks(e,TQ)}function Fs(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Ks(e,AQ)}function MQ(e){Ks(e,xN)}function _N(e){Ks(e,CQ)}function PQ(e){Ks(e,g5e)}function LQ(e){Ks(e,m5e)}function kQ(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function IQ(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=gN(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){CQ(u)}),s&&r.push(a)),o.isBlured=!1}),R(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function iI(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 Zl(e,t,r){Ac(e,!0),Ks(e,nf),oI(e,t,r)}function M5e(e){Ac(e,!1)}function Wt(e,t,r,n){n?M5e(e):Zl(e,t,r)}function oI(e,t,r){var n=De(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var nV=["emphasis","blur","select"],P5e={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Dr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=h2(v),s*=h2(v));var g=(i===a?-1:1)*h2((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+Rx(f)*m-jx(f)*y,b=(t+n)/2+jx(f)*m+Rx(f)*y,S=sV([1,0],[(h-m)/o,(d-y)/s]),T=[(h-m)/o,(d-y)/s],A=[(-1*h-m)/o,(-1*d-y)/s],M=sV(T,A);if(lI(T,A)<=-1&&(M=Op),lI(T,A)>=1&&(M=0),M<0){var P=Math.round(M/Op*1e6)/1e6;M=Op*2+P%2*Op}c.addData(u,_,b,o,s,S,M,f,a)}var D5e=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,N5e=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function j5e(e){var t=new $o;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=$o.CMD,l=e.match(D5e);if(!l)return t;for(var u=0;uB*B+$*$&&(P=I,k=O),{cx:P,cy:k,x0:-c,y0:-f,x1:P*(i/T-1),y1:k*(i/T-1)}}function G5e(e){var t;if(ie(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 W5e(e,t){var r,n=vg(t.r,0),i=vg(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=uV(u-l),v=d>d2&&d%d2;if(v>Ca&&(d=v),!(n>Ca))e.moveTo(c,f);else if(d>d2-Ca)e.moveTo(c+n*qf(l),f+n*Fu(l)),e.arc(c,f,n,l,u,!h),i>Ca&&(e.moveTo(c+i*qf(u),f+i*Fu(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,A=void 0,M=void 0,P=void 0,k=void 0,I=void 0,O=void 0,D=void 0,N=void 0,B=void 0,$=n*qf(l),F=n*Fu(l),G=i*qf(u),z=i*Fu(u),U=d>Ca;if(U){var H=t.cornerRadius;H&&(r=G5e(H),g=r[0],m=r[1],y=r[2],_=r[3]);var Y=uV(n-i)/2;if(b=so(Y,y),S=so(Y,_),T=so(Y,g),A=so(Y,m),k=M=vg(b,S),I=P=vg(T,A),(M>Ca||P>Ca)&&(O=n*qf(u),D=n*Fu(u),N=i*qf(l),B=i*Fu(l),dCa){var ne=so(y,k),fe=so(_,k),le=Bx(N,B,$,F,n,ne,h),ee=Bx(O,D,G,z,n,fe,h);e.moveTo(c+le.cx+le.x0,f+le.cy+le.y0),k0&&e.arc(c+le.cx,f+le.cy,ne,An(le.y0,le.x0),An(le.y1,le.x1),!h),e.arc(c,f,n,An(le.cy+le.y1,le.cx+le.x1),An(ee.cy+ee.y1,ee.cx+ee.x1),!h),fe>0&&e.arc(c+ee.cx,f+ee.cy,fe,An(ee.y1,ee.x1),An(ee.y0,ee.x0),!h))}else e.moveTo(c+$,f+F),e.arc(c,f,n,l,u,!h);if(!(i>Ca)||!U)e.lineTo(c+G,f+z);else if(I>Ca){var ne=so(g,I),fe=so(m,I),le=Bx(G,z,O,D,i,-fe,h),ee=Bx($,F,N,B,i,-ne,h);e.lineTo(c+le.cx+le.x0,f+le.cy+le.y0),I0&&e.arc(c+le.cx,f+le.cy,fe,An(le.y0,le.x0),An(le.y1,le.x1),!h),e.arc(c,f,i,An(le.cy+le.y1,le.cx+le.x1),An(ee.cy+ee.y1,ee.cx+ee.x1),h),ne>0&&e.arc(c+ee.cx,f+ee.cy,ne,An(ee.y1,ee.x1),An(ee.y0,ee.x0),!h))}else e.lineTo(c+G,f+z),e.arc(c,f,i,u,l,h)}e.closePath()}}}var H5e=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}(),bn=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new H5e},t.prototype.buildPath=function(r,n){W5e(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(rt);bn.prototype.type="sector";var U5e=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),Ev=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new U5e},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}(rt);Ev.prototype.type="ring";function Z5e(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=Z5e(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;sGu[1]){if(a=!1,Jr.negativeSize||n)return a;var l=zx(Gu[0]-Vu[1]),u=zx(Vu[0]-Gu[1]);v2(l,u)>Fx.len()&&(l=u||!Jr.bidirectional)&&(Ie.scale($x,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){TN("update",e,t,r,n,i,a)}function Nt(e,t,r,n,i,a){TN("enter",e,t,r,n,i,a)}function sd(e){if(!e.__zr)return!0;for(var t=0;tbo(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function hV(e){return!e.isGroup}function aBe(e){return e.shape!=null}function f0(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){hV(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return aBe(o)&&(s.shape=Ce(o.shape)),s}var a=n(e);t.traverse(function(o){if(hV(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 MN(e,t){return se(e,function(r){var n=r[0];n=gr(n,t.x),n=Ii(n,t.x+t.width);var i=r[1];return i=gr(i,t.y),i=Ii(i,t.y+t.height),[n,i]})}function UQ(e,t){var r=gr(e.x,t.x),n=Ii(e.x+e.width,t.x+t.width),i=gr(e.y,t.y),a=Ii(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 jv(e,t,r){var n=re({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 Xr(n)):Xd(e.replace("path://",""),n,r,"center")}function pg(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var m=p2(d,v,c,f)/h;return!(m<0||m>1)}function p2(e,t,r,n){return e*n-r*t}function oBe(e){return e<=1e-6&&e>=-1e-6}function af(e,t,r,n,i){return t==null||(ot(t)?Ut[0]=Ut[1]=Ut[2]=Ut[3]=t:(Ut[0]=t[0],Ut[1]=t[1],Ut[2]=t[2],Ut[3]=t[3]),n&&(Ut[0]=gr(0,Ut[0]),Ut[1]=gr(0,Ut[1]),Ut[2]=gr(0,Ut[2]),Ut[3]=gr(0,Ut[3])),r&&(Ut[0]=-Ut[0],Ut[1]=-Ut[1],Ut[2]=-Ut[2],Ut[3]=-Ut[3]),dV(e,Ut,"x","width",3,1,i&&i[0]||0),dV(e,Ut,"y","height",0,2,i&&i[1]||0)),e}var Ut=[0,0,0,0];function dV(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=gr(0,Ii(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:bo(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=ve(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&&R(it(l),function(c){ye(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 cI(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function yu(e,t){if(e)if(ie(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function PT(e,t,r){XQ(e,t,r,-1/0)}function XQ(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 xu(e,t){return He(He({},e,!0),t,!0)}const yBe={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:". "}}}},xBe={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 fw="ZH",IN="EN",ld=IN,ib={},ON={},tJ=nt.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ld).toUpperCase();return e.indexOf(fw)>-1?fw:ld}():ld;function EN(e,t){e=e.toUpperCase(),ON[e]=new tt(t),ib[e]=t}function _Be(e){if(ve(e)){var t=ib[e.toUpperCase()]||{};return e===fw||e===IN?Ce(t):He(Ce(t),Ce(ib[ld]),!1)}else return He(Ce(e),Ce(ib[ld]),!1)}function hI(e){return ON[e]}function bBe(){return ON[ld]}EN(IN,yBe);EN(fw,xBe);var dI=null;function wBe(e){dI||(dI=e)}function Sr(){return dI}var DN=1e3,NN=DN*60,Yg=NN*60,ta=Yg*24,yV=ta*365,SBe={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})/},ab={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},TBe="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",Gx="{yyyy}-{MM}-{dd}",xV={year:"{yyyy}",month:"{yyyy}-{MM}",day:Gx,hour:Gx+" "+ab.hour,minute:Gx+" "+ab.minute,second:Gx+" "+ab.second,millisecond:TBe},_i=["year","month","day","hour","minute","second","millisecond"],ABe=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function CBe(e){return!ve(e)&&!Ae(e)?MBe(e):e}function MBe(e){e=e||{};var t={},r=!0;return R(_i,function(n){r&&(r=e[n]==null)}),R(_i,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=_i[s],u=Le(a)&&!ie(a)?a[l]:a,c=void 0;ie(u)?(c=u.slice(),o=c[0]||""):ve(u)?(o=u,c=[o]):(o==null?o=ab[n]:SBe[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function Fn(e,t){return e+="","0000".substr(0,t-e.length)+e}function Xg(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 PBe(e){return e===Xg(e)}function LBe(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function h0(e,t,r,n){var i=Uo(e),a=i[rJ(r)](),o=i[jN(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[RN(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[BN(r)](),f=(c-1)%12+1,h=i[zN(r)](),d=i[$N(r)](),v=i[FN(r)](),g=c>=12?"pm":"am",m=g.toUpperCase(),y=n instanceof tt?n:hI(n||tJ)||bBe(),_=y.getModel("time"),b=_.get("month"),S=_.get("monthAbbr"),T=_.get("dayOfWeek"),A=_.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Fn(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,Fn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Fn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,A[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Fn(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Fn(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,Fn(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,Fn(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,Fn(v,3)).replace(/{S}/g,v+"")}function kBe(e,t,r,n,i){var a=null;if(ve(r))a=r;else if(Ae(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=Vh(e.value,i);a=r[c][c][0]}}return h0(new Date(e.value),a,i,n)}function Vh(e,t){var r=Uo(e),n=r[jN(t)]()+1,i=r[RN(t)](),a=r[BN(t)](),o=r[zN(t)](),s=r[$N(t)](),l=r[FN(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 hw(e,t,r){switch(t){case"year":e[nJ(r)](0);case"month":e[iJ(r)](1);case"day":e[aJ(r)](0);case"hour":e[oJ(r)](0);case"minute":e[sJ(r)](0);case"second":e[lJ(r)](0)}return e}function rJ(e){return e?"getUTCFullYear":"getFullYear"}function jN(e){return e?"getUTCMonth":"getMonth"}function RN(e){return e?"getUTCDate":"getDate"}function BN(e){return e?"getUTCHours":"getHours"}function zN(e){return e?"getUTCMinutes":"getMinutes"}function $N(e){return e?"getUTCSeconds":"getSeconds"}function FN(e){return e?"getUTCMilliseconds":"getMilliseconds"}function IBe(e){return e?"setUTCFullYear":"setFullYear"}function nJ(e){return e?"setUTCMonth":"setMonth"}function iJ(e){return e?"setUTCDate":"setDate"}function aJ(e){return e?"setUTCHours":"setHours"}function oJ(e){return e?"setUTCMinutes":"setMinutes"}function sJ(e){return e?"setUTCSeconds":"setSeconds"}function lJ(e){return e?"setUTCMilliseconds":"setMilliseconds"}function OBe(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 VN(e){if(!cN(e))return ve(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function GN(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=r0;function vI(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?Uo(e):e;if(isNaN(+l)){if(s)return"-"}else return h0(l,n,r)}if(t==="ordinal")return U1(e)?i(e):ot(e)&&a(e)?e+"":"-";var u=zo(e);return a(u)?VN(u):U1(e)?i(e):typeof e=="boolean"?e+"":"-"}var _V=["a","b","c","d","e","f","g"],y2=function(e,t){return"{"+e+(t??"")+"}"};function WN(e,t,r){ie(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 DBe(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd +yyyy`);var n=Uo(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",Fn(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Fn(a%100+"",2)).replace("dd",Fn(s,2)).replace("d",s).replace("hh",Fn(l,2)).replace("h",l).replace("mm",Fn(u,2)).replace("m",u).replace("ss",Fn(c,2)).replace("s",c).replace("SSS",Fn(f,3)),e}function NBe(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function sf(e,t){return t=t||"transparent",ve(e)?e:Le(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function dw(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var ob={},x2={},$v=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(ob),this._normalMasterList=n(x2);function n(i,a){var o=[];return R(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){R(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"){ob[t]=r;return}x2[t]=r},e.get=function(t){return x2[t]||ob[t]},e}();function jBe(e){return!!ob[e]}var pI={coord:1,coord2:2};function RBe(e){cJ.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var cJ=_e();function BBe(e){var t=e.getShallow("coord",!0),r=pI.coord;if(t==null){var n=cJ.get(e.type);n&&n.getCoord2&&(r=pI.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var mo={none:0,dataCoordSys:1,boxCoordSys:2};function fJ(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=mo.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=mo.dataCoordSys,a||(i=mo.none)):n==="box"&&(i=mo.boxCoordSys,!a&&!jBe(r)&&(i=mo.none))}return{coordSysType:r,kind:i}}function d0(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=fJ(t),o=a.kind,s=a.coordSysType;if(i&&o!==mo.dataCoordSys&&(o=mo.dataCoordSys,s=r),o===mo.none||s!==r)return!1;var l=n(r,t);return l?(o===mo.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var hJ=function(e,t){var r=t.getReferringComponents(e,tr).models[0];return r&&r.coordinateSystem},sb=R,dJ=["left","right","top","bottom","width","height"],Cc=[["width","left","right"],["height","top","bottom"]];function HN(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 Bc=HN;Be(HN,"vertical");Be(HN,"horizontal");function vJ(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===gg.point)a=r.refPoint,i=$t(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=ie(o)?o:[o,o];i=$t(n,r.refContainer),a=r.boxCoordFrom===pI.coord2?r.refPoint:[de(s[0],i.width)+i.x,de(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function pJ(e,t){var r=zBe(e,t),n=r.viewRect,i=r.center,a=e.get("radius");ie(a)||(a=[0,a]);var o=de(n.width,t.getWidth()),s=de(n.height,t.getHeight()),l=Math.min(o,s),u=de(a[0],l/2),c=de(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function $t(e,t,r){r=zv(r||0);var n=t.width,i=t.height,a=de(e.left,n),o=de(e.top,i),s=de(e.right,n),l=de(e.bottom,i),u=de(e.width,n),c=de(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 gJ(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 Iv(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return vJ(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}(tt);hQ(Qe,tt);xT(Qe);gBe(Qe);mBe(Qe,VBe);function VBe(e){var t=[];return R(Qe.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=se(t,function(r){return wo(r).main}),e!=="dataset"&&Ge(t,"dataset")<=0&&t.unshift("dataset"),t}var K={color:{},darkColor:{},size:{}},hr=K.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)"};re(hr,{primary:hr.neutral80,secondary:hr.neutral70,tertiary:hr.neutral60,quaternary:hr.neutral50,disabled:hr.neutral20,border:hr.neutral30,borderTint:hr.neutral20,borderShade:hr.neutral40,background:hr.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:hr.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:hr.neutral70,axisLineTint:hr.neutral40,axisTick:hr.neutral70,axisTickMinor:hr.neutral60,axisLabel:hr.neutral70,axisSplitLine:hr.neutral15,axisMinorSplitLine:hr.neutral05});for(var Wu in hr)if(hr.hasOwnProperty(Wu)){var bV=hr[Wu];Wu==="theme"?K.darkColor.theme=hr.theme.slice():Wu==="highlight"?K.darkColor.highlight="rgba(255,231,130,0.4)":Wu.indexOf("accent")===0?K.darkColor[Wu]=As(bV,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):K.darkColor[Wu]=As(bV,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}K.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var yJ="";typeof navigator<"u"&&(yJ=navigator.platform||"");var Kf="rgba(0, 0, 0, 0.2)",xJ=K.color.theme[0],GBe=As(xJ,null,null,.9);const WBe={darkMode:"auto",colorBy:"series",color:K.color.theme,gradientColor:[GBe,xJ],aria:{decal:{decals:[{color:Kf,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Kf,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Kf,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Kf,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Kf,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Kf,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:yJ.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 _J=_e(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Ni="original",sn="arrayRows",ji="objectRows",qa="keyedColumns",Xl="typedArray",bJ="unknown",Wa="column",Tf="row",hn={Must:1,Might:2,Not:3},wJ=Je();function HBe(e){wJ(e).datasetMap=_e()}function SJ(e,t,r){var n={},i=ZN(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=wJ(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,f;e=e.slice(),R(e,function(g,m){var y=Le(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});R(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 CJ(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:qBe(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 KBe(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var Wx,Ep,SV,TV="\0_ec_inner",QBe=1,XN=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 tt(a),this._locale=new tt(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=MV(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,MV(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"?SV(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&&R(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;HBe(this),R(r,function(f,h){f!=null&&(Qe.hasClass(h)?h&&(s.push(h),l.set(h,!0)):i[h]=i[h]==null?Ce(f):He(i[h],f,!0))}),u&&u.each(function(f,h){Qe.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Qe.topologicalTravel(s,Qe.getAllClassMainTypes(),c,this);function c(f){var h=YBe(this,f,Pt(r[f])),d=a.get(f),v=d?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",g=sQ(d,h,v);dRe(g,f,Qe),i[f]=null,a.set(f,null),o.set(f,0);var m=[],y=[],_=0,b;R(g,function(S,T){var A=S.existing,M=S.newOption;if(!M)A&&(A.mergeOption({},this),A.optionUpdated({},!1));else{var P=f==="series",k=Qe.getClass(f,S.keyInfo.subType,!P);if(!k)return;if(f==="tooltip"){if(b)return;b=!0}if(A&&A.constructor===k)A.name=S.keyInfo.name,A.mergeOption(M,this),A.optionUpdated(M,!1);else{var I=re({componentIndex:T},S.keyInfo);A=new k(M,this,this,I),re(A,I),S.brandNew&&(A.__requireNewView=!0),A.init(M,this,this),A.optionUpdated(null,!0)}}A?(m.push(A.option),y.push(A),_++):(m.push(void 0),y.push(void 0))},this),i[f]=m,a.set(f,y),o.set(f,_),f==="series"&&Wx(this)}this._seriesIndices||Wx(this)},t.prototype.getOption=function(){var r=Ce(this.option);return R(r,function(n,i){if(Qe.hasClass(i)){for(var a=Pt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!dy(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[TV],r},t.prototype.setTheme=function(r){this._theme=new tt(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 s3e(e,t){return e.join(",")===t.join(",")}var Aa=R,xy=Le,PV=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function _2(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=PV.length;r0?r[o-1].seriesModel:null)}),g3e(r)}})}function g3e(e){R(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=eRe(h,_),g=_;break}}}return n[0]=h,n[1]=g,n})})}var IT=function(){function e(t){this.data=t.data||(t.sourceFormat===qa?{}:[]),this.sourceFormat=t.sourceFormat||bJ,this.seriesLayoutBy=t.seriesLayoutBy||Wa,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};NV=(t={},t[sn+"_"+Wa]={pure:!0,appendData:a},t[sn+"_"+Tf]={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;R(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[Xl]={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 Kd(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function zV(e){var t,r;return Le(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function qg(e){return new T3e(e)}var T3e=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}},C3e=function(){function e(t,r){if(!ot(r)){var n="";mt(n)}this._opFn=RJ[t],this._rvalFloat=zo(r)}return e.prototype.evaluate=function(t){return ot(t)?this._opFn(t,this._rvalFloat):this._opFn(zo(t),this._rvalFloat)},e}(),BJ=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:zo(t),i=ot(r)?r:zo(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=ve(t),l=ve(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),M3e=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=zo(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=zo(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function P3e(e,t){return e==="eq"||e==="ne"?new M3e(e==="eq",t):ye(RJ,e)?new C3e(e,t):null}var L3e=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 ql(t,r)},e}();function k3e(e,t){var r=new L3e,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==Wa&&mt(o);var s=[],l={},u=e.dimensionsDefine;if(u)R(u,function(g,m){var y=g.name,_={index:m,name:y,displayName:g.displayName};if(s.push(_),y!=null){var b="";ye(l,y)&&mt(b),l[y]=_}});else for(var c=0;c65535?B3e:z3e}function Jf(){return[1/0,-1/0]}function $3e(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function VV(e,t,r,n,i){var a=FJ[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(_))&&(A>=S&&A<=T||isNaN(A))&&(l[u++]=g),g++}v=!0}}if(!v)if(a===1)for(var y=0;y=f&&_<=h||isNaN(_))&&(l[u++]=M)}else for(var y=0;yt[I][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(Qf(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var v=1;vc&&(c=f,h=S)}O>0&&Os&&(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 ql(r[a],this._dimensions[a])}S2={arrayRows:t,objectRows:function(r,n,i,a){return ql(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return ql(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),VJ=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(Ux(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=Zn(s)?Xl: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?[yI(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=[yI(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&&WV(a)}var o,s=[],l=[];return R(t,function(u){u.prepareSource();var c=u.getSource(i||0),f="";i!=null&&!c&&WV(f),s.push(c),l.push(u._getVersionSign())}),n?o=j3e(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[m3e(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 R(e.blocks,function(i){var a=UJ(i);a>=t&&(t=a+ +(n&&(!a||_I(i)&&!i.noHeader)))}),t}return 0}function W3e(e,t,r,n){var i=t.noHeader,a=U3e(UJ(t)),o=[],s=t.blocks||[];_n(!s||ie(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(ye(u,l)){var c=new BJ(u[l],null);s.sort(function(g,m){return c.evaluate(g.sortParam,m.sortParam)})}else l==="seriesDesc"&&s.reverse()}R(s,function(g,m){var y=t.valueFormatter,x=HJ(g)(y?re(re({},e),{valueFormatter:y}):e,g,m>0?a.html:0,n);x!=null&&o.push(x)});var f=e.renderMode==="richText"?o.join(a.richText):bI(n,o.join(""),i?r:a.html);if(i)return f;var h=vI(t.header,"ordinal",e.useUTC),d=WJ(n,e.renderMode).nameStyle,v=GJ(n);return e.renderMode==="richText"?ZJ(e,h,d)+a.richText+f:bI(n,'
'+On(h)+"
"+f,r)}function H3e(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=ie(S)?S:[S],se(S,function(T,A){return vI(T,ie(d)?d[A]:d,u)})};if(!(a&&o)){var f=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||K.color.secondary,i),h=a?"":vI(l,"ordinal",u),d=t.valueType,v=o?[]:c(t.value,t.dataIndex),g=!s||!a,m=!s&&a,y=WJ(n,i),x=y.nameStyle,b=y.valueStyle;return i==="richText"?(s?"":f)+(a?"":ZJ(e,h,x))+(o?"":X3e(e,v,g,m,b)):bI(n,(s?"":f)+(a?"":Z3e(h,!s,x))+(o?"":Y3e(v,g,m,b)),r)}}function HV(e,t,r,n,i,a){if(e){var o=HJ(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function U3e(e){return{html:V3e[e],richText:G3e[e]}}function bI(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=GJ(e);return'
'+t+n+"
"}function Z3e(e,t,r){var n=t?"margin-left:2px":"";return''+On(e)+""}function Y3e(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=ie(e)?e:[e],''+se(e,function(o){return On(o)}).join("  ")+""}function ZJ(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function X3e(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(ie(t)?t.join(" "):t,a)}function YJ(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return of(n)}function XJ(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var S2=function(){function e(){this.richTextStyles={},this._nextStyleNameId=rQ()}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=uJ({color:r,type:t,renderMode:n,markerId:i});return ve(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};ie(r)?R(r,function(a){return re(n,a)}):re(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function qJ(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=ie(s),u=YJ(t,r),c,f,h,d;if(o>1||l&&!o){var v=q3e(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=qd(i,r,a[0]),f=g.type}else d=c=l?s[0]:s;var m=fN(t),y=m&&t.name||"",x=i.getName(r),b=n?y:x;return Ar("section",{header:y,noHeader:n||!m,sortParam:d,blocks:[Ar("nameValue",{markerType:"item",markerColor:u,name:b,noName:!Ci(b),value:c,valueType:f,dataIndex:r})].concat(h||[])})}function q3e(e,t,r,n,i){var a=t.getData(),o=ha(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?R(n,function(f){c(qd(a,r,f),f)}):R(e,c);function c(f,h){var d=a.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?u.push(Ar("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 il=Je();function Ux(e,t){return e.getName(t)||e.getId(t)}var sb="__universalTransitionEnabled",St=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=Xg({count:Q3e,reset:J3e}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=il(this).sourceManager=new VJ(this);a.prepareSource();var o=this.getInitialData(r,i);ZV(o,this),this.dataTask.context.data=o,il(this).dataBeforeProcessed=o,UV(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=my(this),a=i?wf(r):{},o=this.subType;Qe.hasClass(o)&&(o+="Series"),We(r,n.getTheme().get(this.subType)),We(r,this.getDefaultOption()),Jc(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Fo(r,a,i)},t.prototype.mergeOption=function(r,n){r=We(this.option,r,!0),this.fillDataTextStyle(r.data);var i=my(this);i&&Fo(this.option,r,i);var a=il(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);ZV(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,il(this).dataBeforeProcessed=o,UV(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!Zn(r))for(var n=["show"],i=0;i=0&&h<0)&&(f=x,h=y,d=0),y===h&&(c[d++]=g))}),c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return qJ({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=YN.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[Ux(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[sb])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"){Le(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return Qe.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}(Qe);fr(St,IT);fr(St,YN);hQ(St,Qe);function UV(e){var t=e.name;fN(e)||(e.name=K3e(e)||t)}function K3e(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return R(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function Q3e(e){return e.model.getRawData().count()}function J3e(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),eze}function eze(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function ZV(e,t){R(Gd(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Be(tze,t))})}function tze(e,t){var r=wI(e);return r&&r.setOutputEnd((t||this).count()),t}function wI(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 Lt=function(){function e(){this.group=new Me,this.uid=Rv("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}();dN(Lt);yT(Lt);function $v(){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 KJ=Je(),rze=$v(),_t=function(){function e(){this.group=new Me,this.uid=Rv("viewChart"),this.renderTask=Xg({plan:nze,reset:ize}),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&&XV(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&XV(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){mu(this.group,t)},e.markUpdateMethod=function(t,r){KJ(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function YV(e,t,r){e&&vy(e)&&(t==="emphasis"?$s:Fs)(e,r)}function XV(e,t,r){var n=ef(e,t),i=t&&t.highlightKey!=null?k5e(t.highlightKey):null;n!=null?R(Pt(n),function(a){YV(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){YV(a,r,i)})}dN(_t);yT(_t);function nze(e){return rze(e.model)}function ize(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&KJ(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),aze[l]}var aze={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)}}},dw="\0__throttleOriginMethod",qV="\0__throttleRate",KV="\0__throttleType";function ET(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 Fv(e,t,r,n){var i=e[t];if(i){var a=i[dw]||i,o=i[KV],s=i[qV];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=ET(a,r,n==="debounce"),i[dw]=a,i[KV]=n,i[qV]=r}return i}}function xy(e,t){var r=e[t];r&&r[dw]&&(r.clear&&r.clear(),e[t]=r[dw])}var QV=Je(),JV={itemStyle:tf(eJ,!0),lineStyle:tf(JQ,!0)},oze={lineStyle:"stroke",itemStyle:"fill"};function QJ(e,t){var r=e.visualStyleMapper||JV[t];return r||(console.warn("Unknown style type '"+t+"'."),JV.itemStyle)}function JJ(e,t){var r=e.visualDrawType||oze[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var sze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=QJ(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=JJ(e,n),u=o[l],c=Ae(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"||Ae(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||Ae(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=re({},o);m[l]=c(g),d.setItemVisual(v,"style",m)}}}},Dp=new tt,lze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=QJ(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Dp.option=l[n];var u=i(Dp),c=o.ensureUniqueItemVisual(s,"style");re(c,u),Dp.option.decal&&(o.setItemVisual(s,"decal",Dp.option.decal),Dp.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},uze={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)),QV(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=QV(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=JJ(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)}})}})}},Zx=Math.PI;function cze(e,t){t=t||{},Pe(t,{text:"loading",textColor:K.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:K.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 l0({shape:{startAngle:-Zx/2,endAngle:-Zx/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:Zx*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Zx*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 eee=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;R(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";_n(!(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;R(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 x=o.getPerformArgs(m,i.block);x.skip=!l.performRawSeries&&r.isSeriesFiltered(m.context.model),o.updatePayload(m,n),m.perform(x)&&(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)||Xg({plan:pze,reset:gze,count:yze}));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||Xg({reset:fze});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="";_n(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,v):c?c(n,i).each(v):(f=!1,R(n.getSeries(),v));function v(g){var m=g.uid,y=l.set(m,s&&s.get(m)||(h=!0,Xg({reset:hze,onDirty:vze})));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 Ae(t)&&(t={overallReset:t,seriesType:xze(t)}),t.uid=Rv("stageHandler"),r&&(t.visualType=r),t},e}();function fze(e){e.overallReset(e.ecModel,e.api,e.payload)}function hze(e){return e.overallProgress&&dze}function dze(){this.agent.dirty(),this.getDownstream().dirty()}function vze(){this.agent&&this.agent.dirty()}function pze(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function gze(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 tee(n)}):mze}var mze=tee(0);function tee(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}(),SI=["symbol","symbolSize","symbolRotate","symbolOffset"],t6=SI.concat(["symbolKeepAspect"]),wze={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&&Mc(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function TI(e,t,r){for(var n=t.type==="radial"?Rze(e,t,r):jze(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:ot(e)?[e]:ie(e)?e:null}function tj(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 $ze=new $o(!0);function gw(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function r6(e){return typeof e=="string"&&e!=="none"}function mw(e){var t=e.fill;return t!=null&&t!=="none"}function n6(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 i6(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 AI(e,t,r){var n=vN(t.image,t.__image,r);if(xT(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)*Bg),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function Fze(e,t,r,n){var i,a=gw(r),o=mw(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||$ze,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,x=void 0,b=void 0,S=void 0,T=void 0,A=void 0;(v||g)&&(A=t.getBoundingRect()),v&&(x=f?TI(e,h,A):t.__canvasFillGradient,t.__canvasFillGradient=x),g&&(b=f?TI(e,d,A):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),m&&(S=f||!t.__canvasFillPattern?AI(e,h,t):t.__canvasFillPattern,t.__canvasFillPattern=S),y&&(T=f||!t.__canvasStrokePattern?AI(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),v?e.fillStyle=x:m&&(S?e.fillStyle=S:o=!1),g?e.strokeStyle=b:y&&(T?e.strokeStyle=T:a=!1)}var M=t.getGlobalScale();c.setScale(M[0],M[1],t.segmentIgnoreThreshold);var P,k;e.setLineDash&&r.lineDash&&(i=tj(t),P=i[0],k=i[1]);var I=!0;(u||f&yh)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),I=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),I&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=k),n||(r.strokeFirst?(a&&i6(e,r),o&&n6(e,r)):(o&&n6(e,r),a&&i6(e,r))),P&&e.setLineDash([])}function Vze(e,t,r){var n=t.__image=vN(r.image,t.__image,t,t.onload);if(!(!n||!xT(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 Gze(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||Bs,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=tj(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(gw(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),gw(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var a6=["shadowBlur","shadowOffsetX","shadowOffsetY"],o6=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function see(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){ai(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?Nc.opacity:o}(n||t.blend!==r.blend)&&(a||(ai(e,i),a=!0),e.globalCompositeOperation=t.blend||Nc.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(Le(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Pr]=!0,rh(this),!this._model||n){var l=new n3e(this._api),u=this._theme,c=this._model=new XN;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},LI);var f={seriesTransition:s,optionChanged:!0};if(i)this[Qr]={silent:a,updateParams:f},this[Pr]=!1,this.getZr().wakeUp();else{try{Yu(this),rs.update.call(this,null,f)}catch(h){throw this[Qr]=null,this[Pr]=!1,h}this._ssr||this._zr.flush(),this[Qr]=null,this[Pr]=!1,eh.call(this,a),th.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[Qr]&&(a==null&&(a=this[Qr].silent),o=this[Qr].updateParams,this[Qr]=null),this[Pr]=!0,rh(this);try{this._updateTheme(r),i.setTheme(this._theme),Yu(this),rs.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Pr]=!1,s}this[Pr]=!1,eh.call(this,a),th.call(this,a)}}},t.prototype._updateTheme=function(r){ve(r)&&(r=Cee[r]),r&&(r=Ce(r),r&&LJ(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 R(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;R(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 R(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(bw[i]){var l=s,u=s,c=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();R(Bc,function(b,S){if(b.group===i){var T=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(Ce(r)),A=b.getDom().getBoundingClientRect();l=a(A.left,l),u=a(A.top,u),c=o(A.right,c),f=o(A.bottom,f),h.push({dom:T,left:A.left,top:A.top})}}),l*=d,u*=d,c*=d,f*=d;var v=c-l,g=f-u,m=hi.createCanvas(),y=Zk(m,{renderer:n?"svg":"canvas"});if(y.resize({width:v,height:g}),n){var x="";return R(h,function(b){var S=b.left-l,T=b.top-u;x+=''+b.dom+""}),y.painter.getSvgRoot().innerHTML=x,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}})),R(h,function(b){var S=new Xr({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 Kx(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return Kx(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return Kx(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=ad(i,r);return R(o,function(s,l){l.indexOf("Models")>=0&&R(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=ad(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?ej(s,l,n):d0(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;R(p4e,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&Cc(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=re({},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;R(MI,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Tze(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&&uQ(this.getDom(),aj,"");var n=this,i=n._api,a=n._model;R(n._componentsViews,function(o){o.dispose(a,i)}),R(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 Bc[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[Qr]&&(a==null&&(a=this[Qr].silent),i=!0,this[Qr]=null),this[Pr]=!0,rh(this);try{i&&Yu(this),rs.update.call(this,{type:"resize",animation:re({duration:0},r&&r.animation)})}catch(o){throw this[Pr]=!1,o}this[Pr]=!1,eh.call(this,a),th.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(Le(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!kI[r]){var i=kI[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=re({},r);return n.type=CI[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(Le(n)||(n={silent:!!n}),!!xw[r.type]&&this._model){if(this[Pr]){this._pendingActions.push(r);return}var i=n.silent;L2.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&nt.browser.weChat&&this._throttledZrFlush(),eh.call(this,i),th.call(this,i)}},t.prototype.updateLabelLayout=function(){Pa.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(){Yu=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),M2(f,!0),M2(f,!1),h.plan()},M2=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,x=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(x){x.states.emphasis&&(x.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=af(f);h.eachRendered(function(v){return MT(v,d.z,d.zlevel),!0})}}function u(f,h){h.eachRendered(function(d){if(!od(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(od(y))return;if(y instanceof rt&&I5e(y),y.__dirty){var x=y.prevStates;x&&y.useStates(x)}if(v){y.stateTransition=m;var b=y.getTextContent(),S=y.getTextGuideLine();b&&(b.stateTransition=m),S&&(S.stateTransition=m)}y.__dirty&&a(y)}})}x6=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){$s(v,g),Gi(f)},d.prototype.leaveEmphasis=function(v,g){Fs(v,g),Gi(f)},d.prototype.enterBlur=function(v){MQ(v),Gi(f)},d.prototype.leaveBlur=function(v){_N(v),Gi(f)},d.prototype.enterSelect=function(v){PQ(v),Gi(f)},d.prototype.leaveSelect=function(v){LQ(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[Xx]},d}(MJ))(f)},Aee=function(f){function h(d,v){for(var g=0;g=0)){b6.push(r);var a=eee.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function fj(e,t){kI[e]=t}function A4e(e){vK({createCanvas:e})}function Oee(e,t,r){var n=dee("registerMap");n&&n(e,t,r)}function C4e(e){var t=dee("getMap");return t&&t(e)}var Eee=N3e;xu(nj,sze);xu(DT,lze);xu(DT,uze);xu(nj,wze);xu(DT,Sze);xu(yee,Kze);lj(LJ);uj(i4e,p3e);fj("default",cze);Ka({type:jc,event:jc,update:jc},lr);Ka({type:tb,event:tb,update:tb},lr);Ka({type:ow,event:yN,update:ow,action:lr,refineEvent:hj,publishNonRefinedEvent:!0});Ka({type:nI,event:yN,update:nI,action:lr,refineEvent:hj,publishNonRefinedEvent:!0});Ka({type:sw,event:yN,update:sw,action:lr,refineEvent:hj,publishNonRefinedEvent:!0});function hj(e,t,r,n){return{eventContent:{selected:C5e(r),isFromClick:t.isFromClick||!1}}}sj("default",{});sj("dark",iee);var M4e={},w6=[],P4e={registerPreprocessor:lj,registerProcessor:uj,registerPostInit:Pee,registerPostUpdate:Lee,registerUpdateLifecycle:NT,registerAction:Ka,registerCoordinateSystem:kee,registerLayout:Iee,registerVisual:xu,registerTransform:Eee,registerLoading:fj,registerMap:Oee,registerImpl:Qze,PRIORITY:xee,ComponentModel:Qe,ComponentView:Lt,SeriesModel:St,ChartView:_t,registerComponentModel:function(e){Qe.registerClass(e)},registerComponentView:function(e){Lt.registerClass(e)},registerSeriesModel:function(e){St.registerClass(e)},registerChartView:function(e){_t.registerClass(e)},registerCustomSeries:function(e,t){pee(e,t)},registerSubTypeDefaulter:function(e,t){Qe.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){XK(e,t)}};function Ze(e){if(ie(e)){R(e,function(t){Ze(t)});return}Ve(w6,e)>=0||(w6.push(e),Ae(e)&&(e={install:e}),e.install(P4e))}function jp(e){return e==null?0:e.length||1}function S6(e){return e}var Vs=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||S6,this._newKeyGetter=i||S6,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 Rp=Le,al=se,D4e=typeof Int32Array>"u"?Array:Int32Array,N4e="e\0\0",T6=-1,j4e=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],R4e=["_approximateExtent"],A6,Jx,Bp,zp,O2,$p,E2,Dn=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;Nee(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),ie(a)?a=a.slice():Rp(a)&&(a=re({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Rp(r)?re(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){Rp(t)?re(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?re(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;rI(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){R(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:al(this.dimensions,this._getDimInfo,this),this.hostModel)),O2(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Ae(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(fT(arguments)))})},e.internalField=function(){A6=function(t){var r=t._invertedIndicesMap;R(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new D4e(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function B4e(e,t){return Gv(e,t).dimensions}function Gv(e,t){qN(e)||(e=KN(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=_e(),a=[],o=$4e(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Bee(o),l=n===e.dimensionsDefine,u=l?Ree(e):jee(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var f=_e(c),h=new $J(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function $4e(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return R(t,function(a){var o;Le(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function F4e(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 V4e=function(){function e(t){this.coordSysDims=[],this.axisMap=_e(),this.categoryAxisMap=_e(),this.coordSysName=t}return e}();function G4e(e){var t=e.get("coordinateSystem"),r=new V4e(t),n=W4e[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var W4e={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",tr).models[0],a=e.getReferringComponents("yAxis",tr).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),nh(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),nh(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",tr).models[0];t.coordSysDims=["single"],r.set("single",i),nh(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",tr).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),nh(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),nh(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();R(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),nh(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",tr).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 nh(e){return e.get("type")==="category"}function zee(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;H4e(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,f,h;if(R(a,function(x,b){ve(x)&&(a[b]=x={name:x}),l&&!x.isExtraCoord&&(!n&&!u&&x.ordinalMeta&&(u=x),!c&&x.type!=="ordinal"&&x.type!=="time"&&(!i||i===x.coordDim)&&(c=x))}),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;R(a,function(x){x.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 H4e(e){return!Nee(e.schema)}function Gs(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function dj(e,t){return Gs(e,t)?e.getCalculationInfo("stackResultDimension"):t}function U4e(e,t){var r=e.get("coordinateSystem"),n=zv.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=ww(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function Z4e(e,t,r){var n,i;return r&&R(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 Yo(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=KN(e)):(i=n.getSource(),a=i.sourceFormat===Ni);var o=G4e(t),s=U4e(t,o),l=r.useEncodeDefaulter,u=Ae(l)?l:l?Be(SJ,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=Gv(i,c),h=Z4e(f.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(f),v=zee(t,{schema:f,store:d}),g=new Dn(f,t);g.setCalculationInfo(v);var m=h!=null&&Y4e(i)?function(y,x,b,S){return S===h?b:this.defaultDimValueGetter(y,x,b,S)}:null;return g.hasItemOption=!1,g.initData(a?i:d,null,m),g}function Y4e(e){if(e.sourceFormat===Ni){var t=X4e(e.data||[]);return!ie(Lv(t))}}function X4e(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=wy(o),l=a.niceTickExtent=[mr(Math.ceil(e[0]/o)*o,s),mr(Math.floor(e[1]/o)*o,s)];return K4e(l,e),a}function D2(e){var t=Math.pow(10,mT(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,mr(r*t)}function wy(e){return Ra(e)+2}function C6(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function K4e(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),C6(e,0,t),C6(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function vj(e,t){return e>=t[0]&&e<=t[1]}var Q4e=function(){function e(){this.normalize=M6,this.scale=P6}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=pe(t.normalize,t),this.scale=pe(t.scale,t)):(this.normalize=M6,this.scale=P6)},e}();function M6(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function P6(e,t){return e*(t[1]-t[0])+t[0]}function OI(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 _u=function(){function e(t){this._calculator=new Q4e,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,pe(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}();yT(_u);var J4e=0,Sy=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++J4e,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&se(n,e$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(!ve(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 e$e(e){return Le(e)&&e.value!=null?e.value:e+""}var Qd=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 Sy({})),ie(i)&&(i=new Sy({categories:se(i,function(a){return Le(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:ve(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return vj(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}(_u);_u.registerClass(Qd);var ol=mr,Ws=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 vj(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=wy(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=ol(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:ol(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 Gee(e){var t=n$e(e),r=[];return R(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=de(n.get("barWidth"),s),g=de(n.get("barMaxWidth"),s),m=de(n.get("barMinWidth")||(Yee(n)?.5:1),s),y=n.get("barGap"),x=n.get("barCategoryGap"),b=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:v,barMaxWidth:g,barMinWidth:m,barGap:y,barCategoryGap:x,defaultBarGap:b,axisKey:pj(a),stackId:Fee(n)})}),Wee(r)}function Wee(e){var t={};R(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 R(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=de(s,o),c=de(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-u)/(h+(h-1)*c);d=Math.max(d,0),R(a,function(y){var x=y.maxWidth,b=y.minWidth;if(y.width){var S=y.width;x&&(S=Math.min(S,x)),b&&(S=Math.max(S,b)),y.width=S,f-=S+c*S,h--}else{var S=d;x&&xS&&(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;R(a,function(y,x){y.width||(y.width=d),g=y,v+=y.width*(1+c)}),g&&(v-=g.width*c);var m=-v/2;R(a,function(y,x){r[i][x]=r[i][x]||{bandWidth:o,offset:m,width:y.width},m+=y.width*(1+c)})}),r}function i$e(e,t,r){if(e&&t){var n=e[pj(t)];return n}}function Hee(e,t){var r=Vee(e,t),n=Gee(r);R(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=Fee(i),u=n[pj(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function Uee(e){return{seriesType:e,plan:$v(),reset:function(t){if(Zee(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=Gs(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),d=a$e(i,a),v=Yee(t),g=t.get("barMinHeight")||0,m=c&&r.getDimensionIndex(c),y=r.getLayout("size"),x=r.getLayout("offset");return{progress:function(b,S){for(var T=b.count,A=v&&So(T*3),M=v&&l&&So(T*3),P=v&&So(T),k=n.master.getRect(),I=h?k.width:k.height,O,D=S.getStore(),N=0;(O=b.next())!=null;){var B=D.get(f?m:o,O),$=D.get(s,O),F=d,G=void 0;f&&(G=+B-D.get(o,O));var z=void 0,U=void 0,H=void 0,Y=void 0;if(h){var Z=n.dataToPoint([B,$]);if(f){var J=n.dataToPoint([G,$]);F=J[0]}z=F,U=Z[1]+x,H=Z[0]-F,Y=y,Math.abs(H)0?r:1:r))}var o$e=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=e_.length,s=Math.min(o$e(e_,this._approxInterval,0,o),o-1);this._interval=e_[s][1],this._intervalPrecision=wy(this._interval),this._minLevelUnit=e_[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return ot(r)?r:+Uo(r)},t.prototype.contain=function(r){return vj(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}(Ws),e_=[["second",DN],["minute",NN],["hour",Zg],["quarter-day",Zg*6],["half-day",Zg*12],["day",ta*1.2],["half-week",ta*3.5],["week",ta*7],["month",ta*31],["quarter",ta*95],["half-year",yV/2],["year",yV]];function Xee(e,t,r,n){return fw(new Date(t),e,n).getTime()===fw(new Date(r),e,n).getTime()}function s$e(e,t){return e/=ta,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function l$e(e){var t=30*ta;return e/=t,e>6?6:e>3?3:e>2?2:1}function u$e(e){return e/=Zg,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function L6(e,t){return e/=t?NN:DN,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function c$e(e){return uN(e,!0)}function f$e(e,t,r){var n=Math.max(0,Ve(_i,t)-1);return fw(new Date(e),_i[n],r).getTime()}function h$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 d$e(e,t,r,n,i,a){var o=1e4,s=ABe,l=0;function u(N,B,$,F,G,z,U){for(var H=h$e(G,N),Y=B,Z=new Date(Y);Y<$&&Y<=n[1]&&(U.push({value:Y}),!(l++>o));)if(Z[G](Z[F]()+N),Y=Z.getTime(),a){var J=a.calcNiceTickMultiple(Y,H);J>0&&(Z[G](Z[F]()+J*N),Y=Z.getTime())}U.push({value:Y,notAdd:!0})}function c(N,B,$){var F=[],G=!B.length;if(!Xee(Yg(N),n[0],n[1],r)){G&&(B=[{value:f$e(n[0],N,r)},{value:n[1]}]);for(var z=0;z=n[0]&&U<=n[1]&&u(Y,U,H,Z,J,ae,F),N==="year"&&$.length>1&&z===0&&$.unshift({value:$[0].value-Y})}}for(var z=0;z=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&v>T/1.5||(f.push(x),d>T||e===s[g]))break}h=[]}}}for(var A=ht(se(f,function(N){return ht(N,function(B){return B.value>=n[0]&&B.value<=n[1]&&!B.notAdd})}),function(N){return N.length>0}),M=[],P=A.length-1,g=0;g0;)a*=10;var s=[DI(p$e(n[0]/a)*a),DI(v$e(n[1]/a)*a)];this._interval=a,this._intervalPrecision=wy(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=r_(r)/r_(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=r_(r)/r_(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),t_(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=Sr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,pe(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(Ws);function n_(e,t){return DI(e,Ra(t))}_u.registerClass(qee);var g$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[y$e[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=m$e[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),m$e={min:"_determinedMin",max:"_determinedMax"},y$e={min:"_dataMin",max:"_dataMax"};function Kee(e,t,r){var n=e.rawExtentInfo;return n||(n=new g$e(e,t,r),e.rawExtentInfo=n,n)}function i_(e,t){return t==null?null:mn(t)?NaN:e.parse(t)}function Qee(e,t){var r=e.type,n=Kee(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=Vee("bar",o),l=!1;if(R(s,function(f){l=l||f.getBaseAxis()===t.axis}),l){var u=Gee(s),c=x$e(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function x$e(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=i$e(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;R(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;R(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 sf(e,t){var r=t,n=Qee(e,r),i=n.extent,a=r.get("splitNumber");e instanceof qee&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(ete(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 v0(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new Qd({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new gj({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(_u.getClass(t)||Ws)}}function _$e(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function Wv(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=CBe(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(ve(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Ae(t)){if(e.type==="category")return function(i,a){return t(Sw(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(Sw(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function Sw(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function mj(e){var t=e.get("interval");return t??"auto"}function Jee(e){return e.type==="category"&&mj(e.getLabelModel())===0}function Tw(e,t){var r={};return R(e.mapDimensionsAll(t),function(n){r[dj(e,n)]=!0}),it(r)}function b$e(e,t,r){t&&R(Tw(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function Jd(e){return e==="middle"||e==="center"}function Ty(e){return e.getShallow("show")}function ete(e){var t=e.get("breaks",!0);if(t!=null)return!Sr()||!w$e(e.axis)?void 0:t}function w$e(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var Hv=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function S$e(e){return Yo(null,e)}var T$e={isDimensionStacked:Gs,enableDataStack:zee,getStackedDimension:dj};function A$e(e,t){var r=t;t instanceof tt||(r=new tt(t));var n=v0(r);return n.setExtent(e[0],e[1]),sf(n,r),n}function C$e(e){fr(e,Hv)}function M$e(e,t){return t=t||{},Mt(e,null,null,t.state!=="normal")}const P$e=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:B4e,createList:S$e,createScale:A$e,createSymbol:xr,createTextStyle:M$e,dataStack:T$e,enableHoverEmphasis:Ul,getECData:De,getLayoutRect:zt,mixinAxisModelCommonMethods:C$e},Symbol.toStringTag,{value:"Module"}));var L$e=1e-8;function k6(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return I$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 R(o,function(s){s.type==="polygon"?I6(s.exterior,i,a,r):R(s.points,function(l){I6(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 NI(e,t){return e=E$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 O6(o[0],o.slice(1)));break;case"MultiPolygon":R(i.coordinates,function(l){l[0]&&a.push(new O6(l[0],l.slice(1)))});break;case"LineString":a.push(new E6([i.coordinates]));break;case"MultiLineString":a.push(new E6(i.coordinates))}var s=new rte(n[t||"name"],a,n.cp);return s.properties=n,s})}const D$e=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:Xk,asc:Mi,getPercentWithPrecision:Jje,getPixelPrecision:sN,getPrecision:Ra,getPrecisionSafe:JK,isNumeric:cN,isRadianAroundZero:Ud,linearMap:gt,nice:uN,numericToNumber:zo,parseDate:Uo,parsePercent:de,quantile:eb,quantity:tQ,quantityExponent:mT,reformIntervals:qk,remRadian:lN,round:mr},Symbol.toStringTag,{value:"Module"})),N$e=Object.freeze(Object.defineProperty({__proto__:null,format:f0,parse:Uo,roundTime:fw},Symbol.toStringTag,{value:"Module"})),j$e=Object.freeze(Object.defineProperty({__proto__:null,Arc:l0,BezierCurve:Ev,BoundingRect:Oe,Circle:Zo,CompoundPath:u0,Ellipse:s0,Group:Me,Image:Xr,IncrementalDisplayable:FQ,Line:yr,LinearGradient:_f,Polygon:wn,Polyline:on,RadialGradient:SN,Rect:Xe,Ring:Ov,Sector:bn,Text:at,clipPointsByRect:MN,clipRectByRect:UQ,createIcon:Nv,extendPath:WQ,extendShape:GQ,getShapeClass:py,getTransform:Zl,initProps:Nt,makeImage:AN,makePath:Yd,mergePath:Ti,registerShape:xa,resizePath:CN,updateProps:lt},Symbol.toStringTag,{value:"Module"})),R$e=Object.freeze(Object.defineProperty({__proto__:null,addCommas:VN,capitalFirst:NBe,encodeHTML:On,formatTime:DBe,formatTpl:WN,getTextRect:OBe,getTooltipMarker:uJ,normalizeCssArray:Bv,toCamelCase:GN,truncateText:ORe},Symbol.toStringTag,{value:"Module"})),B$e=Object.freeze(Object.defineProperty({__proto__:null,bind:pe,clone:Ce,curry:Be,defaults:Pe,each:R,extend:re,filter:ht,indexOf:Ve,inherits:JD,isArray:ie,isFunction:Ae,isObject:Le,isString:ve,map:se,merge:We,reduce:ha},Symbol.toStringTag,{value:"Module"}));var z$e=Je(),qg=Je(),Ya={estimate:1,determine:2};function Aw(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function ite(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 $$e(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=Wv(e),i=e.scale.getExtent(),a=ite(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"?V$e(e,t):W$e(e)}function F$e(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=ite(e,n);return{ticks:ht(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?G$e(e,t):{ticks:se(e.scale.getTicks(r),function(o){return o.value})}}function V$e(e,t){var r=e.getLabelModel(),n=ate(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function ate(e,t,r){var n=U$e(e),i=mj(t),a=r.kind===Ya.estimate;if(!a){var o=ste(n,i);if(o)return o}var s,l;Ae(i)?s=cte(e,i):(l=i==="auto"?Z$e(e,r):i,s=ute(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return jI(n,i,u),!0}):jI(n,i,u),u}function G$e(e,t){var r=H$e(e),n=mj(t),i=ste(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Ae(n))a=cte(e,n,!0);else if(n==="auto"){var s=ate(e,e.getLabelModel(),Aw(Ya.determine));o=s.labelCategoryInterval,a=se(s.labels,function(l){return l.tickValue})}else o=n,a=ute(e,o,!0);return jI(r,n,{ticks:a,tickCategoryInterval:o})}function W$e(e){var t=e.scale.getTicks(),r=Wv(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 H$e=ote("axisTick"),U$e=ote("axisLabel");function ote(e){return function(r){return qg(r)[e]||(qg(r)[e]={list:[]})}}function ste(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,x=0,b=pT(i({value:f}),n.font,"center","top");y=b.width*1.3,x=b.height*1.3,g=Math.max(g,y,7),m=Math.max(m,x,7)}var S=g/d,T=m/v;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var A=Math.max(0,Math.floor(Math.min(S,T)));if(r===Ya.estimate)return t.out.noPxChangeTryDetermine.push(pe(X$e,null,e,A,l)),A;var M=lte(e,A,l);return M??A}function X$e(e,t,r){return lte(e,t,r)==null}function lte(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 q$e(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 ute(e,t,r){var n=Wv(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=Jee(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 cte(e,t,r){var n=e.scale,i=Wv(e),a=[];return R(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 D6=[0,1],_a=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 sN(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(),N6(n,i.count())),gt(t,D6,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),N6(n,i.count()));var a=gt(t,n,D6,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=F$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 K$e(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||Aw(Ya.determine),$$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||Aw(Ya.determine),Y$e(this,t)},e}();function N6(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function K$e(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;R(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=mr(d),v=mr(v),f?d>v:di&&(i+=Fp);var d=Math.atan2(s,o);if(d<0&&(d+=Fp),d>=n&&d<=i||d+Fp>=n&&d+Fp<=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,x=(v-o)*(v-o)+(g-s)*(g-s),b=(m-o)*(m-o)+(y-s)*(y-s);return x0){t=t/180*Math.PI,Ba.fromArray(e[0]),Ot.fromArray(e[1]),vr.fromArray(e[2]),Ie.sub(To,Ba,Ot),Ie.sub(yo,vr,Ot);var r=To.len(),n=yo.len();if(!(r<.001||n<.001)){To.scale(1/r),yo.scale(1/n);var i=To.dot(yo),a=Math.cos(t);if(a1&&Ie.copy(Vn,vr),Vn.toArray(e[1])}}}}function sFe(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,Ba.fromArray(e[0]),Ot.fromArray(e[1]),vr.fromArray(e[2]),Ie.sub(To,Ot,Ba),Ie.sub(yo,vr,Ot);var n=To.len(),i=yo.len();if(!(n<.001||i<.001)){To.scale(1/n),yo.scale(1/i);var a=To.dot(t),o=Math.cos(r);if(a=l)Ie.copy(Vn,vr);else{Vn.scaleAndAdd(yo,s/Math.tan(Math.PI/2-c));var f=vr.x!==Ot.x?(Vn.x-Ot.x)/(vr.x-Ot.x):(Vn.y-Ot.y)/(vr.y-Ot.y);if(isNaN(f))return;f<0?Ie.copy(Vn,Ot):f>1&&Ie.copy(Vn,vr)}Vn.toArray(e[1])}}}}function R2(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 lFe(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=ps(n[0],n[1]),a=ps(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=$g([],n[1],n[0],o/i),l=$g([],n[1],n[2],o/a),u=$g([],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(I*k,0,a);var O=I+M;O<0&&T(-O*k,1)}else T(-M*k,1)}}function S(M,P,k){M!==0&&(c=!0);for(var I=P;I0)for(var O=0;O0;O--){var $=k[O-1]*B;S(-$,O,a)}}}function A(M){var P=M<0?-1:1;M=Math.abs(M);for(var k=Math.ceil(M/(a-1)),I=0;I0?S(k,0,I+1):S(-k,a-I-1,a),M-=k,M<=0)return}return c}function fFe(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),Ve(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),lt(n,u,r,l)}else if(n.attr(u),!jv(n).valueAnimation){var f=be(n.style.opacity,1);n.style.opacity=0,Nt(n,{style:{opacity:f}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};a_(d,u,o_),a_(d,n.states.select,o_)}if(n.states.emphasis){var v=a.oldLayoutEmphasis={};a_(v,u,o_),a_(v,n.states.emphasis,o_)}QQ(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=vFe(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,Nt(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},e}(),$2=Je();function gFe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=$2(r).labelManager;i||(i=$2(r).labelManager=new pFe),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=$2(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var F2=Math.sin,V2=Math.cos,mte=Math.PI,qu=Math.PI*2,mFe=180/mte,yte=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=Ll(f-qu)||(c?u>=qu:-u>=qu),d=u>0?u%qu:u%qu+qu,v=!1;h?v=!0:Ll(f)?v=!1:v=d>=mte==!!c;var g=t+n*V2(o),m=r+i*F2(o);this._start&&this._add("M",g,m);var y=Math.round(a*mFe);if(h){var x=1/this._p,b=(c?1:-1)*(qu-x);this._add("A",n,i,y,1,+c,t+n*V2(o+b),r+i*F2(o+b)),x>.01&&this._add("A",n,i,y,0,+c,g,m)}else{var S=t+n*V2(s),T=r+i*F2(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 CFe(e){return""}function bj(e,t){t=t||{};var r=t.newline?` +`];function Ar(e,t){return t.type=e,t}function _I(e){return e.type==="section"}function HJ(e){return _I(e)?W3e:H3e}function UJ(e){if(_I(e)){var t=0,r=e.blocks.length,n=r>1||r>0&&!e.noHeader;return R(e.blocks,function(i){var a=UJ(i);a>=t&&(t=a+ +(n&&(!a||_I(i)&&!i.noHeader)))}),t}return 0}function W3e(e,t,r,n){var i=t.noHeader,a=U3e(UJ(t)),o=[],s=t.blocks||[];_n(!s||ie(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(ye(u,l)){var c=new BJ(u[l],null);s.sort(function(g,m){return c.evaluate(g.sortParam,m.sortParam)})}else l==="seriesDesc"&&s.reverse()}R(s,function(g,m){var y=t.valueFormatter,_=HJ(g)(y?re(re({},e),{valueFormatter:y}):e,g,m>0?a.html:0,n);_!=null&&o.push(_)});var f=e.renderMode==="richText"?o.join(a.richText):bI(n,o.join(""),i?r:a.html);if(i)return f;var h=vI(t.header,"ordinal",e.useUTC),d=WJ(n,e.renderMode).nameStyle,v=GJ(n);return e.renderMode==="richText"?ZJ(e,h,d)+a.richText+f:bI(n,'
'+On(h)+"
"+f,r)}function H3e(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=ie(S)?S:[S],se(S,function(T,A){return vI(T,ie(d)?d[A]:d,u)})};if(!(a&&o)){var f=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||K.color.secondary,i),h=a?"":vI(l,"ordinal",u),d=t.valueType,v=o?[]:c(t.value,t.dataIndex),g=!s||!a,m=!s&&a,y=WJ(n,i),_=y.nameStyle,b=y.valueStyle;return i==="richText"?(s?"":f)+(a?"":ZJ(e,h,_))+(o?"":X3e(e,v,g,m,b)):bI(n,(s?"":f)+(a?"":Z3e(h,!s,_))+(o?"":Y3e(v,g,m,b)),r)}}function HV(e,t,r,n,i,a){if(e){var o=HJ(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function U3e(e){return{html:V3e[e],richText:G3e[e]}}function bI(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=GJ(e);return'
'+t+n+"
"}function Z3e(e,t,r){var n=t?"margin-left:2px":"";return''+On(e)+""}function Y3e(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=ie(e)?e:[e],''+se(e,function(o){return On(o)}).join("  ")+""}function ZJ(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function X3e(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(ie(t)?t.join(" "):t,a)}function YJ(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return sf(n)}function XJ(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var T2=function(){function e(){this.richTextStyles={},this._nextStyleNameId=rQ()}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=uJ({color:r,type:t,renderMode:n,markerId:i});return ve(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};ie(r)?R(r,function(a){return re(n,a)}):re(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function qJ(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=ie(s),u=YJ(t,r),c,f,h,d;if(o>1||l&&!o){var v=q3e(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=Kd(i,r,a[0]),f=g.type}else d=c=l?s[0]:s;var m=fN(t),y=m&&t.name||"",_=i.getName(r),b=n?y:_;return Ar("section",{header:y,noHeader:n||!m,sortParam:d,blocks:[Ar("nameValue",{markerType:"item",markerColor:u,name:b,noName:!Ci(b),value:c,valueType:f,dataIndex:r})].concat(h||[])})}function q3e(e,t,r,n,i){var a=t.getData(),o=ha(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?R(n,function(f){c(Kd(a,r,f),f)}):R(e,c);function c(f,h){var d=a.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?u.push(Ar("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 il=Je();function Zx(e,t){return e.getName(t)||e.getId(t)}var lb="__universalTransitionEnabled",St=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=qg({count:Q3e,reset:J3e}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=il(this).sourceManager=new VJ(this);a.prepareSource();var o=this.getInitialData(r,i);ZV(o,this),this.dataTask.context.data=o,il(this).dataBeforeProcessed=o,UV(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=yy(this),a=i?Sf(r):{},o=this.subType;Qe.hasClass(o)&&(o+="Series"),He(r,n.getTheme().get(this.subType)),He(r,this.getDefaultOption()),ef(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Fo(r,a,i)},t.prototype.mergeOption=function(r,n){r=He(this.option,r,!0),this.fillDataTextStyle(r.data);var i=yy(this);i&&Fo(this.option,r,i);var a=il(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);ZV(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,il(this).dataBeforeProcessed=o,UV(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!Zn(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 qJ({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=YN.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[Zx(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[lb])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"){Le(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return Qe.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}(Qe);fr(St,OT);fr(St,YN);hQ(St,Qe);function UV(e){var t=e.name;fN(e)||(e.name=K3e(e)||t)}function K3e(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return R(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function Q3e(e){return e.model.getRawData().count()}function J3e(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),eze}function eze(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function ZV(e,t){R(Wd(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Be(tze,t))})}function tze(e,t){var r=wI(e);return r&&r.setOutputEnd((t||this).count()),t}function wI(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 Lt=function(){function e(){this.group=new Me,this.uid=Bv("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}();dN(Lt);xT(Lt);function Fv(){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 KJ=Je(),rze=Fv(),_t=function(){function e(){this.group=new Me,this.uid=Bv("viewChart"),this.renderTask=qg({plan:nze,reset:ize}),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&&XV(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&XV(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){yu(this.group,t)},e.markUpdateMethod=function(t,r){KJ(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function YV(e,t,r){e&&py(e)&&(t==="emphasis"?$s:Fs)(e,r)}function XV(e,t,r){var n=tf(e,t),i=t&&t.highlightKey!=null?k5e(t.highlightKey):null;n!=null?R(Pt(n),function(a){YV(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){YV(a,r,i)})}dN(_t);xT(_t);function nze(e){return rze(e.model)}function ize(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&KJ(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),aze[l]}var aze={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)}}},vw="\0__throttleOriginMethod",qV="\0__throttleRate",KV="\0__throttleType";function DT(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 Vv(e,t,r,n){var i=e[t];if(i){var a=i[vw]||i,o=i[KV],s=i[qV];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=DT(a,r,n==="debounce"),i[vw]=a,i[KV]=n,i[qV]=r}return i}}function _y(e,t){var r=e[t];r&&r[vw]&&(r.clear&&r.clear(),e[t]=r[vw])}var QV=Je(),JV={itemStyle:rf(eJ,!0),lineStyle:rf(JQ,!0)},oze={lineStyle:"stroke",itemStyle:"fill"};function QJ(e,t){var r=e.visualStyleMapper||JV[t];return r||(console.warn("Unknown style type '"+t+"'."),JV.itemStyle)}function JJ(e,t){var r=e.visualDrawType||oze[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var sze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=QJ(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=JJ(e,n),u=o[l],c=Ae(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"||Ae(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||Ae(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=re({},o);m[l]=c(g),d.setItemVisual(v,"style",m)}}}},Np=new tt,lze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=QJ(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Np.option=l[n];var u=i(Np),c=o.ensureUniqueItemVisual(s,"style");re(c,u),Np.option.decal&&(o.setItemVisual(s,"decal",Np.option.decal),Np.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},uze={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)),QV(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=QV(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=JJ(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)}})}})}},Yx=Math.PI;function cze(e,t){t=t||{},Pe(t,{text:"loading",textColor:K.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:K.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 u0({shape:{startAngle:-Yx/2,endAngle:-Yx/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:Yx*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Yx*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 eee=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;R(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";_n(!(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;R(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)||qg({plan:pze,reset:gze,count:yze}));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||qg({reset:fze});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="";_n(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,v):c?c(n,i).each(v):(f=!1,R(n.getSeries(),v));function v(g){var m=g.uid,y=l.set(m,s&&s.get(m)||(h=!0,qg({reset:hze,onDirty:vze})));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 Ae(t)&&(t={overallReset:t,seriesType:xze(t)}),t.uid=Bv("stageHandler"),r&&(t.visualType=r),t},e}();function fze(e){e.overallReset(e.ecModel,e.api,e.payload)}function hze(e){return e.overallProgress&&dze}function dze(){this.agent.dirty(),this.getDownstream().dirty()}function vze(){this.agent&&this.agent.dirty()}function pze(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function gze(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 tee(n)}):mze}var mze=tee(0);function tee(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}(),SI=["symbol","symbolSize","symbolRotate","symbolOffset"],t6=SI.concat(["symbolKeepAspect"]),wze={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&&Pc(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function TI(e,t,r){for(var n=t.type==="radial"?Rze(e,t,r):jze(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:ot(e)?[e]:ie(e)?e:null}function tj(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 $ze=new $o(!0);function mw(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function r6(e){return typeof e=="string"&&e!=="none"}function yw(e){var t=e.fill;return t!=null&&t!=="none"}function n6(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 i6(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 AI(e,t,r){var n=vN(t.image,t.__image,r);if(_T(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 Fze(e,t,r,n){var i,a=mw(r),o=yw(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||$ze,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,A=void 0;(v||g)&&(A=t.getBoundingRect()),v&&(_=f?TI(e,h,A):t.__canvasFillGradient,t.__canvasFillGradient=_),g&&(b=f?TI(e,d,A):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),m&&(S=f||!t.__canvasFillPattern?AI(e,h,t):t.__canvasFillPattern,t.__canvasFillPattern=S),y&&(T=f||!t.__canvasStrokePattern?AI(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 M=t.getGlobalScale();c.setScale(M[0],M[1],t.segmentIgnoreThreshold);var P,k;e.setLineDash&&r.lineDash&&(i=tj(t),P=i[0],k=i[1]);var I=!0;(u||f&xh)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),I=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),I&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=k),n||(r.strokeFirst?(a&&i6(e,r),o&&n6(e,r)):(o&&n6(e,r),a&&i6(e,r))),P&&e.setLineDash([])}function Vze(e,t,r){var n=t.__image=vN(r.image,t.__image,t,t.onload);if(!(!n||!_T(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 Gze(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||Bs,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=tj(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(mw(r)&&e.strokeText(i,r.x,r.y),yw(r)&&e.fillText(i,r.x,r.y)):(yw(r)&&e.fillText(i,r.x,r.y),mw(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var a6=["shadowBlur","shadowOffsetX","shadowOffsetY"],o6=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function see(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){ai(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?jc.opacity:o}(n||t.blend!==r.blend)&&(a||(ai(e,i),a=!0),e.globalCompositeOperation=t.blend||jc.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(Le(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Pr]=!0,nh(this),!this._model||n){var l=new n3e(this._api),u=this._theme,c=this._model=new XN;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},LI);var f={seriesTransition:s,optionChanged:!0};if(i)this[Qr]={silent:a,updateParams:f},this[Pr]=!1,this.getZr().wakeUp();else{try{Xu(this),rs.update.call(this,null,f)}catch(h){throw this[Qr]=null,this[Pr]=!1,h}this._ssr||this._zr.flush(),this[Qr]=null,this[Pr]=!1,th.call(this,a),rh.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[Qr]&&(a==null&&(a=this[Qr].silent),o=this[Qr].updateParams,this[Qr]=null),this[Pr]=!0,nh(this);try{this._updateTheme(r),i.setTheme(this._theme),Xu(this),rs.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Pr]=!1,s}this[Pr]=!1,th.call(this,a),rh.call(this,a)}}},t.prototype._updateTheme=function(r){ve(r)&&(r=Cee[r]),r&&(r=Ce(r),r&&LJ(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 R(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;R(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 R(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(ww[i]){var l=s,u=s,c=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();R(zc,function(b,S){if(b.group===i){var T=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(Ce(r)),A=b.getDom().getBoundingClientRect();l=a(A.left,l),u=a(A.top,u),c=o(A.right,c),f=o(A.bottom,f),h.push({dom:T,left:A.left,top:A.top})}}),l*=d,u*=d,c*=d,f*=d;var v=c-l,g=f-u,m=hi.createCanvas(),y=Zk(m,{renderer:n?"svg":"canvas"});if(y.resize({width:v,height:g}),n){var _="";return R(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}})),R(h,function(b){var S=new Xr({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 Qx(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return Qx(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return Qx(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=od(i,r);return R(o,function(s,l){l.indexOf("Models")>=0&&R(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=od(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?ej(s,l,n):v0(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;R(p4e,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&Mc(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=re({},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;R(MI,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Tze(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&&uQ(this.getDom(),aj,"");var n=this,i=n._api,a=n._model;R(n._componentsViews,function(o){o.dispose(a,i)}),R(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 zc[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[Qr]&&(a==null&&(a=this[Qr].silent),i=!0,this[Qr]=null),this[Pr]=!0,nh(this);try{i&&Xu(this),rs.update.call(this,{type:"resize",animation:re({duration:0},r&&r.animation)})}catch(o){throw this[Pr]=!1,o}this[Pr]=!1,th.call(this,a),rh.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(Le(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!kI[r]){var i=kI[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=re({},r);return n.type=CI[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(Le(n)||(n={silent:!!n}),!!_w[r.type]&&this._model){if(this[Pr]){this._pendingActions.push(r);return}var i=n.silent;k2.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&nt.browser.weChat&&this._throttledZrFlush(),th.call(this,i),rh.call(this,i)}},t.prototype.updateLabelLayout=function(){Pa.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(){Xu=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),P2(f,!0),P2(f,!1),h.plan()},P2=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=of(f);h.eachRendered(function(v){return PT(v,d.z,d.zlevel),!0})}}function u(f,h){h.eachRendered(function(d){if(!sd(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(sd(y))return;if(y instanceof rt&&I5e(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)}})}x6=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){$s(v,g),Gi(f)},d.prototype.leaveEmphasis=function(v,g){Fs(v,g),Gi(f)},d.prototype.enterBlur=function(v){MQ(v),Gi(f)},d.prototype.leaveBlur=function(v){_N(v),Gi(f)},d.prototype.enterSelect=function(v){PQ(v),Gi(f)},d.prototype.leaveSelect=function(v){LQ(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}(MJ))(f)},Aee=function(f){function h(d,v){for(var g=0;g=0)){b6.push(r);var a=eee.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function fj(e,t){kI[e]=t}function A4e(e){vK({createCanvas:e})}function Oee(e,t,r){var n=dee("registerMap");n&&n(e,t,r)}function C4e(e){var t=dee("getMap");return t&&t(e)}var Eee=N3e;_u(nj,sze);_u(NT,lze);_u(NT,uze);_u(nj,wze);_u(NT,Sze);_u(yee,Kze);lj(LJ);uj(i4e,p3e);fj("default",cze);Ka({type:Rc,event:Rc,update:Rc},lr);Ka({type:rb,event:rb,update:rb},lr);Ka({type:sw,event:yN,update:sw,action:lr,refineEvent:hj,publishNonRefinedEvent:!0});Ka({type:nI,event:yN,update:nI,action:lr,refineEvent:hj,publishNonRefinedEvent:!0});Ka({type:lw,event:yN,update:lw,action:lr,refineEvent:hj,publishNonRefinedEvent:!0});function hj(e,t,r,n){return{eventContent:{selected:C5e(r),isFromClick:t.isFromClick||!1}}}sj("default",{});sj("dark",iee);var M4e={},w6=[],P4e={registerPreprocessor:lj,registerProcessor:uj,registerPostInit:Pee,registerPostUpdate:Lee,registerUpdateLifecycle:jT,registerAction:Ka,registerCoordinateSystem:kee,registerLayout:Iee,registerVisual:_u,registerTransform:Eee,registerLoading:fj,registerMap:Oee,registerImpl:Qze,PRIORITY:xee,ComponentModel:Qe,ComponentView:Lt,SeriesModel:St,ChartView:_t,registerComponentModel:function(e){Qe.registerClass(e)},registerComponentView:function(e){Lt.registerClass(e)},registerSeriesModel:function(e){St.registerClass(e)},registerChartView:function(e){_t.registerClass(e)},registerCustomSeries:function(e,t){pee(e,t)},registerSubTypeDefaulter:function(e,t){Qe.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){XK(e,t)}};function Ze(e){if(ie(e)){R(e,function(t){Ze(t)});return}Ge(w6,e)>=0||(w6.push(e),Ae(e)&&(e={install:e}),e.install(P4e))}function Rp(e){return e==null?0:e.length||1}function S6(e){return e}var Vs=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||S6,this._newKeyGetter=i||S6,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 Bp=Le,al=se,D4e=typeof Int32Array>"u"?Array:Int32Array,N4e="e\0\0",T6=-1,j4e=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],R4e=["_approximateExtent"],A6,e_,zp,$p,E2,Fp,D2,Dn=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;Nee(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),ie(a)?a=a.slice():Bp(a)&&(a=re({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Bp(r)?re(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){Bp(t)?re(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?re(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;rI(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){R(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:al(this.dimensions,this._getDimInfo,this),this.hostModel)),E2(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Ae(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(hT(arguments)))})},e.internalField=function(){A6=function(t){var r=t._invertedIndicesMap;R(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new D4e(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function B4e(e,t){return Wv(e,t).dimensions}function Wv(e,t){qN(e)||(e=KN(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=_e(),a=[],o=$4e(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Bee(o),l=n===e.dimensionsDefine,u=l?Ree(e):jee(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var f=_e(c),h=new $J(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function $4e(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return R(t,function(a){var o;Le(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function F4e(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 V4e=function(){function e(t){this.coordSysDims=[],this.axisMap=_e(),this.categoryAxisMap=_e(),this.coordSysName=t}return e}();function G4e(e){var t=e.get("coordinateSystem"),r=new V4e(t),n=W4e[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var W4e={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",tr).models[0],a=e.getReferringComponents("yAxis",tr).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),ih(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),ih(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",tr).models[0];t.coordSysDims=["single"],r.set("single",i),ih(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",tr).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),ih(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),ih(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();R(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),ih(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",tr).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 ih(e){return e.get("type")==="category"}function zee(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;H4e(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,f,h;if(R(a,function(_,b){ve(_)&&(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;R(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 H4e(e){return!Nee(e.schema)}function Gs(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function dj(e,t){return Gs(e,t)?e.getCalculationInfo("stackResultDimension"):t}function U4e(e,t){var r=e.get("coordinateSystem"),n=$v.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=Sw(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function Z4e(e,t,r){var n,i;return r&&R(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 Yo(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=KN(e)):(i=n.getSource(),a=i.sourceFormat===Ni);var o=G4e(t),s=U4e(t,o),l=r.useEncodeDefaulter,u=Ae(l)?l:l?Be(SJ,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=Wv(i,c),h=Z4e(f.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(f),v=zee(t,{schema:f,store:d}),g=new Dn(f,t);g.setCalculationInfo(v);var m=h!=null&&Y4e(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 Y4e(e){if(e.sourceFormat===Ni){var t=X4e(e.data||[]);return!ie(kv(t))}}function X4e(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=Sy(o),l=a.niceTickExtent=[mr(Math.ceil(e[0]/o)*o,s),mr(Math.floor(e[1]/o)*o,s)];return K4e(l,e),a}function N2(e){var t=Math.pow(10,yT(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,mr(r*t)}function Sy(e){return Ra(e)+2}function C6(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function K4e(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),C6(e,0,t),C6(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function vj(e,t){return e>=t[0]&&e<=t[1]}var Q4e=function(){function e(){this.normalize=M6,this.scale=P6}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=pe(t.normalize,t),this.scale=pe(t.scale,t)):(this.normalize=M6,this.scale=P6)},e}();function M6(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function P6(e,t){return e*(t[1]-t[0])+t[0]}function OI(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 bu=function(){function e(t){this._calculator=new Q4e,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,pe(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}();xT(bu);var J4e=0,Ty=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++J4e,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&se(n,e$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(!ve(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 e$e(e){return Le(e)&&e.value!=null?e.value:e+""}var Jd=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 Ty({})),ie(i)&&(i=new Ty({categories:se(i,function(a){return Le(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:ve(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return vj(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}(bu);bu.registerClass(Jd);var ol=mr,Ws=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 vj(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=Sy(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=ol(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:ol(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 Gee(e){var t=n$e(e),r=[];return R(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=de(n.get("barWidth"),s),g=de(n.get("barMaxWidth"),s),m=de(n.get("barMinWidth")||(Yee(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:pj(a),stackId:Fee(n)})}),Wee(r)}function Wee(e){var t={};R(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 R(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=de(s,o),c=de(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-u)/(h+(h-1)*c);d=Math.max(d,0),R(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;R(a,function(y,_){y.width||(y.width=d),g=y,v+=y.width*(1+c)}),g&&(v-=g.width*c);var m=-v/2;R(a,function(y,_){r[i][_]=r[i][_]||{bandWidth:o,offset:m,width:y.width},m+=y.width*(1+c)})}),r}function i$e(e,t,r){if(e&&t){var n=e[pj(t)];return n}}function Hee(e,t){var r=Vee(e,t),n=Gee(r);R(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=Fee(i),u=n[pj(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function Uee(e){return{seriesType:e,plan:Fv(),reset:function(t){if(Zee(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=Gs(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),d=a$e(i,a),v=Yee(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,A=v&&So(T*3),M=v&&l&&So(T*3),P=v&&So(T),k=n.master.getRect(),I=h?k.width:k.height,O,D=S.getStore(),N=0;(O=b.next())!=null;){var B=D.get(f?m:o,O),$=D.get(s,O),F=d,G=void 0;f&&(G=+B-D.get(o,O));var z=void 0,U=void 0,H=void 0,Y=void 0;if(h){var Z=n.dataToPoint([B,$]);if(f){var J=n.dataToPoint([G,$]);F=J[0]}z=F,U=Z[1]+_,H=Z[0]-F,Y=y,Math.abs(H)0?r:1:r))}var o$e=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=t_.length,s=Math.min(o$e(t_,this._approxInterval,0,o),o-1);this._interval=t_[s][1],this._intervalPrecision=Sy(this._interval),this._minLevelUnit=t_[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return ot(r)?r:+Uo(r)},t.prototype.contain=function(r){return vj(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}(Ws),t_=[["second",DN],["minute",NN],["hour",Yg],["quarter-day",Yg*6],["half-day",Yg*12],["day",ta*1.2],["half-week",ta*3.5],["week",ta*7],["month",ta*31],["quarter",ta*95],["half-year",yV/2],["year",yV]];function Xee(e,t,r,n){return hw(new Date(t),e,n).getTime()===hw(new Date(r),e,n).getTime()}function s$e(e,t){return e/=ta,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function l$e(e){var t=30*ta;return e/=t,e>6?6:e>3?3:e>2?2:1}function u$e(e){return e/=Yg,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function L6(e,t){return e/=t?NN:DN,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function c$e(e){return uN(e,!0)}function f$e(e,t,r){var n=Math.max(0,Ge(_i,t)-1);return hw(new Date(e),_i[n],r).getTime()}function h$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 d$e(e,t,r,n,i,a){var o=1e4,s=ABe,l=0;function u(N,B,$,F,G,z,U){for(var H=h$e(G,N),Y=B,Z=new Date(Y);Y<$&&Y<=n[1]&&(U.push({value:Y}),!(l++>o));)if(Z[G](Z[F]()+N),Y=Z.getTime(),a){var J=a.calcNiceTickMultiple(Y,H);J>0&&(Z[G](Z[F]()+J*N),Y=Z.getTime())}U.push({value:Y,notAdd:!0})}function c(N,B,$){var F=[],G=!B.length;if(!Xee(Xg(N),n[0],n[1],r)){G&&(B=[{value:f$e(n[0],N,r)},{value:n[1]}]);for(var z=0;z=n[0]&&U<=n[1]&&u(Y,U,H,Z,J,ae,F),N==="year"&&$.length>1&&z===0&&$.unshift({value:$[0].value-Y})}}for(var z=0;z=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 A=ht(se(f,function(N){return ht(N,function(B){return B.value>=n[0]&&B.value<=n[1]&&!B.notAdd})}),function(N){return N.length>0}),M=[],P=A.length-1,g=0;g0;)a*=10;var s=[DI(p$e(n[0]/a)*a),DI(v$e(n[1]/a)*a)];this._interval=a,this._intervalPrecision=Sy(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=n_(r)/n_(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=n_(r)/n_(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),r_(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=Sr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,pe(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(Ws);function i_(e,t){return DI(e,Ra(t))}bu.registerClass(qee);var g$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[y$e[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=m$e[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),m$e={min:"_determinedMin",max:"_determinedMax"},y$e={min:"_dataMin",max:"_dataMax"};function Kee(e,t,r){var n=e.rawExtentInfo;return n||(n=new g$e(e,t,r),e.rawExtentInfo=n,n)}function a_(e,t){return t==null?null:mn(t)?NaN:e.parse(t)}function Qee(e,t){var r=e.type,n=Kee(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=Vee("bar",o),l=!1;if(R(s,function(f){l=l||f.getBaseAxis()===t.axis}),l){var u=Gee(s),c=x$e(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function x$e(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=i$e(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;R(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;R(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 lf(e,t){var r=t,n=Qee(e,r),i=n.extent,a=r.get("splitNumber");e instanceof qee&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(ete(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 p0(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new Jd({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new gj({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(bu.getClass(t)||Ws)}}function _$e(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function Hv(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=CBe(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(ve(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Ae(t)){if(e.type==="category")return function(i,a){return t(Tw(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(Tw(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function Tw(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function mj(e){var t=e.get("interval");return t??"auto"}function Jee(e){return e.type==="category"&&mj(e.getLabelModel())===0}function Aw(e,t){var r={};return R(e.mapDimensionsAll(t),function(n){r[dj(e,n)]=!0}),it(r)}function b$e(e,t,r){t&&R(Aw(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function ev(e){return e==="middle"||e==="center"}function Ay(e){return e.getShallow("show")}function ete(e){var t=e.get("breaks",!0);if(t!=null)return!Sr()||!w$e(e.axis)?void 0:t}function w$e(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var Uv=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function S$e(e){return Yo(null,e)}var T$e={isDimensionStacked:Gs,enableDataStack:zee,getStackedDimension:dj};function A$e(e,t){var r=t;t instanceof tt||(r=new tt(t));var n=p0(r);return n.setExtent(e[0],e[1]),lf(n,r),n}function C$e(e){fr(e,Uv)}function M$e(e,t){return t=t||{},Mt(e,null,null,t.state!=="normal")}const P$e=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:B4e,createList:S$e,createScale:A$e,createSymbol:xr,createTextStyle:M$e,dataStack:T$e,enableHoverEmphasis:Zl,getECData:De,getLayoutRect:$t,mixinAxisModelCommonMethods:C$e},Symbol.toStringTag,{value:"Module"}));var L$e=1e-8;function k6(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return I$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 R(o,function(s){s.type==="polygon"?I6(s.exterior,i,a,r):R(s.points,function(l){I6(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 NI(e,t){return e=E$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 O6(o[0],o.slice(1)));break;case"MultiPolygon":R(i.coordinates,function(l){l[0]&&a.push(new O6(l[0],l.slice(1)))});break;case"LineString":a.push(new E6([i.coordinates]));break;case"MultiLineString":a.push(new E6(i.coordinates))}var s=new rte(n[t||"name"],a,n.cp);return s.properties=n,s})}const D$e=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:Xk,asc:Mi,getPercentWithPrecision:Jje,getPixelPrecision:sN,getPrecision:Ra,getPrecisionSafe:JK,isNumeric:cN,isRadianAroundZero:Zd,linearMap:gt,nice:uN,numericToNumber:zo,parseDate:Uo,parsePercent:de,quantile:tb,quantity:tQ,quantityExponent:yT,reformIntervals:qk,remRadian:lN,round:mr},Symbol.toStringTag,{value:"Module"})),N$e=Object.freeze(Object.defineProperty({__proto__:null,format:h0,parse:Uo,roundTime:hw},Symbol.toStringTag,{value:"Module"})),j$e=Object.freeze(Object.defineProperty({__proto__:null,Arc:u0,BezierCurve:Dv,BoundingRect:Oe,Circle:Zo,CompoundPath:c0,Ellipse:l0,Group:Me,Image:Xr,IncrementalDisplayable:FQ,Line:yr,LinearGradient:bf,Polygon:wn,Polyline:on,RadialGradient:SN,Rect:Xe,Ring:Ev,Sector:bn,Text:at,clipPointsByRect:MN,clipRectByRect:UQ,createIcon:jv,extendPath:WQ,extendShape:GQ,getShapeClass:gy,getTransform:Yl,initProps:Nt,makeImage:AN,makePath:Xd,mergePath:Ti,registerShape:xa,resizePath:CN,updateProps:lt},Symbol.toStringTag,{value:"Module"})),R$e=Object.freeze(Object.defineProperty({__proto__:null,addCommas:VN,capitalFirst:NBe,encodeHTML:On,formatTime:DBe,formatTpl:WN,getTextRect:OBe,getTooltipMarker:uJ,normalizeCssArray:zv,toCamelCase:GN,truncateText:ORe},Symbol.toStringTag,{value:"Module"})),B$e=Object.freeze(Object.defineProperty({__proto__:null,bind:pe,clone:Ce,curry:Be,defaults:Pe,each:R,extend:re,filter:ht,indexOf:Ge,inherits:JD,isArray:ie,isFunction:Ae,isObject:Le,isString:ve,map:se,merge:He,reduce:ha},Symbol.toStringTag,{value:"Module"}));var z$e=Je(),Kg=Je(),Ya={estimate:1,determine:2};function Cw(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function ite(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 $$e(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=Hv(e),i=e.scale.getExtent(),a=ite(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"?V$e(e,t):W$e(e)}function F$e(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=ite(e,n);return{ticks:ht(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?G$e(e,t):{ticks:se(e.scale.getTicks(r),function(o){return o.value})}}function V$e(e,t){var r=e.getLabelModel(),n=ate(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function ate(e,t,r){var n=U$e(e),i=mj(t),a=r.kind===Ya.estimate;if(!a){var o=ste(n,i);if(o)return o}var s,l;Ae(i)?s=cte(e,i):(l=i==="auto"?Z$e(e,r):i,s=ute(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return jI(n,i,u),!0}):jI(n,i,u),u}function G$e(e,t){var r=H$e(e),n=mj(t),i=ste(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Ae(n))a=cte(e,n,!0);else if(n==="auto"){var s=ate(e,e.getLabelModel(),Cw(Ya.determine));o=s.labelCategoryInterval,a=se(s.labels,function(l){return l.tickValue})}else o=n,a=ute(e,o,!0);return jI(r,n,{ticks:a,tickCategoryInterval:o})}function W$e(e){var t=e.scale.getTicks(),r=Hv(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 H$e=ote("axisTick"),U$e=ote("axisLabel");function ote(e){return function(r){return Kg(r)[e]||(Kg(r)[e]={list:[]})}}function ste(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=gT(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 A=Math.max(0,Math.floor(Math.min(S,T)));if(r===Ya.estimate)return t.out.noPxChangeTryDetermine.push(pe(X$e,null,e,A,l)),A;var M=lte(e,A,l);return M??A}function X$e(e,t,r){return lte(e,t,r)==null}function lte(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 q$e(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 ute(e,t,r){var n=Hv(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=Jee(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 cte(e,t,r){var n=e.scale,i=Hv(e),a=[];return R(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 D6=[0,1],_a=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 sN(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(),N6(n,i.count())),gt(t,D6,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),N6(n,i.count()));var a=gt(t,n,D6,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=F$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 K$e(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||Cw(Ya.determine),$$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||Cw(Ya.determine),Y$e(this,t)},e}();function N6(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function K$e(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;R(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=mr(d),v=mr(v),f?d>v:di&&(i+=Vp);var d=Math.atan2(s,o);if(d<0&&(d+=Vp),d>=n&&d<=i||d+Vp>=n&&d+Vp<=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,Ba.fromArray(e[0]),Ot.fromArray(e[1]),vr.fromArray(e[2]),Ie.sub(To,Ba,Ot),Ie.sub(yo,vr,Ot);var r=To.len(),n=yo.len();if(!(r<.001||n<.001)){To.scale(1/r),yo.scale(1/n);var i=To.dot(yo),a=Math.cos(t);if(a1&&Ie.copy(Vn,vr),Vn.toArray(e[1])}}}}function sFe(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,Ba.fromArray(e[0]),Ot.fromArray(e[1]),vr.fromArray(e[2]),Ie.sub(To,Ot,Ba),Ie.sub(yo,vr,Ot);var n=To.len(),i=yo.len();if(!(n<.001||i<.001)){To.scale(1/n),yo.scale(1/i);var a=To.dot(t),o=Math.cos(r);if(a=l)Ie.copy(Vn,vr);else{Vn.scaleAndAdd(yo,s/Math.tan(Math.PI/2-c));var f=vr.x!==Ot.x?(Vn.x-Ot.x)/(vr.x-Ot.x):(Vn.y-Ot.y)/(vr.y-Ot.y);if(isNaN(f))return;f<0?Ie.copy(Vn,Ot):f>1&&Ie.copy(Vn,vr)}Vn.toArray(e[1])}}}}function B2(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 lFe(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=ps(n[0],n[1]),a=ps(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=Fg([],n[1],n[0],o/i),l=Fg([],n[1],n[2],o/a),u=Fg([],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(I*k,0,a);var O=I+M;O<0&&T(-O*k,1)}else T(-M*k,1)}}function S(M,P,k){M!==0&&(c=!0);for(var I=P;I0)for(var O=0;O0;O--){var $=k[O-1]*B;S(-$,O,a)}}}function A(M){var P=M<0?-1:1;M=Math.abs(M);for(var k=Math.ceil(M/(a-1)),I=0;I0?S(k,0,I+1):S(-k,a-I-1,a),M-=k,M<=0)return}return c}function fFe(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),Ge(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),lt(n,u,r,l)}else if(n.attr(u),!Rv(n).valueAnimation){var f=be(n.style.opacity,1);n.style.opacity=0,Nt(n,{style:{opacity:f}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};o_(d,u,s_),o_(d,n.states.select,s_)}if(n.states.emphasis){var v=a.oldLayoutEmphasis={};o_(v,u,s_),o_(v,n.states.emphasis,s_)}QQ(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=vFe(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,Nt(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},e}(),F2=Je();function gFe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=F2(r).labelManager;i||(i=F2(r).labelManager=new pFe),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=F2(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var V2=Math.sin,G2=Math.cos,mte=Math.PI,Ku=Math.PI*2,mFe=180/mte,yte=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=kl(f-Ku)||(c?u>=Ku:-u>=Ku),d=u>0?u%Ku:u%Ku+Ku,v=!1;h?v=!0:kl(f)?v=!1:v=d>=mte==!!c;var g=t+n*G2(o),m=r+i*V2(o);this._start&&this._add("M",g,m);var y=Math.round(a*mFe);if(h){var _=1/this._p,b=(c?1:-1)*(Ku-_);this._add("A",n,i,y,1,+c,t+n*G2(o+b),r+i*V2(o+b)),_>.01&&this._add("A",n,i,y,0,+c,g,m)}else{var S=t+n*G2(s),T=r+i*V2(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 CFe(e){return""}function bj(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 AFe(o,s)+(o!=="style"?On(l):l||"")+(a?""+r+se(a,function(u){return n(u)}).join(r)+r:"")+CFe(o)}return n(e)}function MFe(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 FI(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function F6(e,t,r,n){return Gr("svg","root",{width:e,height:t,xmlns:xte,"xmlns:xlink":_te,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var PFe=0;function wte(){return PFe++}var V6={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"},ic="transform-origin";function LFe(e,t,r){var n=re({},e.shape);re(n,t),e.buildPath(r,n);var i=new yte;return i.reset(VK(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function kFe(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[ic]=r+"px "+n+"px")}var IFe={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Ste(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function OFe(e,t,r){var n=e.shape.paths,i={},a,o;if(R(n,function(l){var u=FI(r.zrId);u.animation=!0,RT(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 x=f[y].animation;x.indexOf(o)>=0&&(a=x)}}}),!!a){t.d=!1;var s=Ste(i,r);return a.replace(o,s)}}function G6(e){return ve(e)?V6[e]?"cubic-bezier("+V6[e]+")":nN(e)?e:"":""}function RT(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof u0){var s=OFe(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Ge=Ste(M,r);return Ge+" "+x[0]+" both"}}for(var m in l){var s=g(l[m]);s&&o.push(s)}if(o.length){var y=r.zrId+"-cls-"+wte();r.cssNodes["."+y]={animation:o.join(",")},t.class=y}}function EFe(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};W6(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=J1(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),W6(n,t,r)}}function W6(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+wte(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var Ay=Math.round;function Tte(e){return e&&ve(e.src)}function Ate(e){return e&&Ae(e.toDataURL)}function wj(e,t,r,n){wFe(function(i,a){var o=i==="fill"||i==="stroke";o&&FK(a)?Mte(t,e,i,n):o&&aN(a)?Pte(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),$Fe(r,e,n)}function Sj(e,t){var r=qK(t);r&&(r.each(function(n,i){n!=null&&(e[($6+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[$6+"silent"]="true"))}function H6(e){return Ll(e[0]-1)&&Ll(e[1])&&Ll(e[2])&&Ll(e[3]-1)}function DFe(e){return Ll(e[4])&&Ll(e[5])}function Tj(e,t,r){if(t&&!(DFe(t)&&H6(t))){var n=1e4;e.transform=H6(t)?"translate("+Ay(t[4]*n)/n+" "+Ay(t[5]*n)/n+")":pje(t)}}function U6(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.";_n(h,m),_n(d,m)}else if(h==null||d==null){var y=function(I,O){if(I){var D=I.elm,N=h||O.width,B=d||O.height;I.tag==="pattern"&&(u?(B=1,N/=a.width):c&&(N=1,B/=a.height)),I.attrs.width=N,I.attrs.height=B,D&&(D.setAttribute("width",N),D.setAttribute("height",B))}},x=vN(v,null,e,function(I){l||y(A,I),y(f,I)});x&&x.width&&x.height&&(h=h||x.width,d=d||x.height)}f=Gr("image","img",{href:v,width:h,height:d}),o.width=h,o.height=d}else i.svgElement&&(f=Ce(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=GK(i);T&&(o.patternTransform=T);var A=Gr("pattern","",o,[f]),M=bj(A),P=n.patternCache,k=P[M];k||(k=n.zrId+"-p"+n.patternIdx++,P[M]=k,o.id=k,A=n.defs[k]=Gr("pattern",k,o,[f])),t[r]=vT(k)}}function FFe(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,[Cte(e,r)])}t["clip-path"]=vT(a)}function X6(e){return document.createTextNode(e)}function fc(e,t,r){e.insertBefore(t,r)}function q6(e,t){e.removeChild(t)}function K6(e,t){e.appendChild(t)}function Lte(e){return e.parentNode}function kte(e){return e.nextSibling}function G2(e,t){e.textContent=t}var Q6=58,VFe=120,GFe=Gr("","");function VI(e){return e===void 0}function vo(e){return e!==void 0}function WFe(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 mg(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function Cy(e){var t,r=e.children,n=e.tag;if(vo(n)){var i=e.elm=bte(n);if(Aj(GFe,e),ie(r))for(t=0;ta?(v=r[l+1]==null?null:r[l+1].elm,Ite(e,v,r,i,l)):kw(e,t,n,a))}function xh(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(Aj(e,t),VI(t.text)?vo(n)&&vo(i)?n!==i&&HFe(r,n,i):vo(i)?(vo(e.text)&&G2(r,""),Ite(r,null,i,0,i.length-1)):vo(n)?kw(r,n,0,n.length-1):vo(e.text)&&G2(r,""):e.text!==t.text&&(vo(n)&&kw(r,n,0,n.length-1),G2(r,t.text)))}function UFe(e,t){if(mg(e,t))xh(e,t);else{var r=e.elm,n=Lte(r);Cy(t),n!==null&&(fc(n,t.elm,kte(r)),kw(n,[e],0,0))}return t}var ZFe=0,YFe=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=J6(),this.configLayer=J6(),this.storage=r,this._opts=n=re({},n),this.root=t,this._id="zr"+ZFe++,this._oldVNode=F6(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=bte("svg");Aj(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",UFe(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return Y6(t,FI(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=FI(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=XFe(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=MFe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=Gr("style","stl",{},[],c);o.push(f)}}return F6(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},bj(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}}B.prevElClipPaths&&y.restore()};if(x)if(x.length===0)P=m.__endIndex;else for(var I=d.dpr,O=0;O0&&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?s_:0),this._needsManuallyCompositing),c.__builtin__||uT("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&Si&&!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,R(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var n=this._layerConfig;n[t]?We(n[t],r,!0):n[t]=r;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill=K.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}(St);function ev(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=qd(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 p0=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=nVe,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(){$s(this.childAt(0))},t.prototype.downplay=function(){Fs(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),pa(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,Nt(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 x=a&&a.itemModel?a.itemModel:r.getItemModel(n),b=x.getModel("emphasis");u=b.getModel("itemStyle").getItemStyle(),f=x.getModel(["select","itemStyle"]).getItemStyle(),c=x.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),v=b.get("disabled"),g=Nr(x),m=b.getShallow("scale"),y=x.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=Tf(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),y&&s.attr("cursor",y);var A=r.getItemVisual(n,"style"),M=A.fill;if(s instanceof Xr){var P=s.style;s.useStyle(re({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},A))}else s.__isEmptyBrush?s.useStyle(re({},A)):s.useStyle(A),s.style.decal=null,s.setColor(M,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var k=r.getItemVisual(n,"liftZ"),I=this._z2;k!=null?I==null&&(this._z2=s.z2,s.z2+=k):I!=null&&(s.z2=I,this._z2=null);var O=o&&o.useNameLabel;Ur(s,g,{labelFetcher:l,labelDataIndex:n,defaultText:D,inheritColor:M,defaultOpacity:A.opacity});function D($){return O?r.getName($):ev(r,$)}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 B=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;N.scaleX=this._sizeX*B,N.scaleY=this._sizeY*B,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&&ru(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();ru(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return Vv(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Me);function nVe(e,t){this.parent.drift(e,t)}function H2(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 rG(e){return e!=null&&!Le(e)&&(e={isIgnore:e}),e||{}}function nG(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 g0=function(){function e(t){this.group=new Me,this._SymbolCtor=t||p0}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=rG(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=nG(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(H2(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(!H2(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=nG(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=rG(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 Dte(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 aVe(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 oVe(e,t,r,n,i,a,o,s){for(var l=aVe(e,t),u=[],c=[],f=[],h=[],d=[],v=[],g=[],m=Ete(i,t,o),y=e.getLayout("points")||[],x=t.getLayout("points")||[],b=0;b=i||g<0)break;if(zc(y,x)){if(l){g+=a;continue}break}if(g===r)e[a>0?"moveTo":"lineTo"](y,x),f=y,h=x;else{var b=y-u,S=x-c;if(b*b+S*S<.5){g+=a;continue}if(o>0){for(var T=g+a,A=t[T*2],M=t[T*2+1];A===y&&M===x&&m=n||zc(A,M))d=y,v=x;else{I=A-u,O=M-c;var B=y-u,$=A-y,F=x-c,G=M-x,z=void 0,U=void 0;if(s==="x"){z=Math.abs(B),U=Math.abs($);var H=I>0?1:-1;d=y-H*z*o,v=x,D=y+H*U*o,N=x}else if(s==="y"){z=Math.abs(F),U=Math.abs(G);var Y=O>0?1:-1;d=y,v=x-Y*z*o,D=y,N=x+Y*U*o}else z=Math.sqrt(B*B+F*F),U=Math.sqrt($*$+G*G),k=U/(U+z),d=y-I*o*(1-k),v=x-O*o*(1-k),D=y+I*o*k,N=x+O*o*k,D=sl(D,ll(A,y)),N=sl(N,ll(M,x)),D=ll(D,sl(A,y)),N=ll(N,sl(M,x)),I=D-y,O=N-x,d=y-I*z/U,v=x-O*z/U,d=sl(d,ll(u,y)),v=sl(v,ll(c,x)),d=ll(d,sl(u,y)),v=ll(v,sl(c,x)),I=y-d,O=x-v,D=y+I*U/z,N=x+O*U/z}e.bezierCurveTo(f,h,d,v,y,x),f=D,h=N}else e.lineTo(y,x)}u=y,c=x,g+=a}return m}var Nte=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),sVe=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:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new Nte},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&zc(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++],x=a[f++];var T=u?K1(s,d,g,y,r,c):K1(l,v,m,x,r,c);if(T>0)for(var A=0;A=0){var S=u?$r(l,v,m,x,M):$r(s,d,g,y,M);return u?[r,S]:[S,r]}}s=y,l=x;break}}},t}(rt),lVe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Nte),jte=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 lVe},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&&zc(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 fVe(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=cVe(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";R(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 x=new _f(0,0,0,0,h,!0);return x[i]=g,x[i+"2"]=m,x}}}function hVe(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&dVe(a,t))){var o=t.mapDimension(a.dim),s={};return R(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function dVe(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 vVe(e,t){return isNaN(e)||isNaN(t)}function pVe(e){for(var t=e.length/2;t>0&&vVe(e[t*2-2],e[t*2-1]);t--);return t-1}function lG(e,t){return[e[t*2],e[t*2+1]]}function gVe(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 zte(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,F,G,z);var H=sG(r.get("smooth")),Y=r.get("smoothMonotone");if(v.setShape({smooth:H,smoothMonotone:Y,connectNulls:M}),g){var Z=s.getCalculationInfo("stackedOnSeries"),J=0;g.useStyle(Pe(u.getAreaStyle(),{fill:D,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Z&&(J=sG(Z.get("smooth"))),g.setShape({smooth:H,stackedOnSmooth:J,smoothMonotone:Y,connectNulls:M}),Dr(g,r,"areaStyle"),De(g).seriesIndex=r.seriesIndex,Gt(g,F,G,z)}var ae=this._changePolyState;s.eachItemGraphicEl(function(ce){ce&&(ce.onHoverStateChange=ae)}),this._polyline.onHoverStateChange=ae,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=I,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=ef(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 p0(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 _t.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=ef(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 _t.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;lw(this._polyline,r),n&&lw(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new sVe({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 jte({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");Ae(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=Ae(f)?f(null):f;r.eachItemGraphicEl(function(d,v){var g=d;if(g){var m=[d.x,d.y],y=void 0,x=void 0,b=void 0;if(i)if(o){var S=i,T=n.pointToCoord(m);a?(y=S.startAngle,x=S.endAngle,b=-T[1]/180*Math.PI):(y=S.r0,x=S.r,b=T[0])}else{var A=i;a?(y=A.x,x=A.x+A.width,b=d.x):(y=A.y+A.height,x=A.y,b=d.y)}var M=x===y?0:(b-y)/(x-y);l&&(M=1-M);var P=Ae(f)?f(v):c*M+h,k=g.getSymbolPath(),I=k.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),I&&I.animateFrom({style:{opacity:0}},{duration:300,delay:P}),k.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(zte(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=pVe(l);c>=0&&(Ur(s,Nr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(f,h,d){return d!=null?Ote(o,d):ev(o,f)},enableTextSetter:!0},mVe(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(),x=m.inverse,b=n.shape,S=x?y?b.x:b.y+b.height:y?b.x+b.width:b.y,T=(y?g:0)*(x?-1:1),A=(y?0:-g)*(x?-1:1),M=y?"x":"y",P=gVe(f,S,M),k=P.range,I=k[1]-k[0],O=void 0;if(I>=1){if(I>1&&!d){var D=lG(f,k[0]);u.attr({x:D[0]+T,y:D[1]+A}),o&&(O=h.getRawValue(k[0]))}else{var D=c.getPointOn(S,M);D&&u.attr({x:D[0]+T,y:D[1]+A});var N=h.getRawValue(k[0]),B=h.getRawValue(k[1]);o&&(O=cQ(i,v,N,B,P.t))}a.lastFrameIndex=k[0]}else{var $=r===1||a.lastFrameIndex>0?k[0]:0,D=lG(f,$);o&&(O=h.getRawValue($)),u.attr({x:D[0]+T,y:D[1]+A})}if(o){var F=jv(u);typeof F.setLabelText=="function"&&F.setLabelText(O)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,f=r.hostModel,h=oVe(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=ul(h.stackedOnCurrent,h.current,i,o,l),d=ul(h.current,null,i,o,l),m=ul(h.stackedOnNext,h.next,i,o,l),g=ul(h.next,null,i,o,l)),oG(d,g)>3e3||c&&oG(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 x=[],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;ve(a)?v=xVe[a]:Ae(a)&&(v=a),v&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,v,_Ve))}}}}}function bVe(e){e.registerChartView(yVe),e.registerSeriesModel(rVe),e.registerLayout(y0("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,$te("line"))}var My=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 Yo(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)R(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 x=void 0,b=void 0,S=1,T=0;Tm){b=(A+x)/2;break}T===1&&(S=M-v[0].tickValue)}b==null&&(x?x&&(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}(St);St.registerClass(My);var wVe=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 Yo(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=yu(My.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:K.color.primary,borderWidth:2}},realtimeSort:!1}),t}(My),SVe=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}(),Iw=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 SVe},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){Cs(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}(_t),uG={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=Z2(t.x,e.x),s=Y2(t.x+t.width,i),l=Z2(t.y,e.y),u=Y2(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=Y2(t.r,e.r),a=Z2(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}},cG={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Xe({shape:re({},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?Iw:bn,c=new u({shape:n,z2:1});c.name="item";var f=Fte(i);if(c.calculateTextPosition=TVe(f,{isRoundCap:u===Iw}),a){var h=c.shape,d=i?"r":"endAngle",v={};h[d]=i?n.r0:n.startAngle,v[d]=n[d],(s?lt:Nt)(c,{shape:v},a)}return c}};function PVe(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 fG(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:Nt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?lt:Nt)(r,{shape:u},c,i)}function hG(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 IVe(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function Fte(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 vG(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=Ao(n.getModel("itemStyle"),c,!0);re(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:ev(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,AVe(e,m==="outside"?d:m,Fte(o),n.get(["label","rotate"]))}KQ(g,v,a.getRawValue(r),function(x){return Ote(t,x)});var y=n.getModel(["emphasis"]);Gt(e,y.get("focus"),y.get("blurScope"),y.get("disabled")),Dr(e,n),IVe(i)&&(e.style.fill="none",e.style.stroke="none",R(e.states,function(x){x.style&&(x.style.fill=x.style.stroke="none")}))}function OVe(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 EVe=function(){function e(){}return e}(),pG=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 EVe},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 DVe(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 Vte(e,t,r){if(nu(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 NVe(e,t,r){var n=e.type==="polar"?bn:Xe;return new n({shape:Vte(t,r,e),silent:!0,z2:0})}function jVe(e){e.registerChartView(MVe),e.registerSeriesModel(wVe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Be(Hee,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Uee("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,$te("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 yG=Math.PI*2,f_=Math.PI/180;function RVe(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=pJ(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=o.viewRect,h=-n.get("startAngle")*f_,d=n.get("endAngle"),v=n.get("padAngle")*f_;d=d==="auto"?h-yG:-d*f_;var g=n.get("minAngle")*f_,m=g+v,y=0;i.each(a,function(G){!isNaN(G)&&y++});var x=i.getSum(a),b=Math.PI/(x||y)*2,S=n.get("clockwise"),T=n.get("roseType"),A=n.get("stillShowZeroSum"),M=i.getDataExtent(a);M[0]=0;var P=S?1:-1,k=[h,d],I=P*v/2;wT(k,!S),h=k[0],d=k[1];var O=Gte(n);O.startAngle=h,O.endAngle=d,O.clockwise=S,O.cx=s,O.cy=l,O.r=u,O.r0=c;var D=Math.abs(d-h),N=D,B=0,$=h;if(i.setLayout({viewRect:f,r:u}),i.each(a,function(G,z){var U;if(isNaN(G)){i.setItemLayout(z,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?U=x===0&&A?b:G*b:U=D/y,UU?(Y=$+P*U/2,Z=Y):(Y=$+I,Z=H-I),i.setItemLayout(z,{angle:U,startAngle:Y,endAngle:Z,clockwise:S,cx:s,cy:l,r0:c,r:T?gt(G,M,[c,u]):u}),$=H}),Nr?y:m,T=Math.abs(b.label.y-r);if(T>=S.maxY){var A=b.label.x-t-b.len2*i,M=n+b.len,P=Math.abs(A)e.unconstrainedWidth?null:h:null;n.setStyle("width",d)}Hte(a,n)}}}function Hte(e,t){_G.rect=e,pte(_G,t,$Ve)}var $Ve={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},_G={};function X2(e){return e.position==="center"}function FVe(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*BVe,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function d(A){A.ignore=!0}function v(A){if(!A.ignore)return!0;for(var M in A.states)if(A.states[M].ignore===!1)return!0;return!1}t.each(function(A){var M=t.getItemGraphicEl(A),P=M.shape,k=M.getTextContent(),I=M.getTextGuideLine(),O=t.getItemModel(A),D=O.getModel("label"),N=D.get("position")||O.get(["emphasis","label","position"]),B=D.get("distanceToLabelLine"),$=D.get("alignTo"),F=de(D.get("edgeDistance"),u),G=D.get("bleedMargin");G==null&&(G=Math.min(u,h)>200?10:2);var z=O.getModel("labelLine"),U=z.get("length");U=de(U,u);var H=z.get("length2");if(H=de(H,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Z>0?"left":"right"}var Fe=Math.PI,Ye=0,vt=D.get("rotate");if(ot(vt))Ye=vt*(Fe/180);else if(N==="center")Ye=0;else if(vt==="radial"||vt===!0){var Ft=Z<0?-Y+Fe:-Y;Ye=Ft}else if(vt==="tangential"&&N!=="outside"&&N!=="outer"){var nr=Math.atan2(Z,J);nr<0&&(nr=Fe*2+nr);var jn=J>0;jn&&(nr=Fe+nr),Ye=nr-Fe}if(a=!!Ye,k.x=ae,k.y=ce,k.rotation=Ye,k.setStyle({verticalAlign:"middle"}),xe){k.setStyle({align:Ge});var Jn=k.states.select;Jn&&(Jn.x+=k.x,Jn.y+=k.y)}else{var qr=new Oe(0,0,0,0);Hte(qr,k),r.push({label:k,labelLine:I,position:N,len:U,len2:H,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new Ie(Z,J),linePoints:ge,textAlign:Ge,labelDistance:B,labelAlignTo:$,edgeDistance:F,bleedMargin:G,rect:qr,unconstrainedWidth:qr.width,labelStyleWidth:k.style.width})}M.setTextConfig({inside:xe})}}),!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}(_t);function Zv(e,t,r){t=ie(t)&&{coordDimensions:t}||re({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=Gv(n,t).dimensions,a=new Dn(i,e);return a.initData(n,r),a}var Yv=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}(),WVe=Je(),Ute=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 Yv(pe(this.getData,this),pe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Zv(this,{coordDimensions:["value"],encodeDefaulter:Be(UN,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=WVe(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=eQ(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){Jc(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}(St);RBe({fullType:Ute.type,getCoord2:function(e){return e.getShallow("center")}});function HVe(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 UVe(e){e.registerChartView(GVe),e.registerSeriesModel(Ute),oee("pie",e.registerAction),e.registerLayout(Be(RVe,"pie")),e.registerProcessor(Uv("pie")),e.registerProcessor(HVe("pie"))}var ZVe=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 Yo(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:K.color.primary}},universalTransition:{divideShape:"clone"}},t}(St),Zte=4,YVe=function(){function e(){}return e}(),XVe=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 YVe},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}(),KVe=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=y0("").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 qVe:new g0,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}(_t),Yte={left:0,right:0,top:0,bottom:0},Ow=["25%","25%"],QVe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=wf(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Fo(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Fo(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:Yte,outerBoundsContain:"all",outerBoundsClampWidth:Ow[0],outerBoundsClampHeight:Ow[1],backgroundColor:K.color.transparent,borderWidth:1,borderColor:K.color.neutral30},t}(Qe),WI=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",tr).models[0]},t.type="cartesian2dAxis",t}(Qe);fr(WI,Hv);var Xte={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:K.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:K.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:K.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[K.color.backgroundTint,K.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:K.color.neutral00,borderColor:K.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},JVe=We({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},Xte),Cj=We({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:K.color.axisMinorSplitLine,width:1}}},Xte),e6e=We({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Cj),t6e=Pe({logBase:10},Cj);const qte={category:JVe,value:Cj,time:e6e,log:t6e};var r6e={value:1,category:1,time:1,log:1},HI=null;function n6e(e){HI||(HI=e)}function x0(){return HI}function tv(e,t,r,n){R(r6e,function(i,a){var o=We(We({},qte[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=my(this),d=h?wf(c):{},v=f.getTheme();We(c,v.get(a+"Axis")),We(c,this.getDefaultOption()),c.type=bG(c),h&&Fo(c,d,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=Sy.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=x0();return f?f.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",bG)}function bG(e){return e.type||(e.data?"category":"value")}var i6e=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}(),UI=["x","y"];function wG(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var a6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=UI,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!wG(r)||!wG(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=da([],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 ur(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 ur(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}(i6e),Kte=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}(_a),BT="expandAxisBreak",Qte="collapseAxisBreak",Jte="toggleAxisBreak",Mj="axisbreakchanged",o6e={type:BT,event:Mj,update:"update",refineEvent:Pj},s6e={type:Qte,event:Mj,update:"update",refineEvent:Pj},l6e={type:Jte,event:Mj,update:"update",refineEvent:Pj};function Pj(e,t,r,n){var i=[];return R(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function u6e(e){e.registerAction(o6e,t),e.registerAction(s6e,t),e.registerAction(l6e,t);function t(r,n){var i=[],a=ad(n,r);function o(s,l){R(a[s],function(u){var c=u.updateAxisBreaks(r);R(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 kl=Math.PI,c6e=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],f6e=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],rv=Je(),ere=Je(),tre=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 h6e(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=Lj(e.axisName)&&Jd(e.nameLocation);R(n,function(v){var g=Vo(v);if(!(!g||g.label.ignore)){o.push(g);var m=a.transGroup;l&&(m.transform?da(Vp,m.transform):n0(Vp),g.transform&&Fa(Vp,Vp,g.transform),Oe.copy(h_,g.localRect),h_.applyTransform(Vp),s?s.union(h_):Oe.copy(s=new Oe(0,0,0,0),h_))}});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 Vp=Wr(),h_=new Oe(0,0,0,0),rre=function(e,t,r,n,i,a){if(Jd(e.nameLocation)){var o=a.stOccupiedRect;o&&nre(cFe({},o,a.transGroup.transform),n,i)}else ire(a.labelInfoList,a.dirVec,n,i)};function nre(e,t,r){var n=new Ie;jT(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&RI(t,n)}function ire(e,t,r,n){for(var i=Ie.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):Ud(i-kl)?(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}(),d6e=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],v6e={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&&(ur(c,c,u),ur(f,f,u));var d=re({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())x0().buildAxisBreakLine(n,i,a,v);else{var g=new yr(re({shape:{x1:c[0],y1:c[1],x2:f[0],y2:f[1]}},v));Xd(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"]);ve(m)&&(m=[m,m]),(ve(y)||ot(y))&&(y=[y,y]);var x=Tf(n.get(["axisLine","symbolOffset"])||0,y),b=y[0],S=y[1];R([{rotate:e.rotation+Math.PI/2,offset:x[0],r:0},{rotate:e.rotation-Math.PI/2,offset:x[1],r:Math.sqrt((c[0]-f[0])*(c[0]-f[0])+(c[1]-f[1])*(c[1]-f[1]))}],function(T,A){if(m[A]!=="none"&&m[A]!=null){var M=xr(m[A],-b/2,-S/2,b,S,d.stroke,!0),P=T.r+T.offset,k=h?f:c;M.attr({rotation:T.rotate,x:k[0]+P*Math.cos(e.rotation),y:k[1]-P*Math.sin(e.rotation),silent:!0,z2:11}),i.add(M)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=TG(t,i,s);l&&SG(e,t,r,n,i,a,o,Ya.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=TG(t,i,s);l&&SG(e,t,r,n,i,a,o,Ya.determine);var u=y6e(e,i,a,n);m6e(e,t.labelLayoutList,u),x6e(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(Lj(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 x=Wr();y.transform(qs(x,x,e.rotation));var b=n.get("nameRotate");b!=null&&(b=b*kl/180);var S,T;Jd(c)?S=Hn.innerTextLayout(e.rotation,b??e.rotation,f):(S=p6e(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 A=h.getFont(),M=n.get("nameTruncate",!0)||{},P=M.ellipsis,k=nn(e.raw.nameTruncateMaxWidth,M.maxWidth,T),I=s.nameMarginLevel||0,O=new at({x:m.x,y:m.y,rotation:S.rotation,silent:Hn.isLabelSilent(n),style:Mt(h,{text:u,font:A,overflow:"truncate",width:k,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:O,componentModel:n,itemName:u}),O.__fullText=u,O.anid="name",n.get("triggerEvent")){var D=Hn.makeAxisEventDataBase(n);D.targetType="axisName",D.name=u,De(O).eventData=D}a.add(O),O.updateTransform(),t.nameEl=O;var N=l.nameLayout=Vo({label:O,priority:O.z2,defaultAttr:{ignore:O.ignore},marginDefault:Jd(c)?c6e[I]:f6e[I]});if(l.nameLocation=c,i.add(O),O.decomposeTransform(),e.shouldNameMoveOverlap&&N){var B=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,N,y,B)}}}};function SG(e,t,r,n,i,a,o,s){ore(t)||_6e(e,t,i,s,n,o);var l=t.labelLayoutList;b6e(e,n,l,a),T6e(n,e.rotation,l);var u=e.optionHideOverlap;g6e(n,l,u),u&>e(ht(l,function(c){return c&&!c.label.ignore})),h6e(e,r,n,l)}function p6e(e,t,r,n){var i=lN(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return Ud(i-kl/2)?(o=l?"bottom":"top",a="center"):Ud(i-kl*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",ikl/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function g6e(e,t,r){if(Jee(e.axis))return;function n(s,l,u){var c=Vo(t[l]),f=Vo(t[u]);if(!(!c||!f)){if(s===!1||c.suggestIgnore){yg(c.label);return}if(f.suggestIgnore){yg(f.label);return}var h=.1;if(!r){var d=[0,0,0,0];c=BI({marginForce:d},c),f=BI({marginForce:d},f)}jT(c,f,null,{touchThreshold:h})&&yg(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 m6e(e,t,r){e.showMinorTicks||R(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(v)&&isFinite(u[0]);)d=D2(d),v=u[1]-d*o;else{var m=e.getTicks().length-1;m>o&&(d=D2(d));var y=d*o;g=Math.ceil(u[1]/d)*d,v=mr(g-y),v<0&&u[0]>=0?(v=0,g=mr(y)):g>0&&u[1]<=0&&(g=0,v=-mr(y))}var x=(i[0].value-a[0].value)/s,b=(i[o].value-a[o].value)/s;n.setExtent.call(e,v+d*x,g+d*b),n.setInterval.call(e,d),(x||b)&&n.setNiceExtent.call(e,v+d,g-d)}var CG=[[3,1],[0,2]],P6e=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=UI,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;II(g)&&v.get("alignTicks")&&v.get("interval")==null?c.push(d):(sf(g,v),II(g)&&(s=d))}c.length&&(s||(s=c.pop(),sf(s.scale,s.model)),R(c,function(m){sre(m.scale,m.model,s.scale)}))}}i(n.x),i(n.y);var a={};R(n.x,function(o){MG(n,"y",o,a)}),R(n.y,function(o){MG(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(YI(o,a),!n){var u=I6e(a,s,o,l,r),c=void 0;if(l)XI?(XI(this._axesList,a),YI(o,a)):c=kG(a.clone(),"axisLabel",null,a,o,u,i);else{var f=O6e(t,a,i),h=f.outerBoundsRect,d=f.parsedOuterBoundsContain,v=f.outerBoundsClamp;h&&(c=kG(h,d,v,a,o,u,i))}lre(a,o,Ya.determine,null,c,i)}R(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]}Le(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return nf(n,s,!0,!0,r),YI(i,n),l;function u(h){R(i[Re[h]],function(d){if(Ty(d.model)){var v=a.ensureRecord(d.model),g=v.labelInfoList;if(g)for(var m=0;m0&&!mn(d)&&d>1e-4&&(h/=d),h}}function I6e(e,t,r,n,i){var a=new tre(E6e);return R(r,function(o){return R(o,function(s){if(Ty(s.model)){var l=!n;s.axisBuilder=C6e(e,t,s.model,i,a,l)}})}),a}function lre(e,t,r,n,i,a){var o=r===Ya.determine;R(t,function(u){return R(u,function(c){Ty(c.model)&&(M6e(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[Re[1-u]]=e[Tr[u]]<=a.refContainer[Tr[u]]*.5?0:1-u===1?2:1}R(t,function(u,c){return R(u,function(f){Ty(f.model)&&((n==="all"||o)&&f.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&f.axisBuilder.build({axisLine:!0}))})})}function O6e(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)||Yte,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||Ve(["all","axisLabel"],a)<0?o="all":o=a;var s=[iw(be(e.get("outerBoundsClampWidth",!0),Ow[0]),t.width),iw(be(e.get("outerBoundsClampHeight",!0),Ow[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var E6e=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";rre(e,t,r,n,i,a),Jd(e.nameLocation)||R(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&ire(s.labelInfoList,s.dirVec,n,i)})};function D6e(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return N6e(r,e,t),r.seriesInvolved&&R6e(r,e),r}function N6e(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];R(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Py(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,f=c.getModel("tooltip",n);if(R(s.getAxes(),Be(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)&&R(v.baseAxes,Be(g,d?"cross":!0,h)),d&&R(v.otherAxes,Be(g,"cross",!1))}function g(m,y,x){var b=x.model.getModel("axisPointer",i),S=b.get("show");if(!(!S||S==="auto"&&!m&&!qI(b))){y==null&&(y=b.get("triggerTooltip")),b=m?j6e(x,f,i,t,m,y):b;var T=b.get("snap"),A=b.get("triggerEmphasis"),M=Py(x.model),P=y||T||x.type==="category",k=e.axesInfo[M]={key:M,axis:x,coordSys:s,axisPointerModel:b,triggerTooltip:y,triggerEmphasis:A,involveSeries:P,snap:T,useHandle:qI(b),seriesModels:[],linkGroup:null};u[M]=k,e.seriesInvolved=e.seriesInvolved||P;var I=B6e(a,x);if(I!=null){var O=o[I]||(o[I]={axesInfo:{}});O.axesInfo[M]=k,O.mapper=a[I].mapper,k.linkGroup=O}}}})}function j6e(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};R(s,function(h){l[h]=Ce(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 tt(l,r,n))}function R6e(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||R(e.coordSysAxesInfo[Py(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 B6e(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function z6e(e){var t=kj(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=qI(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 U6e=Je();function EG(e,t,r,n){if(e instanceof Kte){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?vre(r,o,u,n):Z6e(e,t,r,n,o,l):r}function vre(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 Z6e(e,t,r,n,i,a){var o=U6e(e);o.items||(o.items=[]);var s=o.items,l=DG(s,t,r,n,i,a,1),u=DG(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||f&&h>f/2-n?vre(r,i,f,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function DG(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=We(Ce(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(ve(c)){var y=m.name;m.name=c.replace("{value}",y??"")}else Ae(c)&&(m.name=c(m.name,m));var x=new tt(m,null,this.ecModel);return fr(x,Hv.prototype),x.mainType="radar",x.componentIndex=this.componentIndex,x},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:K.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:We({lineStyle:{color:K.color.neutral20}},Gp.axisLine),axisLabel:d_(Gp.axisLabel,!1),axisTick:d_(Gp.axisTick,!1),splitLine:d_(Gp.splitLine,!0),splitArea:d_(Gp.splitArea,!0),indicator:[]},t}(Qe),rGe=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 Hn(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});R(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=ie(h)?h:[h],g=ie(d)?d:[d],m=[],y=[];function x($,F,G){var z=G%F.length;return $[z]=$[z]||[],z}if(a==="circle")for(var b=i[0].getTicksCoords(),S=n.cx,T=n.cy,A=0;A3?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(!(RG(this._zr,"globalPan")||Wp(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)&&(zs(a.event),a.__ecRoamConsumed=!0,BG(r,n,i,a,o))},t}(ya);function Wp(e){return e.__ecRoamConsumed}var cGe=Je();function zT(e){var t=cGe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Hp(e,t,r,n){for(var i=zT(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=_re(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=Q2[s];if(c&&ye(Q2,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=VG[s];if(d&&ye(VG,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 Zd({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Wi(r,n),vi(t,n,this._defsUsePending,!1,!1),vGe(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(){Q2={g:function(t,r){var n=new Me;return Wi(r,n),vi(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Xe;return Wi(r,n),vi(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 Zo;return Wi(r,n),vi(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 yr;return Wi(r,n),vi(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 s0;return Wi(r,n),vi(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=HG(n));var a=new wn({shape:{points:i||[]},silent:!0});return Wi(r,a),vi(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=HG(n));var a=new on({shape:{points:i||[]},silent:!0});return Wi(r,a),vi(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new Xr;return Wi(r,n),vi(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),vi(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),vi(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=jQ(n);return Wi(r,i),vi(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),VG={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 _f(t,r,n,i);return GG(e,a),WG(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 SN(t,r,n);return GG(e,i),WG(e,i),i}};function GG(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function WG(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={};xre(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=En(o),u=l&&l[3];u&&(l[3]*=Ts(s),o=sa(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 HG(e){for(var t=FT(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=FT(o);switch(i=i||Wr(),s){case"translate":Ua(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":dT(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":qs(i,i,-parseFloat(l[0])*J2,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*J2);Fa(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*J2);Fa(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 ZG=/([^\s:;]+)\s*:\s*([^:;]+)/g;function xre(e,t,r){var n=e.getAttribute("style");if(n){ZG.lastIndex=0;for(var i;(i=ZG.exec(n))!=null;){var a=i[1],o=ye(Dw,a)?Dw[a]:null;o&&(t[o]=i[2]);var s=ye(Nw,a)?Nw[a]:null;s&&(r[s]=i[2])}}}function _Ge(e,t,r){for(var n=0;n<$G.length;n++){var i=$G[n],a=e.getAttribute(i);a!=null&&(t[Dw[i]]=a)}for(var n=0;n0,x={api:n,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:y,isGeo:o,transformInfoRaw:h};l.resourceType==="geoJSON"?this._buildGeoJSON(x):l.resourceType==="geoSVG"&&this._buildSVG(x),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&&(bre(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 QG(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 JG(e,t,r,n,i){e.data||Qs({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function eW(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&&L5e(t,i,r),o}function tW(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(),R(e,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=K.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:K.color.tertiary},itemStyle:{borderWidth:.5,borderColor:K.color.border,areaColor:K.color.background},emphasis:{label:{show:!0,color:K.color.primary},itemStyle:{areaColor:K.color.highlight}},select:{label:{show:!0,color:K.color.primary},itemStyle:{color:K.color.highlight}},nameProperty:"name"},t}(St);function $Ge(e,t){var r={};return R(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=x,b.height=x/g):(b.height=x,b.width=x*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=gJ(e,b,g)}this.setViewRect(b.x,b.y,b.width,b.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function WGe(e,t){R(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var HGe=function(){function e(){this.dimensions=Sre}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 JI(l+s,l,re({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=aW,u.resize(o,r)}),t.eachSeries(function(o){h0({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",tr).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)}}),R(a,function(o,s){var l=se(o,function(c){return c.get("nameMap")}),u=new JI(s,s,re({nameMap:cT(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=nn.apply(null,se(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=aW,u.resize(o[0],r),R(o,function(c){c.coordinateSystem=u,WGe(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 KGe(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){JGe(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=eWe(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function QGe(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function oW(e){return arguments.length?e:nWe}function xg(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function JGe(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 eWe(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=eM(s),a=tM(a),s&&a;){i=eM(i),o=tM(o),i.hierNode.ancestor=e;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+n(s,a);h>0&&(rWe(tWe(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&&!eM(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!tM(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function eM(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function tM(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function tWe(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function rWe(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 nWe(e,t){return e.parentNode===t.parentNode?1:2}var iWe=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),aWe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new iWe},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=de(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;vx.x,T||(S=S-Math.PI));var M=T?"left":"right",P=s.getModel("label"),k=P.get("rotate"),I=k*(Math.PI/180),O=m.getTextContent();O&&(m.setTextConfig({position:P.get("position")||M,rotation:k==null?-S:I,origin:"center"}),O.setStyle("verticalAlign","middle"))}var D=s.get(["emphasis","focus"]),N=D==="relative"?Gd(o.getAncestorsIndices(),o.getDescendantIndices()):D==="ancestor"?o.getAncestorsIndices():D==="descendant"?o.getDescendantIndices():null;N&&(De(r).focus=N),sWe(i,o,c,r,v,d,g,n),r.__edge&&(r.onHoverStateChange=function(B){if(B!=="blur"){var $=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);$&&$.hoverState===o0||lw(r.__edge,B)}})}function sWe(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 Ev({shape:eO(c,f,h,i,i)})),lt(g,{shape:eO(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=[],x=0;xr&&(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(ve(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 Lre(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function Bj(e,t){var r=Lre(e);return Ve(r,t)>=0}function VT(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 gWe=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 tt(i,this,this.ecModel),o=Rj.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 Ar("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=VT(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:K.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(St);function mWe(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 yWe(e,t){e.eachSeriesByType("tree",function(r){xWe(r,t)})}function xWe(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=oW(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=oW());var l=e.getData().tree.root,u=l.children[0];if(u){qGe(l),mWe(u,KGe,s),l.hierNode.modifier=-u.hierNode.prelim,Yp(u,QGe);var c=u,f=u,h=u;Yp(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,x=0;if(i==="radial")g=a/(f.getLayout().x+d+v),m=o/(h.depth-1||1),Yp(u,function(S){y=(S.getLayout().x+v)*g,x=(S.depth-1)*m;var T=xg(y,x);S.setLayout({x:T.x,y:T.y,rawX:y,rawY:x},!0)});else{var b=e.getOrient();b==="RL"||b==="LR"?(m=o/(f.getLayout().x+d+v),g=a/(h.depth-1||1),Yp(u,function(S){x=(S.getLayout().x+v)*m,y=b==="LR"?(S.depth-1)*g:a-(S.depth-1)*g,S.setLayout({x:y,y:x},!0)})):(b==="TB"||b==="BT")&&(g=a/(f.getLayout().x+d+v),m=o/(h.depth-1||1),Yp(u,function(S){y=(S.getLayout().x+v)*g,x=b==="TB"?(S.depth-1)*m:o-(S.depth-1)*m,S.setLayout({x:y,y:x},!0)}))}}}function _We(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");re(s,o)})})}function bWe(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=$T(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function wWe(e){e.registerChartView(oWe),e.registerSeriesModel(gWe),e.registerLayout(yWe),e.registerVisual(_We),bWe(e)}var fW=["treemapZoomToNode","treemapRender","treemapMove"];function SWe(e){for(var t=0;t1;)a=a.parentNode;var o=mI(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var TWe=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};Ire(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new tt({itemStyle:o},this,n);a=r.levels=AWe(a,n);var l=se(a||[],function(f){return new tt(f,s,n)},this),u=Rj.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 Ar("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=VT(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},re(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(){kre(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,coordinateSystemUsage:"box",left:K.size.l,top:K.size.xxxl,right:K.size.l,bottom:K.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:K.size.m,emptyItemWidth:25,itemStyle:{color:K.color.backgroundShade,textStyle:{color:K.color.secondary}},emphasis:{itemStyle:{color:K.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:K.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:K.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}(St);function Ire(e){var t=0;R(e.children,function(n){Ire(n);var i=n.value;ie(i)&&(i=i[0]),t+=i});var r=e.value;ie(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ie(e.value)?e.value[0]=r:e.value=r}function AWe(e,t){var r=Pt(t.get("color")),n=Pt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;R(e,function(s){var l=new tt(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 CWe=8,hW=8,rM=5,MWe=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),LT(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+CWe*2,r.emptyItemWidth);r.totalWidth+=s+hW,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,x=m.width,b=m.text;h>n.width&&(h-=x-c,x=c,b=null);var S=new wn({shape:{points:PWe(u,0,x,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:Iv*1e4,onclick:Be(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),LWe(S,t,y),u+=x+hW}},e.prototype.remove=function(){this.group.removeAll()},e}();function PWe(e,t,r,n,i,a){var o=[[i?e:e-rM,t],[e+r,t],[e+r,t+n],[i?e:e-rM,t+n]];return!a&&o.splice(2,0,[e+r+rM,t+n/2]),!i&&o.push([e,t+n/2]),o}function LWe(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&&VT(r,t)}}var kWe=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;ivW||Math.abs(r.dy)>vW)){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();Ua(m,m,[-n,-i]),dT(m,m,[v,v]),Ua(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&&hw(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 MWe(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(Bj(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=Xp(),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}(_t);function Xp(){return{nodeGroup:[],background:[],content:[]}}function jWe(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(),x=s&&s.getRawIndex(),b=o.viewChildren,S=c.upperHeight,T=b&&b.length,A=h.getModel("itemStyle"),M=h.getModel(["emphasis","itemStyle"]),P=h.getModel(["blur","itemStyle"]),k=h.getModel(["select","itemStyle"]),I=A.get("borderRadius")||0,O=ce("nodeGroup",tO);if(!O)return;if(l.add(O),O.x=c.x||0,O.y=c.y||0,O.markRedraw(),jw(O).nodeWidth=d,jw(O).nodeHeight=v,c.isAboveViewRoot)return O;var D=ce("background",dW,u,EWe);D&&H(O,D,T&&c.upperLabelHeight);var N=h.getModel("emphasis"),B=N.get("focus"),$=N.get("blurScope"),F=N.get("disabled"),G=B==="ancestor"?o.getAncestorsIndices():B==="descendant"?o.getDescendantIndices():B;if(T)vy(O)&&Tc(O,!1),D&&(Tc(D,!F),f.setItemGraphicEl(o.dataIndex,D),oI(D,G,$));else{var z=ce("content",dW,u,DWe);z&&Y(O,z),D.disableMorphing=!0,D&&vy(D)&&Tc(D,!1),Tc(O,!F),f.setItemGraphicEl(o.dataIndex,O);var U=h.getShallow("cursor");U&&z.attr("cursor",U),oI(O,G,$)}return O;function H(xe,ne,fe){var le=De(ne);if(le.dataIndex=o.dataIndex,le.seriesIndex=e.seriesIndex,ne.setShape({x:0,y:0,width:d,height:v,r:I}),m)Z(ne);else{ne.invisible=!1;var ee=o.getVisual("style"),$e=ee.stroke,Se=mW(A);Se.fill=$e;var Fe=oc(M);Fe.fill=M.get("borderColor");var Ye=oc(P);Ye.fill=P.get("borderColor");var vt=oc(k);if(vt.fill=k.get("borderColor"),fe){var Ft=d-2*g;J(ne,$e,ee.opacity,{x:g,y:0,width:Ft,height:S})}else ne.removeTextContent();ne.setStyle(Se),ne.ensureState("emphasis").style=Fe,ne.ensureState("blur").style=Ye,ne.ensureState("select").style=vt,rf(ne)}xe.add(ne)}function Y(xe,ne){var fe=De(ne);fe.dataIndex=o.dataIndex,fe.seriesIndex=e.seriesIndex;var le=Math.max(d-2*g,0),ee=Math.max(v-2*g,0);if(ne.culling=!0,ne.setShape({x:g,y:g,width:le,height:ee,r:I}),m)Z(ne);else{ne.invisible=!1;var $e=o.getVisual("style"),Se=$e.fill,Fe=mW(A);Fe.fill=Se,Fe.decal=$e.decal;var Ye=oc(M),vt=oc(P),Ft=oc(k);J(ne,Se,$e.opacity,null),ne.setStyle(Fe),ne.ensureState("emphasis").style=Ye,ne.ensureState("blur").style=vt,ne.ensureState("select").style=Ft,rf(ne)}xe.add(ne)}function Z(xe){!xe.invisible&&a.push(xe)}function J(xe,ne,fe,le){var ee=h.getModel(le?gW:pW),$e=Ir(h.get("name"),null),Se=ee.getShallow("show");Ur(xe,Nr(h,le?gW:pW),{defaultText:Se?$e:null,inheritColor:ne,defaultOpacity:fe,labelFetcher:e,labelDataIndex:o.dataIndex});var Fe=xe.getTextContent();if(Fe){var Ye=Fe.style,vt=t0(Ye.padding||0);le&&(xe.setTextConfig({layoutRect:le}),Fe.disableLabelLayout=!0),Fe.beforeUpdate=function(){var nr=Math.max((le?le.width:xe.shape.width)-vt[1]-vt[3],0),jn=Math.max((le?le.height:xe.shape.height)-vt[0]-vt[2],0);(Ye.width!==nr||Ye.height!==jn)&&Fe.setStyle({width:nr,height:jn})},Ye.truncateMinChar=2,Ye.lineOverflow="truncate",ae(Ye,le,c);var Ft=Fe.getState("emphasis");ae(Ft?Ft.style:null,le,c)}}function ae(xe,ne,fe){var le=xe?xe.text:null;if(!ne&&fe.isLeafRoot&&le!=null){var ee=e.get("drillDownIcon",!0);xe.text=ee?ee+" "+le:le}}function ce(xe,ne,fe,le){var ee=x!=null&&r[xe][x],$e=i[xe];return ee?(r[xe][x]=null,ge($e,ee)):m||(ee=new ne,ee instanceof va&&(ee.z2=RWe(fe,le)),Ge($e,ee)),t[xe][y]=ee}function ge(xe,ne){var fe=xe[y]={};ne instanceof tO?(fe.oldX=ne.x,fe.oldY=ne.y):fe.oldShape=re({},ne.shape)}function Ge(xe,ne){var fe=xe[y]={},le=o.parentNode,ee=ne instanceof Me;if(le&&(!n||n.direction==="drillDown")){var $e=0,Se=0,Fe=i.background[le.getRawIndex()];!n&&Fe&&Fe.oldShape&&($e=Fe.oldShape.width,Se=Fe.oldShape.height),ee?(fe.oldX=0,fe.oldY=Se):fe.oldShape={x:$e,y:Se,width:0,height:0}}fe.fadein=!ee}}function RWe(e,t){return e*OWe+t}var ky=R,BWe=Le,Rw=-1,Hr=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=Ce(t);this.type=n,this.mappingMethod=r,this._normalizeData=FWe[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(nM(i),zWe(i)):r==="category"?i.categories?$We(i):nM(i,!0):(_n(r!=="linear"||i.dataExtent),nM(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return pe(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){Le(t)?R(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=ie(t)?[]:Le(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&&ky(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(ie(t))t=t.slice();else if(BWe(t)){var r=[];ky(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 nM(e,t){var r=e.visual,n=[];Le(r)?ky(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]),Ore(e,n)}function p_(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:rO([0,1])}}function yW(e){var t=this.option.visual;return t[Math.round(gt(e,[0,1],[0,t.length-1],!0))]||{}}function qp(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function _g(e){var t=this.option.visual;return t[this.option.loop&&e!==Rw?e%t.length:e]}function sc(){return this.option.visual[0]}function rO(e){return{linear:function(t){return gt(t,e,this.option.visual,!0)},category:_g,piecewise:function(t,r){var n=nO.call(this,r);return n==null&&(n=gt(t,e,this.option.visual,!0)),n},fixed:sc}}function nO(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 Ore(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=se(t,function(r){var n=En(r);return n||[0,0,0,1]})),t}var FWe={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??Rw},fixed:lr};function g_(e,t,r){return e?t<=r:t=r.length||g===r[g.depth]){var y=ZWe(i,l,g,m,v,n);Dre(g,y,r,n)}})}}}function WWe(e,t,r){var n=re({},t),i=r.designatedVisualItemStyle;return R(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function xW(e){var t=iM(e,"color");if(t){var r=iM(e,"colorAlpha"),n=iM(e,"colorSaturation");return n&&(t=As(t,null,null,n)),r&&(t=uy(t,r)),t}}function HWe(e,t){return t!=null?As(t,null,null,e):null}function iM(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function UWe(e,t,r,n,i,a){if(!(!a||!a.length)){var o=aM(t,"color")||i.color!=null&&i.color!=="none"&&(aM(t,"colorAlpha")||aM(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 Ere(h).drColorMappingBy=c,h}}}function aM(e,t){var r=e.get(t);return ie(r)&&r.length?{name:t,range:r}:null}function ZWe(e,t,r,n,i,a){var o=re({},t);if(i){var s=i.type,l=s==="color"&&Ere(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 Iy=Math.max,Bw=Math.min,_W=nn,zj=R,Nre=["itemStyle","borderWidth"],YWe=["itemStyle","gapWidth"],XWe=["upperLabel","show"],qWe=["upperLabel","height"];const KWe={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=de(_W(o.width,s[0]),a.width),u=de(_W(o.height,s[1]),a.height),c=n&&n.type,f=["treemapZoomToNode","treemapRootToNode"],h=Ly(n,f,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,v=e.getViewRoot(),g=Lre(v);if(c!=="treemapMove"){var m=c==="treemapZoomToNode"?nHe(e,h,v,l,u):d?[d.width,d.height]:[l,u],y=i.sort;y&&y!=="asc"&&y!=="desc"&&(y="desc");var x={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),jre(v,x,!1,0),b=v.getLayout(),zj(g,function(T,A){var M=(g[A+1]||v).getValue();T.setLayout(re({dataExtent:[M,M],borderWidth:0,upperHeight:0},b))})}var S=e.getData().tree.root;S.setLayout(iHe(o,d,h),!0),e.setLayoutInfo(o),Rre(S,new Oe(-o.x,-o.y,r.getWidth(),r.getHeight()),g,v,0)}};function jre(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(Nre),u=s.get(YWe)/2,c=Bre(s),f=Math.max(l,c),h=l-u,d=f-u;e.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),i=Iy(i-2*h,0),a=Iy(a-h-d,0);var v=i*a,g=QWe(e,s,v,t,r,n);if(g.length){var m={x:h,y:d,width:i,height:a},y=Bw(i,a),x=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 rHe(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?Iy(u*n/l,l/(u*i)):1/0}function bW(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;fXk&&(u=Xk),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 M=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]*x+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*M+c[0],a.y=c[1]+k,v=S[0]<0?"right":"left",a.originX=-y*M,a.originY=-k;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=A[0],a.y=A[1]+k,v="center",a.originY=-k;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*M+f[0],a.y=f[1]+k,v=S[0]>=0?"right":"left",a.originX=y*M,a.originY=-k;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||v})}},t}(Me),Wj=function(){function e(t){this.group=new Me,this._LineCtor=t||Gj}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=MW(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=MW(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!bHe(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function MW(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 PW(e){return isNaN(e[0])||isNaN(e[1])}function cM(e){return e&&!PW(e[0])&&!PW(e[1])}var fM=[],hM=[],dM=[],oh=rn,vM=Gl,LW=Math.abs;function kW(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){fM[0]=oh(n[0],i[0],a[0],c),fM[1]=oh(n[1],i[1],a[1],c);var f=LW(vM(fM,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=sy,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=[Io(u[0]),Io(u[1])],u[2]&&u.__original.push(Io(u[2])));var h=u.__original;if(u[2]!=null){if(Pn(i[0],h[0]),Pn(i[1],h[2]),Pn(i[2],h[1]),c&&c!=="none"){var d=wg(s.node1),v=kW(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=wg(s.node2),v=kW(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]}Pn(u[0],i[0]),Pn(u[1],i[2]),Pn(u[2],i[1])}else{if(Pn(a[0],h[0]),Pn(a[1],h[1]),Cl(o,a[1],a[0]),xf(o,o),c&&c!=="none"){var d=wg(s.node1);U1(a[0],a[0],o,d*t)}if(f&&f!=="none"){var d=wg(s.node2);U1(a[1],a[1],o,-d*t)}Pn(u[0],a[0]),Pn(u[1],a[1])}})}var Hre=Je();function wHe(e){if(e)return Hre(e).bridge}function IW(e,t){e&&(Hre(e).bridge=t)}function OW(e){return e.type==="view"}var SHe=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 g0,a=new Wj,o=this.group,s=new Me;this._controller=new Cf(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(OW(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(),bg(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,A=S.getGraphicEl(),M=S.getModel();if(A){A.off("drag").off("dragend");var P=M.get("draggable");P&&A.on("drag",function(I){switch(m){case"force":v.warmUp(),!a._layouting&&a._startForceLayoutIteration(v,i,g),v.setFixed(T),h.setItemLayout(T,[A.x,A.y]);break;case"circular":h.setItemLayout(T,[A.x,A.y]),S.setLayout({fixed:!0},!0),Vj(r,"symbolSize",S,[I.offsetX,I.offsetY]),a.updateLayout(r);break;case"none":default:h.setItemLayout(T,[A.x,A.y]),Fj(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){v&&v.setUnfixed(T)}),A.setDraggable(P,!!M.get("cursor"));var k=M.get(["emphasis","focus"]);k==="adjacency"&&(De(A).focus=S.getAdjacentDataIndices())}}),h.graph.eachEdge(function(S){var T=S.getGraphicEl(),A=S.getModel().get(["emphasis","focus"]);T&&A==="adjacency"&&(De(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var y=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),x=h.getLayout("cx"),b=h.getLayout("cy");h.graph.eachNode(function(S){Vre(S,y,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(!OW(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&&(Oj(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(Ej(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),pM(r.getGraph(),bg(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=bg(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(pM(r.getGraph(),bg(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=wHe(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 lc||(r=this._nodesMap[sh(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(x.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),Ure=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 Zre(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)}}}fr(lc,Zre("hostGraph","data"));fr(Ure,Zre("hostGraph","edgeData"));function Hj(e,t,r,n,i){for(var a=new THe(n),o=0;o "+h)),u++)}var d=r.get("coordinateSystem"),v;if(d==="cartesian2d"||d==="polar"||d==="matrix")v=Yo(e,r);else{var g=zv.get(d),m=g?g.dimensions||[]:[];Ve(m,"value")<0&&m.concat(["value"]);var y=Gv(e,{coordDimensions:m,encodeDefine:r.getEncode()}).dimensions;v=new Dn(y,r),v.initData(e)}var x=new Dn(["value"],r);return x.initData(l,s),i&&i(v,x),Mre({mainData:v,struct:a,structAttr:"graph",datas:{node:v,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var AHe=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 Yv(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),Jc(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){fHe(this);var s=Hj(a,i,this,!0,l);return R(s.edges,function(u){hHe(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=tt.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),Ar("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=qJ({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:re({value:0},i)}),n=new Dn(["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:K.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:K.color.primary}}},t}(St);function CHe(e){e.registerChartView(SHe),e.registerSeriesModel(AHe),e.registerProcessor(oHe),e.registerVisual(sHe),e.registerVisual(lHe),e.registerLayout(dHe),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,pHe),e.registerLayout(mHe),e.registerCoordinateSystem("graphView",{dimensions:Mf.dimensions,create:xHe}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},lr),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},lr),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=$T(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var EW=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=re(Ao(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=re(Ao(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(x,b,S,T,A,M){return r.getFormattedLabel(x,b,"node",T,fi(A,f.normal&&f.normal.get("formatter"),n.get("name")),M)}},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}(bn),MHe=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=re(Ao(c.getModel("itemStyle"),u,!0),u),m=this;if(isNaN(g.sStartAngle)||isNaN(g.tStartAngle)){m.setShape(g);return}o?(m.setShape(g),DW(m,l,r,h)):(pa(m),DW(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}(rt);function DW(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(ve(l)&&ve(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 _f(f,h,d,v,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var PHe=Math.PI/180,LHe=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")*PHe;if(a.diff(o).add(function(c){var f=a.getItemLayout(c);if(f){var h=new EW(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&&Cs(h,r,f);return}h?h.updateData(a,c,l):h=new EW(a,c,l),s.add(h)}).remove(function(c){var f=o.getItemGraphicEl(c);f&&Cs(f,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=de(u[0],i.getWidth()),this.group.originY=de(u[1],i.getHeight()),Nt(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 MHe(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&&Cs(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(_t),kHe=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 Yv(pe(this.getData,this),pe(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=Hj(a,i,this,!0,s);return o.data}function s(l,u){var c=tt.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),Ar("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return Ar("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}(St),gM=Math.PI/180;function IHe(e,t){e.eachSeriesByType("chord",function(r){OHe(r,t)})}function OHe(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=pJ(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=Math.max((e.get("padAngle")||0)*gM,0),h=Math.max((e.get("minAngle")||0)*gM,0),d=-e.get("startAngle")*gM,v=d+Math.PI*2,g=e.get("clockwise"),m=g?1:-1,y=[d,v];wT(y,!g);var x=y[0],b=y[1],S=b-x,T=r.getSum("value")===0&&i.getSum("value")===0,A=[],M=0;n.eachEdge(function(z){var U=T?1:z.getValue("value");T&&(U>0||h)&&(M+=2);var H=z.node1.dataIndex,Y=z.node2.dataIndex;A[H]=(A[H]||0)+U,A[Y]=(A[Y]||0)+U});var P=0;if(n.eachNode(function(z){var U=z.getValue("value");isNaN(U)||(A[z.dataIndex]=Math.max(U,A[z.dataIndex]||0)),!T&&(A[z.dataIndex]>0||h)&&M++,P+=A[z.dataIndex]||0}),!(M===0||P===0)){f*M>=Math.abs(S)&&(f=Math.max(0,(Math.abs(S)-h*M)/M)),(f+h)*M>=Math.abs(S)&&(h=(Math.abs(S)-f*M)/M);var k=(S-f*M*m)/P,I=0,O=0,D=0;n.eachNode(function(z){var U=A[z.dataIndex]||0,H=k*(P?U:1)*m;Math.abs(H)O){var B=I/O;n.eachNode(function(z){var U=z.getLayout().angle;Math.abs(U)>=h?z.setLayout({angle:U*B,ratio:B},!0):z.setLayout({angle:h,ratio:h===0?1:U/h},!0)})}else n.eachNode(function(z){if(!N){var U=z.getLayout().angle,H=Math.min(U/D,1),Y=H*I;U-Yh&&h>0){var H=N?1:Math.min(U/D,1),Y=U-h,Z=Math.min(Y,Math.min($,I*H));$-=Z,z.setLayout({angle:U-Z,ratio:(U-Z)/U},!0)}else h>0&&z.setLayout({angle:h,ratio:U===0?1:h/U},!0)}});var F=x,G=[];n.eachNode(function(z){var U=Math.max(z.getLayout().angle,h);z.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:F,endAngle:F+U*m,clockwise:g},!0),G[z.dataIndex]=F,F+=(U+f)*m}),n.eachEdge(function(z){var U=T?1:z.getValue("value"),H=k*(P?U:1)*m,Y=z.node1.dataIndex,Z=G[Y]||0,J=Math.abs((z.node1.getLayout().ratio||1)*H),ae=Z+J*m,ce=[s+c*Math.cos(Z),l+c*Math.sin(Z)],ge=[s+c*Math.cos(ae),l+c*Math.sin(ae)],Ge=z.node2.dataIndex,xe=G[Ge]||0,ne=Math.abs((z.node2.getLayout().ratio||1)*H),fe=xe+ne*m,le=[s+c*Math.cos(xe),l+c*Math.sin(xe)],ee=[s+c*Math.cos(fe),l+c*Math.sin(fe)];z.setLayout({s1:ce,s2:ge,sStartAngle:Z,sEndAngle:ae,t1:le,t2:ee,tStartAngle:xe,tEndAngle:fe,cx:s,cy:l,r:c,value:U,clockwise:g}),G[Y]=ae,G[Ge]=fe})}}}function EHe(e){e.registerChartView(LHe),e.registerSeriesModel(kHe),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,IHe),e.registerProcessor(Uv("chord"))}var DHe=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),NHe=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 DHe},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}(rt);function jHe(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=de(r[0],t.getWidth()),s=de(r[1],t.getHeight()),l=de(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function y_(e,t){var r=e==null?"":e+"";return t&&(ve(t)?r=t.replace("{value}",r):Ae(t)&&(r=t(e))),r}var RHe=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=jHe(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?Iw:bn,v=f.get("show"),g=f.getModel("lineStyle"),m=g.get("width"),y=[u,c];wT(y,!l),u=y[0],c=y[1];for(var x=c-u,b=u,S=[],T=0;v&&T=k&&(I===0?0:a[I-1][0])Math.PI/2&&(ae+=Math.PI)):J==="tangential"?ae=-P-Math.PI/2:ot(J)&&(ae=J*Math.PI/180),ae===0?f.add(new at({style:Mt(b,{text:U,x:Y,y:Z,verticalAlign:$<-.8?"top":$>.8?"bottom":"middle",align:B<-.4?"left":B>.4?"right":"center"},{inheritColor:H}),silent:!0})):f.add(new at({style:Mt(b,{text:U,x:Y,y:Z,verticalAlign:"middle",align:"center"},{inheritColor:H}),silent:!0,originX:Y,originY:Z,rotation:ae}))}if(x.get("show")&&F!==S){var G=x.get("distance");G=G?G+c:c;for(var ce=0;ce<=T;ce++){B=Math.cos(P),$=Math.sin(P);var ge=new yr({shape:{x1:B*(v-G)+h,y1:$*(v-G)+d,x2:B*(v-M-G)+h,y2:$*(v-M-G)+d},silent:!0,style:D});D.stroke==="auto"&&ge.setStyle({stroke:a((F+ce/T)/S)}),f.add(ge),P+=I}P-=I}else P+=k}},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"),x=r.getData(),b=x.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),A=[S,T],M=[s,l];function P(I,O){var D=x.getItemModel(I),N=D.getModel("pointer"),B=de(N.get("width"),o.r),$=de(N.get("length"),o.r),F=r.get(["pointer","icon"]),G=N.get("offsetCenter"),z=de(G[0],o.r),U=de(G[1],o.r),H=N.get("keepAspect"),Y;return F?Y=xr(F,z-B/2,U-$,B,$,null,H):Y=new NHe({shape:{angle:-Math.PI/2,width:B,r:$,x:z,y:U}}),Y.rotation=-(O+Math.PI/2),Y.x=o.cx,Y.y=o.cy,Y}function k(I,O){var D=m.get("roundCap"),N=D?Iw:bn,B=m.get("overlap"),$=B?m.get("width"):c/x.count(),F=B?o.r-$:o.r-(I+1)*$,G=B?o.r:o.r-I*$,z=new N({shape:{startAngle:s,endAngle:O,cx:o.cx,cy:o.cy,clockwise:u,r0:F,r:G}});return B&&(z.z2=gt(x.get(b,I),[S,T],[100,0],!0)),z}(y||g)&&(x.diff(h).add(function(I){var O=x.get(b,I);if(g){var D=P(I,s);Nt(D,{rotation:-((isNaN(+O)?M[0]:gt(O,A,M,!0))+Math.PI/2)},r),f.add(D),x.setItemGraphicEl(I,D)}if(y){var N=k(I,s),B=m.get("clip");Nt(N,{shape:{endAngle:gt(O,A,M,B)}},r),f.add(N),rI(r.seriesIndex,x.dataType,I,N),v[I]=N}}).update(function(I,O){var D=x.get(b,I);if(g){var N=h.getItemGraphicEl(O),B=N?N.rotation:s,$=P(I,B);$.rotation=B,lt($,{rotation:-((isNaN(+D)?M[0]:gt(D,A,M,!0))+Math.PI/2)},r),f.add($),x.setItemGraphicEl(I,$)}if(y){var F=d[O],G=F?F.shape.endAngle:s,z=k(I,G),U=m.get("clip");lt(z,{shape:{endAngle:gt(D,A,M,U)}},r),f.add(z),rI(r.seriesIndex,x.dataType,I,z),v[I]=z}}).execute(),x.each(function(I){var O=x.getItemModel(I),D=O.getModel("emphasis"),N=D.get("focus"),B=D.get("blurScope"),$=D.get("disabled");if(g){var F=x.getItemGraphicEl(I),G=x.getItemVisual(I,"style"),z=G.fill;if(F instanceof Xr){var U=F.style;F.useStyle(re({image:U.image,x:U.x,y:U.y,width:U.width,height:U.height},G))}else F.useStyle(G),F.type!=="pointer"&&F.setColor(z);F.setStyle(O.getModel(["pointer","itemStyle"]).getItemStyle()),F.style.fill==="auto"&&F.setStyle("fill",a(gt(x.get(b,I),A,[0,1],!0))),F.z2EmphasisLift=0,Dr(F,O),Gt(F,N,B,$)}if(y){var H=v[I];H.useStyle(x.getItemVisual(I,"style")),H.setStyle(O.getModel(["progress","itemStyle"]).getItemStyle()),H.z2EmphasisLift=0,Dr(H,O),Gt(H,N,B,$)}}),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+de(l[0],n.r),n.cy-o/2+de(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,x){d[y]=s._titleEls[x],v[y]=s._detailEls[x]}).execute(),l.each(function(y){var x=l.getItemModel(y),b=l.get(u,y),S=new Me,T=a(gt(b,[c,f],[0,1],!0)),A=x.getModel("title");if(A.get("show")){var M=A.get("offsetCenter"),P=o.cx+de(M[0],o.r),k=o.cy+de(M[1],o.r),I=d[y];I.attr({z2:m?0:2,style:Mt(A,{x:P,y:k,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(I)}var O=x.getModel("detail");if(O.get("show")){var D=O.get("offsetCenter"),N=o.cx+de(D[0],o.r),B=o.cy+de(D[1],o.r),$=de(O.get("width"),o.r),F=de(O.get("height"),o.r),G=r.get(["progress","show"])?l.getItemVisual(y,"style").fill:T,I=v[y],z=O.get("formatter");I.attr({z2:m?0:2,style:Mt(O,{x:N,y:B,text:y_(b,z),width:isNaN($)?null:$,height:isNaN(F)?null:F,align:"center",verticalAlign:"middle"},{inheritColor:G})}),KQ(I,{normal:O},b,function(H){return y_(H,z)}),g&&QQ(I,y,l,r,{getFormattedLabel:function(H,Y,Z,J,ae,ce){return y_(ce?ce.interpolatedValue:b,z)}}),S.add(I)}h.add(S)}),this.group.add(h),this._titleEls=d,this._detailEls=v},t.type="gauge",t}(_t),BHe=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 Zv(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,K.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:K.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:K.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:K.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:K.color.neutral00,borderWidth:0,borderColor:K.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:K.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:K.color.transparent,borderWidth:0,borderColor:K.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:K.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(St);function zHe(e){e.registerChartView(RHe),e.registerSeriesModel(BHe)}var $He=["itemStyle","opacity"],FHe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new on,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($He);c=c??1,i||pa(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Nt(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}),yj(i,xj(l),{stroke:h})},t}(wn),VHe=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 FHe(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);Cs(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}(_t),GHe=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 Yv(pe(this.getData,this),pe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return Zv(this,{coordDimensions:["value"],encodeDefaulter:Be(UN,this)})},t.prototype._defaultLabelLine=function(r){Jc(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:K.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:K.color.primary}}},t}(St);function WHe(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();oo8e)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||!yM(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 yM(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var u8e=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&&We(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){R(["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);R(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}(Qe),c8e=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}(_a);function iu(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=lh(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=lh(s,[0,o]),i=a=lh(s,[i,a]),n=0}t[0]=lh(t[0],r),t[1]=lh(t[1],r);var l=xM(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=lh(t[n],c);var f;return f=xM(t,n),i!=null&&(f.sign!==l.sign||f.spana&&(t[1-n]=t[n]+f.sign*a),t}function xM(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 lh(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var _M=R,Xre=Math.min,qre=Math.max,RW=Math.floor,f8e=Math.ceil,BW=mr,h8e=Math.PI,d8e=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;_M(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new c8e(o,v0(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();_M(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),sf(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=x_(t.get("axisExpandWidth"),l),f=x_(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=x_(d[1]-d[0],l),d[1]=d[0]+v;else{v=x_(c*(f-1),l);var g=t.get("axisExpandCenter")||RW(u/2);d=[c*g-v/2],d[1]=d[0]+v}var m=(s-v)/(u-f);m<3&&(m=0);var y=[RW(BW(d[0]/c,1))+1,f8e(BW(d[1]/c,1))-1],x=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:x}},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])}),_M(n,function(o,s){var l=(i.axisExpandable?p8e:v8e)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:h8e/2,vertical:0},f=[u[a].x+t.x,u[a].y+t.y],h=c[a],d=Wr();qs(d,d,h),Ua(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=[];R(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?iu(l,i,o,"all"):u="none";else{var d=i[1]-i[0],v=o[1]*s/d;i=[qre(0,v-d/2)],i[1]=Xre(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function x_(e,t){return Xre(qre(e,t[0]),t[1])}function v8e(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function p8e(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--)Mi(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;a_8e}function rne(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function nne(e,t,r,n){var i=new Me;return i.add(new Xe({name:"main",style:qj(r),silent:!0,draggable:!0,cursor:"move",drift:Be(FW,e,t,i,["n","s","w","e"]),ondragend:Be(uf,t,{isEnd:!0})})),R(n,function(a){i.add(new Xe({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Be(FW,e,t,i,a),ondragend:Be(uf,t,{isEnd:!0})}))}),i}function ine(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=nv(i,b8e),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;is(e,t,"main",o,s,v,g),n.transformable&&(is(e,t,"w",l,u,a,y),is(e,t,"e",h,u,a,y),is(e,t,"n",l,u,m,a),is(e,t,"s",l,d,m,a),is(e,t,"nw",l,u,a,a),is(e,t,"ne",h,u,a,a),is(e,t,"sw",l,d,a,a),is(e,t,"se",h,d,a,a))}function uO(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(qj(r)),i.attr({silent:!n,cursor:n?"move":"default"}),R([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?cO(e,a[0]):M8e(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?S8e[s]+"-resize":null})})}function is(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(L8e(Kj(e,t,[[n,i],[n+a,i+o]])))}function qj(e){return Pe({strokeNoScale:!0},e.brushStyle)}function ane(e,t,r,n){var i=[Ey(e,r),Ey(t,n)],a=[nv(e,r),nv(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function C8e(e){return Zl(e.group)}function cO(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=CT(r[t],C8e(e));return n[i]}function M8e(e,t){var r=[cO(e,t[0]),cO(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function FW(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=one(t,i,a);R(n,function(u){var c=w8e[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(ane(s[0][0],s[1][0],s[0][1],s[1][1])),Zj(t,r),uf(t,{isEnd:!1})}function P8e(e,t,r,n){var i=t.__brushOption.range,a=one(e,r,n);R(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Zj(e,t),uf(e,{isEnd:!1})}function one(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 Kj(e,t,r){var n=tne(e,t);return n&&n!==lf?n.clipPath(r,e._transform):Ce(r)}function L8e(e){var t=Ey(e[0][0],e[1][0]),r=Ey(e[0][1],e[1][1]),n=nv(e[0][0],e[1][0]),i=nv(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function k8e(e,t,r){if(!(!e._brushType||O8e(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=Xj(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var WT={lineX:WW(0),lineY:WW(1),rect:{createCover:function(e,t){function r(n){return n}return nne({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=rne(e);return ane(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){ine(e,t,r,n)},updateCommon:uO,contain:hO},polygon:{createCover:function(e,t){var r=new Me;return r.add(new on({name:"main",style:qj(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new wn({name:"main",draggable:!0,drift:Be(P8e,e,t),ondragend:Be(uf,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:Kj(e,t,r)})},updateCommon:uO,contain:hO}};function WW(e){return{createCover:function(t,r){return nne({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=rne(t),n=Ey(r[0][e],r[1][e]),i=nv(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=tne(t,r);if(o!==lf&&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(),ine(t,r,l,i)},updateCommon:uO,contain:hO}}function lne(e){return e=Qj(e),function(t){return MN(t,e)}}function une(e,t){return e=Qj(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 cne(e,t,r){var n=Qj(e);return function(i,a){return n.contain(a[0],a[1])&&!pre(i,t,r)}}function Qj(e){return Oe.create(e)}var E8e=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 Uj(n.getZr())).on("brush",pe(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!D8e(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=j8e(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,f=r.axis.dim,h=l.getAxisLayout(f),d=re({strokeContainThreshold:c},h),v=new Hn(r,i,d);v.build(),this._axisGroup.add(v.group),this._refreshBrushController(d,u,r,s,c,i),c0(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:lne(f),isTargetByCursor:cne(f,s,a),getLinearBrushOtherExtent:une(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(N8e(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}(Lt);function D8e(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function N8e(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 j8e(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var R8e={type:"axisAreaSelect",event:"axisAreaSelected"};function B8e(e){e.registerAction(R8e,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 z8e={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function fne(e){e.registerComponentView(s8e),e.registerComponentModel(u8e),e.registerCoordinateSystem("parallel",m8e),e.registerPreprocessor(n8e),e.registerComponentModel(sO),e.registerComponentView(E8e),tv(e,"parallel",sO,z8e),B8e(e)}function $8e(e){Ze(fne),e.registerChartView(XHe),e.registerSeriesModel(QHe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,r8e)}var F8e=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}(),V8e=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new F8e},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(){$s(this)},t.prototype.downplay=function(){Fs(this)},t}(rt),G8e=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 Cf(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),gre(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(v){var g=new V8e,m=De(g);m.dataIndex=v.dataIndex,m.seriesIndex=r.seriesIndex,m.dataType="edge";var y=v.getModel(),x=y.getModel("lineStyle"),b=x.get("curveness"),S=v.node1.getLayout(),T=v.node1.getModel(),A=T.get("localX"),M=T.get("localY"),P=v.node2.getLayout(),k=v.node2.getModel(),I=k.get("localX"),O=k.get("localY"),D=v.getLayout(),N,B,$,F,G,z,U,H;g.shape.extent=Math.max(1,D.dy),g.shape.orient=d,d==="vertical"?(N=(A!=null?A*u:S.x)+D.sy,B=(M!=null?M*c:S.y)+S.dy,$=(I!=null?I*u:P.x)+D.ty,F=O!=null?O*c:P.y,G=N,z=B*(1-b)+F*b,U=$,H=B*b+F*(1-b)):(N=(A!=null?A*u:S.x)+S.dx,B=(M!=null?M*c:S.y)+D.sy,$=I!=null?I*u:P.x,F=(O!=null?O*c:P.y)+D.ty,G=N*(1-b)+$*b,z=B,U=N*b+$*(1-b),H=F),g.setShape({x1:N,y1:B,x2:$,y2:F,cpx1:G,cpy1:z,cpx2:U,cpy2:H}),g.useStyle(x.getItemStyle()),HW(g.style,d,v);var Y=""+y.get("value"),Z=Nr(y,"edgeLabel");Ur(g,Z,{labelFetcher:{getFormattedLabel:function(ce,ge,Ge,xe,ne,fe){return r.getFormattedLabel(ce,ge,"edge",xe,fi(ne,Z.normal&&Z.normal.get("formatter"),Y),fe)}},labelDataIndex:v.dataIndex,defaultText:Y}),g.setTextConfig({position:"inside"});var J=y.getModel("emphasis");Dr(g,y,"lineStyle",function(ce){var ge=ce.getItemStyle();return HW(ge,d,v),ge}),s.add(g),h.setItemGraphicEl(v.dataIndex,g);var ae=J.get("focus");Gt(g,ae==="adjacency"?v.getAdjacentDataIndices():ae==="trajectory"?v.getTrajectoryDataIndices():ae,J.get("blurScope"),J.get("disabled"))}),o.eachNode(function(v){var g=v.getLayout(),m=v.getModel(),y=m.get("localX"),x=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:x!=null?x*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(M,P){return r.getFormattedLabel(M,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 A=b.get("focus");Gt(T,A==="adjacency"?v.getAdjacentDataIndices():A==="trajectory"?v.getTrajectoryDataIndices():A,b.get("blurScope"),b.get("disabled"))}),f.eachItemGraphicEl(function(v,g){var m=f.getItemModel(g);m.get("draggable")&&(v.drift=function(y,x){a._focusAdjacencyDisabled=!0,this.shape.x+=y,this.shape.y+=x,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(W8e(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 Mf(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}(_t);function HW(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");ve(n)&&ve(i)&&(e.fill=new _f(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function W8e(e,t,r){var n=new Xe({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Nt(n,{shape:{width:e.width+20}},t,r),n}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.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 tt(o[l],this,n));var u=Hj(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,x=g.levelModels[y];x&&(d.parentModel=x)}return d}),h.wrapMethod("getItemModel",function(d,v){var g=d.parentModel,m=g.getGraph().getEdgeByIndex(v),y=m.node1.getLayout();if(y){var x=y.depth,b=g.levelModels[x];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 Ar("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 Ar("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:K.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:K.color.primary}},animationEasing:"linear",animationDuration:1e3},t}(St);function U8e(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;Y8e(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");Z8e(c,f,n,i,s,l,d,v,g)})}function Z8e(e,t,r,n,i,a,o,s,l){X8e(e,t,r,i,a,s,l),J8e(e,t,a,i,n,o,s),lUe(e,s)}function Y8e(e){R(e,function(t){var r=ql(t.outEdges,zw),n=ql(t.inEdges,zw),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function X8e(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 x=0;xf-1?d:f-1;o&&o!=="left"&&q8e(e,o,a,M);var P=a==="vertical"?(i-r)/M:(n-r)/M;Q8e(e,P,a)}function hne(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function q8e(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,rUe(s,l,o),bM(s,i,r,n,o),sUe(s,l,o),bM(s,i,r,n,o)}function eUe(e,t){var r=[],n=t==="vertical"?"y":"x",i=Kk(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),R(i.keys,function(a){r.push(i.buckets.get(a))}),r}function tUe(e,t,r,n,i,a){var o=1/0;R(e,function(s){var l=s.length,u=0;R(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 rUe(e,t,r){R(e.slice().reverse(),function(n){R(n,function(i){if(i.outEdges.length){var a=ql(i.outEdges,nUe,r)/ql(i.outEdges,zw);if(isNaN(a)){var o=i.outEdges.length;a=o?ql(i.outEdges,iUe,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-au(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-au(i,r))*t;i.setLayout({y:l},!0)}}})})}function nUe(e,t){return au(e.node2,t)*e.getValue()}function iUe(e,t){return au(e.node2,t)}function aUe(e,t){return au(e.node1,t)*e.getValue()}function oUe(e,t){return au(e.node1,t)}function au(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function zw(e){return e.getValue()}function ql(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),R(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&&R(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function cUe(e){e.registerChartView(G8e),e.registerSeriesModel(H8e),e.registerLayout(U8e),e.registerVisual(uUe),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=$T(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var dne=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=[];R(m,function(S,T){var A;ie(S)?(A=S.slice(),S.unshift(T)):ie(S.value)?(A=re({},S),A.value=A.value.slice(),S.value.unshift(T)):A=S,y.push(A)}),t.data=y}var x=this.defaultValueDimensions,b=[{name:f,type:ww(v),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:ww(g),dimsDef:x.slice()}];return Zv(this,{coordDimensions:b,dimensionsCount:x.length+1,encodeDefaulter:Be(SJ,b,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),vne=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:K.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:K.color.shadow}},animationDuration:800},t}(St);fr(vne,dne,!0);var 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){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=UW(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?(pa(f),pne(h,f,a,u)):f=UW(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}(_t),hUe=function(){function e(){}return e}(),dUe=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 hUe},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 _Ue={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==sn){var n="";mt(n)}var i=xUe(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function bUe(e){e.registerSeriesModel(vne),e.registerChartView(fUe),e.registerLayout(pUe),e.registerTransform(_Ue)}var wUe=["itemStyle","borderColor"],SUe=["itemStyle","borderColor0"],TUe=["itemStyle","borderColorDoji"],AUe=["itemStyle","color"],CUe=["itemStyle","color0"];function Jj(e,t){return t.get(e>0?AUe:CUe)}function eR(e,t){return t.get(e===0?TUe:e>0?wUe:SUe)}var MUe={seriesType:"candlestick",plan:$v(),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=Jj(s,o),l.stroke=eR(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");re(u,l)}}}}}},PUe=["color","borderColor"],LUe=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){mu(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&&ZW(u,f))return;var h=wM(f,c,!0);Nt(h,{shape:{points:f.ends}},r,c),SM(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&&ZW(u,d)){a.remove(h);return}h?(lt(h,{shape:{points:d.ends}},r,c),pa(h)):h=wM(d),SM(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(),YW(r,this.group);var n=r.get("clip",!0)?m0(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=wM(s);SM(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){YW(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}(_t),kUe=function(){function e(){}return e}(),IUe=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 kUe},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}(rt);function wM(e,t,r){var n=e.ends;return new IUe({shape:{points:r?OUe(n,e):n},z2:100})}function ZW(e,t){for(var r=!0,n=0;nT?O[a]:I[a],ends:B,brushRect:U(A,M,b)})}function G(Y,Z){var J=[];return J[i]=Z,J[a]=Y,isNaN(Z)||isNaN(Y)?[NaN,NaN]:t.dataToPoint(J)}function z(Y,Z,J){var ae=Z.slice(),ce=Z.slice();ae[i]=rb(ae[i]+n/2,1,!1),ce[i]=rb(ce[i]-n/2,1,!0),J?Y.push(ae,ce):Y.push(ce,ae)}function U(Y,Z,J){var ae=G(Y,J),ce=G(Z,J);return ae[i]-=n/2,ce[i]-=n/2,{x:ae[0],y:ae[1],width:n,height:ce[1]-ae[1]}}function H(Y){return Y[i]=rb(Y[i],1),Y}}function v(g,m){for(var y=So(g.count*4),x=0,b,S=[],T=[],A,M=m.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(A=g.next())!=null;){var k=M.get(s,A),I=M.get(u,A),O=M.get(c,A),D=M.get(f,A),N=M.get(h,A);if(isNaN(k)||isNaN(D)||isNaN(N)){y[x++]=NaN,x+=3;continue}y[x++]=XW(M,A,I,O,c,P),S[i]=k,S[a]=D,b=t.dataToPoint(S,null,T),y[x++]=b?b[0]:NaN,y[x++]=b?b[1]:NaN,S[a]=N,b=t.dataToPoint(S,null,T),y[x++]=b?b[1]:NaN}m.setLayout("largePoints",y)}}};function XW(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 jUe(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=de(be(e.get("barMaxWidth"),i),i),o=de(be(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?de(s,i):Math.max(Math.min(i/2,a),o)}function RUe(e){e.registerChartView(LUe),e.registerSeriesModel(gne),e.registerPreprocessor(DUe),e.registerVisual(MUe),e.registerLayout(NUe)}function qW(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 BUe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new p0(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;Ae(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 ps(r.__p1,r.__cp1)+ps(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=rn,c=Nk;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}(mne),GUe=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),WUe=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:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new GUe},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(yQ(f,h,m,y,v,g,s,r,n))return l}else if(ml(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}(),xne={seriesType:"lines",plan:$v(),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)&&m0(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=xne.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 HUe:new Wj(o?a?VUe:yne:a?mne:Gj),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}(_t),ZUe=typeof Uint32Array>"u"?Array:Uint32Array,YUe=typeof Float64Array>"u"?Array:Float64Array;function KW(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),cT([i,r[0],r[1]])}))}var XUe=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||[],KW(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(KW(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=Gd(this._flatCoords,n.flatCoords),this._flatCoordsOffset=Gd(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}(St);function __(e){return e instanceof Array||(e=[e,e]),e}var qUe={seriesType:"lines",reset:function(e){var t=__(e.get("symbol")),r=__(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=__(s.getShallow("symbol",!0)),u=__(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 KUe(e){e.registerChartView(UUe),e.registerSeriesModel(XUe),e.registerLayout(xne),e.registerVisual(qUe)}var QUe=256,JUe=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=hi.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*I+P),T[A++]=D[O],T[A++]=D[O+1],T[A++]=D[O+2],T[A++]=D[O+3]*b*256}else A+=4}return h.putImageData(S,0,0),f},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=hi.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=K.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 e7e(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 QW(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var r7e=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()):QW(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&&(QW(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){mu(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=nu(s,"cartesian2d"),u=nu(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(),x=r.getModel(["emphasis","itemStyle"]).getItemStyle(),b=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),A=Nr(r),M=r.getModel("emphasis"),P=M.get("focus"),k=M.get("blurScope"),I=M.get("disabled"),O=l||u?[y.mapDimension("x"),y.mapDimension("y"),y.mapDimension("value")]:[y.mapDimension("time"),y.mapDimension("value")],D=i;Dh[1]||Fd[1])continue;var G=s.dataToPoint([$,F]);N=new Xe({shape:{x:G[0]-c/2,y:G[1]-f/2,width:c,height:f},style:B})}else if(u){var z=s.dataToLayout([y.get(O[0],D),y.get(O[1],D)]).rect;if(mn(z.x))continue;N=new Xe({z2:1,shape:z,style:B})}else{if(isNaN(y.get(O[1],D)))continue;var U=s.dataToLayout([y.get(O[0],D)]),z=U.contentRect||U.rect;if(mn(z.x)||mn(z.y))continue;N=new Xe({z2:1,shape:z,style:B})}if(y.hasItemOption){var H=y.getItemModel(D),Y=H.getModel("emphasis");x=Y.getModel("itemStyle").getItemStyle(),b=H.getModel(["blur","itemStyle"]).getItemStyle(),S=H.getModel(["select","itemStyle"]).getItemStyle(),T=H.get(["itemStyle","borderRadius"]),P=Y.get("focus"),k=Y.get("blurScope"),I=Y.get("disabled"),A=Nr(H)}N.shape.r=T;var Z=r.getRawValue(D),J="-";Z&&Z[2]!=null&&(J=Z[2]+""),Ur(N,A,{labelFetcher:r,labelDataIndex:D,defaultOpacity:B.opacity,defaultText:J}),N.ensureState("emphasis").style=x,N.ensureState("blur").style=b,N.ensureState("select").style=S,Gt(N,P,k,I),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 JUe;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,x=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],b=l.mapArray(x,function(M,P,k){var I=r.dataToPoint([M,P]);return I[0]-=h,I[1]-=d,I.push(k),I}),S=i.getExtent(),T=i.type==="visualMap.continuous"?t7e(S,i.option.range):e7e(S,i.getPieceList(),i.option.selected);u.update(b,m,y,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var A=new Xr({style:{width:m,height:y,x:h,y:d,image:u.canvas},silent:!0});this.group.add(A)},t.type="heatmap",t}(_t),n7e=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 Yo(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=zv.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:K.color.primary}}},t}(St);function i7e(e){e.registerChartView(r7e),e.registerSeriesModel(n7e)}var a7e=["itemStyle","borderWidth"],JW=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],CM=new Zo,o7e=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:JW[+c],categoryDim:JW[1-+c]};o.diff(s).add(function(v){if(o.hasValue(v)){var g=tH(o,v),m=eH(o,v,g,h),y=rH(o,h,m);o.setItemGraphicEl(v,y),a.add(y),iH(y,h,m)}}).update(function(v,g){var m=s.getItemGraphicEl(g);if(!o.hasValue(v)){a.remove(m);return}var y=tH(o,v),x=eH(o,v,y,h),b=Ane(o,x);m&&b!==m.__pictorialShapeStr&&(a.remove(m),o.setItemGraphicEl(v,null),m=null),m?d7e(m,h,x):m=rH(o,h,x,!0),o.setItemGraphicEl(v,m),m.__pictorialSymbolMeta=x,a.add(m),iH(m,h,x)}).remove(function(v){var g=s.getItemGraphicEl(v);g&&nH(s,v,g.__pictorialSymbolMeta.animationModel,g)}).execute();var d=r.get("clip",!0)?m0(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){nH(a,De(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(_t);function eH(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};s7e(r,a,i,n,h),l7e(e,t,i,a,o,h.boundingLength,h.pxSign,c,n,h),u7e(r,h.symbolScale,u,n,h);var d=h.symbolSize,v=Tf(r.get("symbolOffset"),d);return c7e(r,d,i,a,o,v,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,n,h),h}function s7e(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(ie(o)){var f=[MM(s,o[0])-l,MM(s,o[1])-l];f[1]=0?1:-1:c>0?1:-1}function MM(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function l7e(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;ie(d)?v=d.slice():d==null?v=["100%","100%"]:v=[d,d],v[f.index]=de(v[f.index],h),v[c.index]=de(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 u7e(e,t,r,n,i){var a=e.get(a7e)||0;a&&(CM.attr({scaleX:t[0],scaleY:t[1],rotation:r}),CM.updateTransform(),a/=CM.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function c7e(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),x=nn(e.get("symbolMargin"),"15%")+"",b=!1;x.lastIndexOf("!")===x.length-1&&(b=!0,x=x.slice(0,x.length-1));var S=de(x,t[d.index]),T=Math.max(g+S*2,0),A=b?0:S*2,M=cN(n),P=M?n:aH((y+A)/T),k=y-P*g;S=k/2/(b?P:Math.max(P-1,1)),T=g+S*2,A=b?0:S*2,!M&&n!=="fixed"&&(P=u?aH((Math.abs(u)+A)/T):0),m=P*T-A,f.repeatTimes=P,f.symbolMargin=S}var I=v*(m/2),O=f.pathPosition=[];O[h.index]=r[h.wh]/2,O[d.index]=o==="start"?I:o==="end"?l-I:l/2,a&&(O[0]+=a[0],O[1]+=a[1]);var D=f.bundlePosition=[];D[h.index]=r[h.xy],D[d.index]=r[d.xy];var N=f.barRectShape=re({},r);N[d.wh]=v*Math.max(Math.abs(r[d.wh]),Math.abs(O[d.index]+I)),N[h.wh]=r[h.wh];var B=f.clipShape={};B[h.xy]=-r[h.xy],B[h.wh]=c.ecSize[h.wh],B[d.xy]=0,B[d.wh]=r[d.wh]}function _ne(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 bne(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(tR(e,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c0:y<0)&&(x=u-1-g),m[l.index]=f*(x-u/2+.5)+s[l.index],{x:m[0],y:m[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function wne(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?ld(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=_ne(r),i.add(a),ld(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 Sne(e,t,r){var n=re({},t.barRectShape),i=e.__pictorialBarRect;i?ld(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 Tne(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=re({},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],bf[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function tH(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=f7e,r.isAnimationEnabled=h7e,r}function f7e(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function h7e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function rH(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?bne(i,t,r):wne(i,t,r),Sne(i,r,n),Tne(i,t,r,n),i.__pictorialShapeStr=Ane(e,r),i.__pictorialSymbolMeta=r,i}function d7e(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?bne(e,t,r,!0):wne(e,t,r,!0),Sne(e,r,!0),Tne(e,t,r,!0)}function nH(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];tR(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),R(a,function(o){ru(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function Ane(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function tR(e,t,r){R(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function ld(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&bf[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function iH(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");tR(e,function(g){if(g instanceof Xr){var m=g.style;g.useStyle(re({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:ev(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Gt(e,c,f,a.get("disabled"))}function aH(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var v7e=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=yu(My.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:K.color.primary}}}),t}(My);function p7e(e){e.registerChartView(o7e),e.registerSeriesModel(v7e),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Be(Hee,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Uee("pictorialBar"))}var g7e=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 Vs(this._layersSeries||[],l,h,h),v=[];d.add(pe(g,this,"add")).update(pe(g,this,"update")).remove(pe(g,this,"remove")).execute();function g(m,y,x){var b=o._layers;if(m==="remove"){s.remove(b[y]);return}for(var S=[],T=[],A,M=l[y].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=f)}return{y0:i,max:a}}function b7e(e){e.registerChartView(g7e),e.registerSeriesModel(y7e),e.registerLayout(x7e),e.registerProcessor(Uv("themeRiver"))}var w7e=2,S7e=4,sH=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=w7e,o.textConfig={inside:!0},De(o).seriesIndex=n.seriesIndex;var s=new at({z2:S7e,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=re({},c);f.label=null;var h=n.getVisual("style");h.lineJoin="bevel";var d=n.getVisual("decal");d&&(h.decal=Kd(d,o));var v=Ao(l.getModel("itemStyle"),f,!0);re(f,v),R(Yn,function(x){var b=s.ensureState(x),S=l.getModel([x,"itemStyle"]);b.style=S.getItemStyle();var T=Ao(S,f);T&&(b.shape=T)}),r?(s.setShape(f),s.shape.r=c.r0,Nt(s,{shape:{r:c.r}},i,n.dataIndex)):(lt(s,{shape:f},i),pa(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"?Gd(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)B&&!Ud(F-B)&&F<$;M==="outside"?(I=o.r+O,D=G?"right":"left"):!D||D==="center"?(s===2*Math.PI&&o.r0===0?I=0:I=(o.r+o.r0)/2,D="center"):D==="left"?(I=o.r0+O,D=G?"right":"left"):D==="right"&&(I=o.r-O,D=G?"left":"right"),S.style.align=D,S.style.verticalAlign=m(x,"verticalAlign")||"middle",S.x=I*u+o.cx,S.y=I*c+o.cy;var z=0;N==="radial"?z=Pi(-l)+(G?Math.PI:0):N==="tangential"?z=Pi(Math.PI/2-l)+(G?Math.PI:0):ot(N)&&(z=N*Math.PI/180),S.rotation=Pi(z)});function m(y,x){var b=y.get(x);return b??a.get(x)}h.dirtyStyle()},t}(bn),dO="sunburstRootToNode",lH="sunburstHighlight",T7e="sunburstUnhighlight";function A7e(e){e.registerAction({type:dO,update:"updateView"},function(t,r){r.eachComponent({mainType:"series",subType:"sunburst",query:t},n);function n(i,a){var o=Ly(t,[dO],i);if(o){var s=i.getViewRoot();s&&(t.direction=Bj(s,o.node)?"rollUp":"drillDown"),i.resetViewRoot(o.node)}}}),e.registerAction({type:lH,update:"none"},function(t,r,n){t=re({},t),r.eachComponent({mainType:"series",subType:"sunburst",query:t},i);function i(a){var o=Ly(t,[lH],a);o&&(t.dataIndex=o.node.dataIndex)}n.dispatchAction(re(t,{type:"highlight"}))}),e.registerAction({type:T7e,update:"updateView"},function(t,r,n){t=re({},t),n.dispatchAction(re(t,{type:"downplay"}))})}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,a){var o=this;this.seriesModel=r,this.api=i,this.ecModel=n;var s=r.getData(),l=s.tree.root,u=r.getViewRoot(),c=this.group,f=r.get("renderLabelForZeroData"),h=[];u.eachNode(function(x){h.push(x)});var d=this._oldChildren||[];v(h,d),y(l,u),this._initEvents(),this._oldChildren=h;function v(x,b){if(x.length===0&&b.length===0)return;new Vs(b,x,S,S).add(T).update(T).remove(Be(T,null)).execute();function S(A){return A.getId()}function T(A,M){var P=A==null?null:x[A],k=M==null?null:b[M];g(P,k)}}function g(x,b){if(!f&&x&&!x.getValue()&&(x=null),x!==l&&b!==l){if(b&&b.piece)x?(b.piece.updateData(!1,x,r,n,i),s.setItemGraphicEl(x.dataIndex,b.piece)):m(b);else if(x){var S=new sH(x,r,n,i);c.add(S),s.setItemGraphicEl(x.dataIndex,S)}}}function m(x){x&&x.piece&&(c.remove(x.piece),x.piece=null)}function y(x,b){b.depth>0?(o.virtualPiece?o.virtualPiece.updateData(!1,x,r,n,i):(o.virtualPiece=new sH(x,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";hw(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:dO,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}(_t),M7e=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};Cne(i);var a=this._levelModels=se(r.levels||[],function(l){return new tt(l,this,n)},this),o=Rj.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=VT(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(){kre(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}(St);function Cne(e){var t=0;R(e.children,function(n){Cne(n);var i=n.value;ie(i)&&(i=i[0]),t+=i});var r=e.value;ie(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ie(e.value)?e.value[0]=r:e.value=r}var uH=Math.PI/180;function P7e(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");ie(a)||(a=[0,a]),ie(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=de(i[0],o),c=de(i[1],s),f=de(a[0],l/2),h=de(a[1],l/2),d=-n.get("startAngle")*uH,v=n.get("minAngle")*uH,g=n.getData().tree.root,m=n.getViewRoot(),y=m.depth,x=n.get("sort");x!=null&&Mne(m,x);var b=0;R(m.children,function(F){!isNaN(F.getValue())&&b++});var S=m.getValue(),T=Math.PI/(S||b)*2,A=m.depth>0,M=m.height-(A?-1:1),P=(h-f)/(M||1),k=n.get("clockwise"),I=n.get("stillShowZeroSum"),O=k?1:-1,D=function(F,G){if(F){var z=G;if(F!==g){var U=F.getValue(),H=S===0&&I?T:U*T;H1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&ve(s)&&(s=Q1(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");re(u,l)})})}function I7e(e){e.registerChartView(C7e),e.registerSeriesModel(M7e),e.registerLayout(Be(P7e,"sunburst")),e.registerProcessor(Be(Uv,"sunburst")),e.registerVisual(k7e),A7e(e)}var cH={color:"fill",borderColor:"stroke"},O7e={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Ms=Je(),E7e=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 Yo(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=Ms(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}(St);function D7e(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 N7e(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:pe(D7e,e)}}}function j7e(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 R7e(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:pe(j7e,e)}}}function B7e(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:pe(B7e,e)}}}function $7e(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 F7e(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:pe($7e,e)}}}function V7e(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 G7e(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 Pne(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||ye(e,"text")))}function Lne(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},ye(n,"text")&&(o.text=n.text),ye(n,"rich")&&(o.rich=n.rich),ye(n,"textFill")&&(o.fill=n.textFill),ye(n,"textStroke")&&(o.stroke=n.textStroke),ye(n,"fontFamily")&&(o.fontFamily=n.fontFamily),ye(n,"fontSize")&&(o.fontSize=n.fontSize),ye(n,"fontStyle")&&(o.fontStyle=n.fontStyle),ye(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=ye(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),ye(n,"textPosition")&&(i.position=n.textPosition),ye(n,"textOffset")&&(i.offset=n.textOffset),ye(n,"textRotation")&&(i.rotation=n.textRotation),ye(n,"textDistance")&&(i.distance=n.textDistance)}return fH(o,e),R(o.rich,function(l){fH(l,l)}),{textConfig:i,textContent:a}}function fH(e,t){t&&(t.font=t.textFont||t.font,ye(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),ye(t,"textAlign")&&(e.align=t.textAlign),ye(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),ye(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),ye(t,"textWidth")&&(e.width=t.textWidth),ye(t,"textHeight")&&(e.height=t.textHeight),ye(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),ye(t,"textPadding")&&(e.padding=t.textPadding),ye(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),ye(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),ye(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),ye(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),ye(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),ye(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),ye(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function hH(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||K.color.neutral99;dH(n,t);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||K.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||K.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,R(t.rich,function(s){dH(s,s)}),n}function dH(e,t){t&&(ye(t,"fill")&&(e.textFill=t.fill),ye(t,"stroke")&&(e.textStroke=t.fill),ye(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),ye(t,"font")&&(e.font=t.font),ye(t,"fontStyle")&&(e.fontStyle=t.fontStyle),ye(t,"fontWeight")&&(e.fontWeight=t.fontWeight),ye(t,"fontSize")&&(e.fontSize=t.fontSize),ye(t,"fontFamily")&&(e.fontFamily=t.fontFamily),ye(t,"align")&&(e.textAlign=t.align),ye(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),ye(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),ye(t,"width")&&(e.textWidth=t.width),ye(t,"height")&&(e.textHeight=t.height),ye(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),ye(t,"padding")&&(e.textPadding=t.padding),ye(t,"borderColor")&&(e.textBorderColor=t.borderColor),ye(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),ye(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),ye(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),ye(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),ye(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),ye(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),ye(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),ye(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),ye(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),ye(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var kne={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},vH=it(kne);ha(Bo,function(e,t){return e[t]=1,e},{});Bo.join(", ");var $w=["","style","shape","extra"],iv=Je();function rR(e,t,r,n,i){var a=e+"Animation",o=Dv(e,n,i)||{},s=iv(t).userDuring;return o.duration>0&&(o.during=s?pe(Y7e,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),re(o,r[a]),o}function cb(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=iv(e),u=t.style;l.userDuring=t.during;var c={},f={};if(q7e(e,t,f),e.type==="compound")for(var h=e.shape.paths,d=t.shape.paths,v=0;v0&&e.animateFrom(m,y)}else H7e(e,t,i||0,r,c);Ine(e,t),u?e.dirty():e.markRedraw()}function Ine(e,t){for(var r=iv(e).leaveToProps,n=0;n<$w.length;n++){var i=$w[n],a=i?t[i]:t;a&&a.leaveTo&&(r||(r=iv(e).leaveToProps={}),i&&(r[i]=r[i]||{}),re(i?r[i]:r,a.leaveTo))}}function HT(e,t,r,n){if(e){var i=e.parent,a=iv(e).leaveToProps;if(a){var o=rR("update",e,t,r,0);o.done=function(){i&&i.remove(e)},e.animateTo(a,o)}else i&&i.remove(e)}}function $c(e){return e==="all"}function W7e(e,t,r){var n=t.style;if(!e.isGroup&&n){if(r){e.useStyle({});for(var i=e.animators,a=0;a0&&e.animateFrom(i,a)}}function U7e(e,t){ye(t,"silent")&&(e.silent=t.silent),ye(t,"ignore")&&(e.ignore=t.ignore),e instanceof va&&ye(t,"invisible")&&(e.invisible=t.invisible),e instanceof rt&&ye(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var co={},Z7e={setTransform:function(e,t){return co.el[e]=t,this},getTransform:function(e){return co.el[e]},setShape:function(e,t){var r=co.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=co.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=co.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=co.el.style;if(t)return t[e]},setExtra:function(e,t){var r=co.el.extra||(co.el.extra={});return r[e]=t,this},getExtra:function(e){var t=co.el.extra;if(t)return t[e]}};function Y7e(){var e=this,t=e.el;if(t){var r=iv(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}co.el=t,n(Z7e)}}function pH(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]={}),$c(l))re(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(z,F):void 0}var U=t.get(G.name,F),H=G&&G.ordinalMeta;return H?H.categories[U]:U}function M($,F){F==null&&(F=c);var G=t.getItemVisual(F,"style"),z=G&&G.fill,U=G&&G.opacity,H=b(F,Il).getItemStyle();z!=null&&(H.fill=z),U!=null&&(H.opacity=U);var Y={inheritColor:ve(z)?z:K.color.neutral99},Z=S(F,Il),J=Mt(Z,null,Y,!1,!0);J.text=Z.getShallow("show")?be(e.getFormattedLabel(F,Il),ev(t,F)):null;var ae=uw(Z,Y,!1);return I($,H),H=hH(H,J,ae),$&&k(H,$),H.legacy=!0,H}function P($,F){F==null&&(F=c);var G=b(F,Ps).getItemStyle(),z=S(F,Ps),U=Mt(z,null,null,!0,!0);U.text=z.getShallow("show")?fi(e.getFormattedLabel(F,Ps),e.getFormattedLabel(F,Il),ev(t,F)):null;var H=uw(z,null,!0);return I($,G),G=hH(G,U,H),$&&k(G,$),G.legacy=!0,G}function k($,F){for(var G in F)ye(F,G)&&($[G]=F[G])}function I($,F){$&&($.textFill&&(F.textFill=$.textFill),$.textPosition&&(F.textPosition=$.textPosition))}function O($,F){if(F==null&&(F=c),ye(cH,$)){var G=t.getItemVisual(F,"style");return G?G[cH[$]]:null}if(ye(O7e,$))return t.getItemVisual(F,$)}function D($){if(o.type==="cartesian2d"){var F=o.getBaseAxis();return r$e(Pe({axis:F},$))}}function N(){return r.getCurrentSeriesIndices()}function B($){return kN($,r)}}function s9e(e){var t={};return R(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 OM(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=sR(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Gt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function sR(e,t,r,n,i,a){var o=-1,s=t;t&&Nne(t,n,i)&&(o=Ve(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=aR(n),s&&n9e(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,u9e(u,r,n,i,l,Hi),l9e(u,r,n,i,l),oR(e,u,r,n,Hi,i,l),ye(n,"info")&&(Ms(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function Nne(e,t,r){var n=Ms(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&v9e(a)&&jne(a)!==n.customPathData||i==="image"&&ye(o,"image")&&o.image!==n.customImagePath}function l9e(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&&Nne(o,a,n)&&(o=null),o||(o=aR(a),e.setClipPath(o)),oR(null,o,t,a,null,n,i)}}function u9e(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){mH(r,null,a),mH(r,Ps,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=aR(o),e.setTextContent(c)),oR(null,c,t,o,null,n,i);for(var f=o&&o.style,h=0;h=c;d--){var v=t.childAt(d);f9e(t,v,i)}}}function f9e(e,t,r){t&&HT(t,Ms(e).option,r)}function h9e(e){new Vs(e.oldChildren,e.newChildren,yH,yH,e).add(xH).update(xH).remove(d9e).execute()}function yH(e,t){var r=e&&e.name;return r??t9e+t}function xH(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;sR(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function d9e(e){var t=this.context,r=t.oldChildren[e];r&&HT(r,Ms(r).option,t.seriesModel)}function jne(e){return e&&(e.pathData||e.d)}function v9e(e){return e&&(ye(e,"pathData")||ye(e,"d"))}function p9e(e){e.registerChartView(i9e),e.registerSeriesModel(E7e)}var hc=Je(),_H=Ce,EM=pe,uR=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=Be(bH,r,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,r)}SH(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=kj(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=hc(t).pointerEl=new bf[a.type](_H(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=hc(t).labelEl=new at(_H(r.label));t.add(a),wH(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=hc(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=hc(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),wH(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=Nv(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){zs(u.event)},onmousedown:EM(this._onHandleDragMove,this,0,0),drift:EM(this._onHandleDragMove,this),ondragend:EM(this._onHandleDragEnd,this)}),n.add(i)),SH(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");ie(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,Fv(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){bH(this._axisPointerModel,!r&&this._moveAnimation,this._handle,DM(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(DM(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(DM(i)),hc(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),xy(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 bH(e,t,r,n){Rne(hc(r).lastProp,n)||(hc(r).lastProp=n,t?lt(r,n,e):(r.stopAnimation(),r.attr(n)))}function Rne(e,t){if(Le(e)&&Le(t)){var r=!0;return R(t,function(n,i){r=r&&Rne(e[i],n)}),!!r}else return e===t}function wH(e,t){e[t.get(["label","show"])?"show":"hide"]()}function DM(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function SH(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 Bne(e,t,r,n,i){var a=r.get("value"),o=zne(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=Bv(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),g9e(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 g9e(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 zne(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:Sw(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};R(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),ve(o)?a=o.replace("{value}",a):Ae(o)&&(a=o(s))}return a}function fR(e,t,r){var n=Wr();return qs(n,n,r.rotation),Ua(n,n,r.position),Ga([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function $ne(e,t,r,n,i,a){var o=Hn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Bne(t,n,i,a,{position:fR(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function hR(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function Fne(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function TH(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var m9e=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=AH(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var h=cR(a),d=y9e[u](s,f,c);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=Ew(l.getRect(),i);$ne(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=Ew(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=fR(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=AH(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}(uR);function AH(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var y9e={line:function(e,t,r){var n=hR([t,r[0]],[t,r[1]],CH(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:Fne([t-n/2,r[0]],[n,i],CH(e))}}};function CH(e){return e.dim==="x"?0:1}var x9e=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:K.color.border,width:1,type:"dashed"},shadowStyle:{color:K.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:K.color.neutral00,padding:[5,7,5,7],backgroundColor:K.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:K.color.accent40,throttle:40}},t}(Qe),xs=Je(),_9e=R;function Vne(e,t,r){if(!nt.node){var n=t.getZr();xs(n).records||(xs(n).records={}),b9e(n,t);var i=xs(n).records[e]||(xs(n).records[e]={});i.handler=r}}function b9e(e,t){if(xs(e).initialized)return;xs(e).initialized=!0,r("click",Be(MH,"click")),r("mousemove",Be(MH,"mousemove")),r("globalout",S9e);function r(n,i){e.on(n,function(a){var o=T9e(t);_9e(xs(e).records,function(s){s&&i(s,a,o.dispatchAction)}),w9e(o.pendings,t)})}}function w9e(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 S9e(e,t,r){e.handler("leave",null,r)}function MH(e,t,r,n){t.handler(e,r,n)}function T9e(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 gO(e,t){if(!nt.node){var r=t.getZr(),n=(xs(r).records||{})[e];n&&(xs(r).records[e]=null)}}var A9e=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";Vne("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){gO("axisPointer",n)},t.prototype.dispose=function(r,n){gO("axisPointer",n)},t.type="axisPointer",t}(Lt);function Gne(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=ef(a,e);if(o==null||o<0||ie(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 PH=Je();function C9e(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||pe(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){fb(i)&&(i=Gne({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=fb(i),u=a.axesInfo,c=s.axesInfo,f=n==="leave"||fb(i),h={},d={},v={list:[],map:{}},g={showPointer:Be(P9e,d),showTooltip:Be(L9e,v)};R(s.coordSysMap,function(y,x){var b=l||y.containPoint(i);R(s.coordSysAxesInfo[x],function(S,T){var A=S.axis,M=E9e(u,S);if(!f&&b&&(!u||M)){var P=M&&M.value;P==null&&!l&&(P=A.pointToData(i)),P!=null&&LH(S,P,g,!1,h)}})});var m={};return R(c,function(y,x){var b=y.linkGroup;b&&!d[x]&&R(b.axesInfo,function(S,T){var A=d[T];if(S!==y&&A){var M=A.value;b.mapper&&(M=y.axis.scale.parse(b.mapper(M,kH(S),kH(y)))),m[y.key]=M}})}),R(m,function(y,x){LH(c[x],y,g,!0,h)}),k9e(d,c,h),I9e(v,i,e,o),O9e(c,o,r),h}}function LH(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=M9e(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&re(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function M9e(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return R(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),R(h,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:i}}function P9e(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function L9e(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=Py(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 k9e(e,t,r){var n=r.axesInfo=[];R(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 I9e(e,t,r,n){if(fb(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 O9e(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=PH(n)[i]||{},o=PH(n)[i]={};R(e,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&R(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];R(a,function(u,c){!o[c]&&l.push(u)}),R(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 E9e(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 kH(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 fb(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function _0(e){Af.registerAxisPointerClass("CartesianAxisPointer",m9e),e.registerComponentModel(x9e),e.registerComponentView(A9e),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!ie(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=D6e(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},C9e)}function D9e(e){Ze(dre),Ze(_0)}var N9e=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=R9e[h](s,l,f,c);v.style=d,r.graphicKey=v.type,r.pointer=v}var g=a.get(["label","margin"]),m=j9e(n,i,a,l,g);Bne(r,i,a,o,m)},t}(uR);function j9e(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),Ua(h,h,[n.cx,n.cy]),u=Ga([o,-i],h);var d=t.getModel("axisLabel").get("rotate")||0,v=Hn.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 R9e={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:hR(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:TH(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:TH(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},B9e=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}(Qe),dR=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",tr).models[0]},t.type="polarAxis",t}(Qe);fr(dR,Hv);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}(dR),$9e=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}(dR),vR=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}(_a);vR.prototype.dataToRadius=_a.prototype.dataToCoord;vR.prototype.radiusToData=_a.prototype.coordToData;var F9e=Je(),pR=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=F9e(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}(_a);pR.prototype.dataToAngle=_a.prototype.dataToCoord;pR.prototype.angleToData=_a.prototype.coordToData;var Wne=["radius","angle"],V9e=function(){function e(t){this.dimensions=Wne,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new vR,this._angleAxis=new pR,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=IH(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=IH(r);return i===this?this.pointToData(n):null},e}();function IH(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function G9e(e,t,r){var n=t.get("center"),i=jr(t,r).refContainer;e.cx=de(n[0],i.width)+i.x,e.cy=de(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%"]:ie(s)||(s=[0,s]);var l=[de(s[0],o),de(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function W9e(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();R(Tw(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),R(Tw(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),sf(n.scale,n.model),sf(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 H9e(e){return e.mainType==="angleAxis"}function OH(e,t){var r;if(e.type=t.get("type"),e.scale=v0(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),H9e(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 U9e={dimensions:Wne,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new V9e(i+"");a.update=W9e;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");OH(o,l),OH(s,u),G9e(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",tr).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},Z9e=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function b_(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 w_(e){var t=e.getRadiusAxis();return t.inverse?0:1}function EH(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 Y9e=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=Ce(c);var f=i.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(h),c});EH(u),EH(s),R(Z9e,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&X9e[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(Af),X9e={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=w_(r),f=c?0:1,h,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new bf[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 Ov({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[w_(r)],u=se(n,function(c){return new yr({shape:b_(r,[l,l+s],c.coord)})});e.add(Ti(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[w_(r)],c=[],f=0;fy?"left":"right",S=Math.abs(m[1]-x)/g<.3?"middle":m[1]>x?"top":"bottom";if(s&&s[v]){var T=s[v];Le(T)&&T.textStyle&&(d=new tt(T.textStyle,l,l.ecModel))}var A=new at({silent:Hn.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(A),Qs({el:A,componentModel:t,itemName:f.formattedLabel,formatterParamsExtra:{isTruncated:function(){return A.isTruncated},value:f.rawLabel,tickIndex:h}}),c){var M=Hn.makeAxisEventDataBase(t);M.targetType="axisLabel",M.value=f.rawLabel,De(A).eventData=M}},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",$=k;T&&(n[c][N]||(n[c][N]={p:k,n:k}),$=n[c][N][B]);var F=void 0,G=void 0,z=void 0,U=void 0;if(v.dim==="radius"){var H=v.dataToCoord(D)-k,Y=l.dataToCoord(N);Math.abs(H)=U})}}})}function tZe(e){var t={};R(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=Une(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=Hne(n);h[d]||f.autoWidthCount++,h[d]=h[d]||{width:0,maxWidth:0};var v=de(n.get("barWidth"),c),g=de(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 R(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=de(n.categoryGap,o),l=de(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),R(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=DH(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=DH(r);return i===this?this.pointToData(n):null},e}();function DH(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function fZe(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new cZe(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",tr).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var hZe={create:fZe,dimensions:Zne},NH=["x","y"],dZe=["width","height"],vZe=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=NM(l,1-Gw(s)),c=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var h=cR(a),d=pZe[f](s,c,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=mO(i);$ne(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=mO(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=fR(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=Gw(o),u=NM(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=NM(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}(uR),pZe={line:function(e,t,r){var n=hR([t,r[0]],[t,r[1]],Gw(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:Fne([t-n/2,r[0]],[n,i],Gw(e))}}};function Gw(e){return e.isHorizontal()?0:1}function NM(e,t){var r=e.getRect();return[r[NH[t]],r[NH[t]]+r[dZe[t]]]}var gZe=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}(Lt);function mZe(e){Ze(_0),Af.registerAxisPointerClass("SingleAxisPointer",vZe),e.registerComponentView(gZe),e.registerComponentView(sZe),e.registerComponentModel(hb),tv(e,"single",hb,hb.defaultOption),e.registerCoordinateSystem("single",hZe)}var yZe=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=wf(r);e.prototype.init.apply(this,arguments),jH(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),jH(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:K.color.axisLine,width:1,type:"solid"}},itemStyle:{color:K.color.neutral00,borderWidth:1,borderColor:K.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:K.size.s,color:K.color.secondary},monthLabel:{show:!0,position:"start",margin:K.size.s,align:"center",formatter:null,color:K.color.secondary},yearLabel:{show:!0,position:null,margin:K.size.xl,formatter:null,color:K.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(Qe);function jH(e,t){var r=e.cellSize,n;ie(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=se([0,1],function(a){return $Be(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Fo(e,t,{type:"box",ignoreSize:i})}var xZe=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 on({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 ve(r)&&r?EBe(r,n):Ae(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),x=new at({z2:30,style:Mt(o,{text:y}),silent:o.get("silent")});x.attr(this._yearTextPositionControl(x,d[l],i,l,s)),a.add(x)}},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||ve(s))&&(s&&(n=hI(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){h0({targetModel:a,coordSysType:"calendar",coordSysProvider:hJ})}),n},e.dimensions=["time","value"],e}();function RM(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function bZe(e){e.registerComponentModel(yZe),e.registerComponentView(xZe),e.registerCoordinateSystem("calendar",_Ze)}var cs={level:1,leaf:2,nonLeaf:3},Ls={none:0,all:1,body:2,corner:3};function yO(e,t,r){var n=t[Re[r]].getCell(e);return!n&&ot(e)&&e<0&&(n=t[Re[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function Yne(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 Xne(e,t,r,n,i){RH(e[0],t,i,r,n,0),RH(e[1],t,i,r,n,1)}function RH(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=ie(o)?o:[o],l=s.length,u=!!r;if(l>=1?(BH(e,t,s,u,i,a,0),l>1&&BH(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Re[1-a]].getLocatorCount(a),f=i[Re[a]].getLocatorCount(a)-1;r===Ls.body?c=gr(0,c):r===Ls.corner&&(f=Ii(-1,f)),f=t[0]&&e[0]<=t[1]}function FH(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 TZe(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 VH(e,t,r,n){var i=yO(t[n][0],r,n),a=yO(t[n][1],r,n);e[Re[n]]=e[Tr[n]]=NaN,i&&a&&(e[Re[n]]=i.xy,e[Tr[n]]=a.xy+a.wh-i.xy)}function Kp(e,t,r,n){return e[Re[t]]=r,e[Re[1-t]]=n,e}function AZe(e){return e&&(e.type===cs.leaf||e.type===cs.nonLeaf)?e:null}function Ww(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var GH=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=CZe(t);var n=r.get("data",!0);n!=null&&!ie(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&&R(u,function(d,v){var g;ve(d)?g={value:d}:Le(d)?(g=d,d.value!=null&&!ve(d.value)&&(g={value:null})):g={value:null};var m={type:cs.nonLeaf,ordinal:NaN,level:f,firstLeafLocator:c,id:new Ie,span:Kp(new Ie,r.dimIdx,1,1),option:g,xy:NaN,wh:NaN,dim:r,rect:Ww()};o++,(a[c]||(a[c]=[])).push(m),i[f]||(i[f]={type:cs.level,xy:NaN,wh:NaN,option:null,id:new Ie,dim:r});var y=s(g.children,c,f+1),x=Math.max(1,y);m.span[Re[r.dimIdx]]=x,h+=x,c+=x}),h}function l(){for(var u=[];n.length=1,b=r[Re[n]],S=a.getLocatorCount(n)-1,T=new Hl;for(o.resetLayoutIterator(T,n);T.next();)A(T.item);for(a.resetLayoutIterator(T,n);T.next();)A(T.item);function A(M){mn(M.wh)&&(M.wh=y),M.xy=b,M.id[Re[n]]===S&&!x&&(M.wh=r[Re[n]]+r[Tr[n]]-M.xy),b+=M.wh}}function qH(e,t){for(var r=t[Re[e]].resetCellIterator();r.next();){var n=r.item;Hw(n.rect,e,n.id,n.span,t),Hw(n.rect,1-e,n.id,n.span,t),n.type===cs.nonLeaf&&(n.xy=n.rect[Re[e]],n.wh=n.rect[Tr[e]])}}function KH(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;Hw(i,0,a,n,t),Hw(i,1,a,n,t)}})}function Hw(e,t,r,n,i){e[Tr[t]]=0;var a=r[Re[t]],o=a<0?i[Re[1-t]]:i[Re[t]],s=o.getUnitLayoutInfo(t,r[Re[t]]);if(e[Re[t]]=s.xy,e[Tr[t]]=s.wh,n[Re[t]]>1){var l=o.getUnitLayoutInfo(t,r[Re[t]]+n[Re[t]]-1);e[Tr[t]]=l.xy+l.wh-s.xy}}function zZe(e,t,r){var n=iw(e,r[Tr[t]]);return _O(n,r[Tr[t]])}function _O(e,t){return Math.max(Math.min(e,be(t,1/0)),0)}function $M(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var dn={inBody:1,inCorner:2,outside:3},lo={x:null,y:null,point:[]};function QH(e,t,r,n,i){var a=r[Re[t]],o=r[Re[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[Re[t]]=dn.outside;return}if(i===Ls.body){l?(e[Re[t]]=dn.inBody,f=Ii(s.xy+s.wh,gr(l.xy,f)),e.point[t]=f):e[Re[t]]=dn.outside;return}else if(i===Ls.corner){c?(e[Re[t]]=dn.inCorner,f=Ii(c.xy+c.wh,gr(u.xy,f)),e.point[t]=f):e[Re[t]]=dn.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[Re[t]]=dn.outside;return}f=v}e.point[t]=f,e[Re[t]]=h<=f&&f<=v?dn.inBody:d<=f&&f<=h?dn.inCorner:dn.outside}function JH(e,t,r,n){var i=1-r;if(e[Re[r]]!==dn.outside)for(n[Re[r]].resetCellIterator(zM);zM.next();){var a=zM.item;if(t8(e.point[r],a.rect,r)&&t8(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Re[i]];return}}}function e8(e,t,r,n){if(e[Re[r]]!==dn.outside){var i=e[Re[r]]===dn.inCorner?n[Re[1-r]]:n[Re[r]];for(i.resetLayoutIterator(M_,r);M_.next();)if($Ze(e.point[r],M_.item)){t[r]=M_.item.id[Re[r]];return}}}function $Ze(e,t){return t.xy<=e&&e<=t.xy+t.wh}function t8(e,t,r){return t[Re[r]]<=e&&e<=t[Re[r]]+t[Tr[r]]}function FZe(e){e.registerComponentModel(kZe),e.registerComponentView(NZe),e.registerCoordinateSystem("matrix",BZe)}function VZe(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 r8(e,t){var r;return R(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function GZe(e,t,r){var n=re({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(We(i,n,!0),Fo(i,n,{ignoreSize:!0}),mJ(r,i),P_(r,i),P_(r,i,"shape"),P_(r,i,"style"),P_(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var Kne=["transition","enterFrom","leaveTo"],WZe=Kne.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function P_(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?Kne:WZe,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),x=v===a?{width:s,height:l}:{width:y.width,height:y.height},b={},S=LT(d,f,x,null,{hv:f.hv,boundingMode:f.bounding},b);if(!qi(d).isNew&&S){for(var T=f.transition,A={},M=0;M=0)?A[P]=k:d[P]=k}lt(d,A,r,0)}else d.attr(b)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){db(i,qi(i).option,n,r._lastGraphicModel)}),this._elMap=_e()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Lt);function bO(e){var t=ye(n8,e)?n8[e]:py(e),r=new t({});return qi(r).type=e,r}function i8(e,t,r,n){var i=bO(r);return t.add(i),n.set(e,i),qi(i).id=e,qi(i).isNew=!0,i}function db(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){db(a,t,r,n)}),HT(e,t,n),r.removeKey(qi(e).id))}function a8(e,t,r,n){e.isGroup||R([["cursor",va.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];ye(t,a)?e[a]=be(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),R(it(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=Ae(a)?a:null}}),ye(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function YZe(e){return e=re({},e),R(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(dJ),function(t){delete e[t]}),e}function XZe(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 qZe(e){e.registerComponentModel(UZe),e.registerComponentView(ZZe),e.registerPreprocessor(function(t){var r=t.graphic;ie(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var o8=["x","y","radius","angle","single"],KZe=["cartesian2d","polar","singleAxis"];function QZe(e){var t=e.get("coordinateSystem");return Ve(KZe,t)>=0}function Ol(e){return e+"Axis"}function JZe(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 Qne(e){var t=e.ecModel,r={infoList:[],infoMap:_e()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(Ol(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 FM=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}(),Dy=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=s8(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=s8(r);We(this.option,r,!0),We(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;R([["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 R(o8,function(i){var a=this.getReferringComponents(Ol(i),mRe);if(a.specified){n=!0;var o=new FM;R(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 FM;if(h.add(f.componentIndex),r.set(c,h),a=!1,c==="x"||c==="y"){var d=f.getReferringComponents("grid",tr).models[0];d&&R(u,function(v){f.componentIndex!==v.componentIndex&&d===v.getReferringComponents("grid",tr).models[0]&&h.add(v.componentIndex)})}}}a&&R(o8,function(u){if(a){var c=i.findComponents({mainType:Ol(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new FM;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");R([["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(Ol(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){R(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(Ol(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;R([["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;R(["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 _h(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)}});_h(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;_h(["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=sN(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 nYe(e,t,r){var n=[1/0,-1/0];_h(r,function(o){b$e(n,o.getData(),t)});var i=e.getAxisModel(),a=Kee(i.axis.scale,i,n).calculate();return[a.min,a.max]}var iYe={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(Ol(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 rYe(i,a,s,e),r.push(o.__dzAxisProxy))});var n=_e();return R(r,function(i){R(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 aYe(e){e.registerAction("dataZoom",function(t,r){var n=JZe(r,t);R(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var u8=!1;function xR(e){u8||(u8=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,iYe),aYe(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function oYe(e){e.registerComponentModel(eYe),e.registerComponentView(tYe),xR(e)}var ea=function(){function e(){}return e}(),Jne={};function bh(e,t){Jne[e]=t}function eie(e){return Jne[e]}var sYe=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;R(this.option.feature,function(n,i){var a=eie(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),We(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:K.color.border,borderRadius:0,borderWidth:0,padding:K.size.m,itemSize:15,itemGap:K.size.s,showTitle:!0,iconStyle:{borderColor:K.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:K.color.accent50}},tooltip:{show:!1,position:"bottom"}},t}(Qe);function tie(e,t){var r=Bv(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 lYe=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=[];R(u,function(x,b){f.push(b)}),new Vs(this._featureNames||[],f).add(h).update(h).remove(Be(h,null)).execute(),this._featureNames=f;function h(x,b){var S=f[x],T=f[b],A=u[S],M=new tt(A,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(A.title=a.newTitle),S&&!T){if(uYe(S))P={onclick:M.option.onclick,featureName:S};else{var k=eie(S);if(!k)return;P=new k}c[S]=P}else if(P=c[T],!P)return;P.uid=Rv("toolbox-feature"),P.model=M,P.ecModel=n,P.api=i;var I=P instanceof ea;if(!S&&T){I&&P.dispose&&P.dispose(n,i);return}if(!M.get("show")||I&&P.unusable){I&&P.remove&&P.remove(n,i);return}d(M,P,S),M.setIconStatus=function(O,D){var N=this.option,B=this.iconPaths;N.iconStatus=N.iconStatus||{},N.iconStatus[O]=D,B[O]&&(D==="emphasis"?$s:Fs)(B[O])},P instanceof ea&&P.render&&P.render(M,n,i,a)}function d(x,b,S){var T=x.getModel("iconStyle"),A=x.getModel(["emphasis","iconStyle"]),M=b instanceof ea&&b.getIcons?b.getIcons():x.get("icon"),P=x.get("title")||{},k,I;ve(M)?(k={},k[S]=M):k=M,ve(P)?(I={},I[S]=P):I=P;var O=x.iconPaths={};R(k,function(D,N){var B=Nv(D,{},{x:-s/2,y:-s/2,width:s,height:s});B.setStyle(T.getItemStyle());var $=B.ensureState("emphasis");$.style=A.getItemStyle();var F=new at({style:{text:I[N],align:A.get("textAlign"),borderRadius:A.get("textBorderRadius"),padding:A.get("textPadding"),fill:null,font:kN({fontStyle:A.get("textFontStyle"),fontFamily:A.get("textFontFamily"),fontSize:A.get("textFontSize"),fontWeight:A.get("textFontWeight")},n)},ignore:!0});B.setTextContent(F),Qs({el:B,componentModel:r,itemName:N,formatterParamsExtra:{title:I[N]}}),B.__title=I[N],B.on("mouseover",function(){var G=A.getItemStyle(),z=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";F.setStyle({fill:A.get("textFill")||G.fill||G.stroke||K.color.neutral99,backgroundColor:A.get("textBackgroundColor")}),B.setTextConfig({position:A.get("textPosition")||z}),F.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){x.get(["iconStatus",N])!=="emphasis"&&i.leaveEmphasis(this),F.hide()}),(x.get(["iconStatus",N])==="emphasis"?$s:Fs)(B),o.add(B),B.on("click",pe(b.onclick,b,n,i,N)),O[N]=B})}var v=jr(r,i).refContainer,g=r.getBoxLayoutParams(),m=r.get("padding"),y=zt(g,v,m);Rc(r.get("orient"),o,r.get("itemGap"),y.width,y.height),LT(o,g,v,m),o.add(tie(o.getBoundingRect(),r)),l||o.eachChild(function(x){var b=x.__title,S=x.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),A=x.getTextContent(),M=A&&A.ensureState("emphasis");if(M&&!Ae(M)&&b){var P=M.style||(M.style={}),k=pT(b,at.makeFont(P)),I=x.x+o.x,O=x.y+o.y+s,D=!1;O+k.height>i.getHeight()&&(T.position="top",D=!0);var N=D?-5-k.height:s+10;I+k.width/2>i.getWidth()?(T.position=["100%",N],P.align="right"):I-k.width/2<0&&(T.position=[0,N],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){R(this._features,function(o){o instanceof ea&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){R(this._features,function(i){i instanceof ea&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){R(this._features,function(i){i instanceof ea&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(Lt);function uYe(e){return e.indexOf("my")===0}var cYe=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")||K.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 x=new Blob([y]);window.navigator.msSaveOrOpenBlob(x,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 A=i.get("lang"),M='',P=window.open();P.document.write(M),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:K.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(ea),c8="__ec_magicType_stack__",fYe=[["line","bar"],["stack"]],hYe=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 R(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(f8[i]){var s={series:[]},l=function(f){var h=f.subType,d=f.id,v=f8[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,x=y+"Axis",b=f.getReferringComponents(x,tr).models[0],S=b.componentIndex;s[x]=s[x]||[];for(var T=0;T<=S;T++)s[x][S]=s[x][S]||{};s[x][S].boundaryGap=i==="bar"}}};R(fYe,function(f){Ve(f,i)>=0&&R(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=We({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),f8={line:function(e,t,r,n){if(e==="bar")return We({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 We({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")===c8;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),We({id:t,stack:i?"":c8},n.get(["option","stack"])||{},!0)}};Ka({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var UT=new Array(60).join("-"),av=" ";function dYe(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 vYe(e){var t=[];return R(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()];R(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(av)],c=0;c"].join(n)}function FI(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function F6(e,t,r,n){return Gr("svg","root",{width:e,height:t,xmlns:xte,"xmlns:xlink":_te,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var PFe=0;function wte(){return PFe++}var V6={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"},ac="transform-origin";function LFe(e,t,r){var n=re({},e.shape);re(n,t),e.buildPath(r,n);var i=new yte;return i.reset(VK(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function kFe(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[ac]=r+"px "+n+"px")}var IFe={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Ste(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function OFe(e,t,r){var n=e.shape.paths,i={},a,o;if(R(n,function(l){var u=FI(r.zrId);u.animation=!0,BT(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=Ste(i,r);return a.replace(o,s)}}function G6(e){return ve(e)?V6[e]?"cubic-bezier("+V6[e]+")":nN(e)?e:"":""}function BT(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof c0){var s=OFe(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var We=Ste(M,r);return We+" "+_[0]+" both"}}for(var m in l){var s=g(l[m]);s&&o.push(s)}if(o.length){var y=r.zrId+"-cls-"+wte();r.cssNodes["."+y]={animation:o.join(",")},t.class=y}}function EFe(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};W6(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=ew(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),W6(n,t,r)}}function W6(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+wte(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var Cy=Math.round;function Tte(e){return e&&ve(e.src)}function Ate(e){return e&&Ae(e.toDataURL)}function wj(e,t,r,n){wFe(function(i,a){var o=i==="fill"||i==="stroke";o&&FK(a)?Mte(t,e,i,n):o&&aN(a)?Pte(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),$Fe(r,e,n)}function Sj(e,t){var r=qK(t);r&&(r.each(function(n,i){n!=null&&(e[($6+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[$6+"silent"]="true"))}function H6(e){return kl(e[0]-1)&&kl(e[1])&&kl(e[2])&&kl(e[3]-1)}function DFe(e){return kl(e[4])&&kl(e[5])}function Tj(e,t,r){if(t&&!(DFe(t)&&H6(t))){var n=1e4;e.transform=H6(t)?"translate("+Cy(t[4]*n)/n+" "+Cy(t[5]*n)/n+")":pje(t)}}function U6(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.";_n(h,m),_n(d,m)}else if(h==null||d==null){var y=function(I,O){if(I){var D=I.elm,N=h||O.width,B=d||O.height;I.tag==="pattern"&&(u?(B=1,N/=a.width):c&&(N=1,B/=a.height)),I.attrs.width=N,I.attrs.height=B,D&&(D.setAttribute("width",N),D.setAttribute("height",B))}},_=vN(v,null,e,function(I){l||y(A,I),y(f,I)});_&&_.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=Ce(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=GK(i);T&&(o.patternTransform=T);var A=Gr("pattern","",o,[f]),M=bj(A),P=n.patternCache,k=P[M];k||(k=n.zrId+"-p"+n.patternIdx++,P[M]=k,o.id=k,A=n.defs[k]=Gr("pattern",k,o,[f])),t[r]=pT(k)}}function FFe(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,[Cte(e,r)])}t["clip-path"]=pT(a)}function X6(e){return document.createTextNode(e)}function hc(e,t,r){e.insertBefore(t,r)}function q6(e,t){e.removeChild(t)}function K6(e,t){e.appendChild(t)}function Lte(e){return e.parentNode}function kte(e){return e.nextSibling}function W2(e,t){e.textContent=t}var Q6=58,VFe=120,GFe=Gr("","");function VI(e){return e===void 0}function vo(e){return e!==void 0}function WFe(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 yg(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function My(e){var t,r=e.children,n=e.tag;if(vo(n)){var i=e.elm=bte(n);if(Aj(GFe,e),ie(r))for(t=0;ta?(v=r[l+1]==null?null:r[l+1].elm,Ite(e,v,r,i,l)):Iw(e,t,n,a))}function _h(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(Aj(e,t),VI(t.text)?vo(n)&&vo(i)?n!==i&&HFe(r,n,i):vo(i)?(vo(e.text)&&W2(r,""),Ite(r,null,i,0,i.length-1)):vo(n)?Iw(r,n,0,n.length-1):vo(e.text)&&W2(r,""):e.text!==t.text&&(vo(n)&&Iw(r,n,0,n.length-1),W2(r,t.text)))}function UFe(e,t){if(yg(e,t))_h(e,t);else{var r=e.elm,n=Lte(r);My(t),n!==null&&(hc(n,t.elm,kte(r)),Iw(n,[e],0,0))}return t}var ZFe=0,YFe=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=J6(),this.configLayer=J6(),this.storage=r,this._opts=n=re({},n),this.root=t,this._id="zr"+ZFe++,this._oldVNode=F6(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=bte("svg");Aj(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",UFe(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return Y6(t,FI(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=FI(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=XFe(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=MFe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=Gr("style","stl",{},[],c);o.push(f)}}return F6(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},bj(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}}B.prevElClipPaths&&y.restore()};if(_)if(_.length===0)P=m.__endIndex;else for(var I=d.dpr,O=0;O<_.length;++O){var D=_[O];y.save(),y.beginPath(),y.rect(D.x*I,D.y*I,D.width*I,D.height*I),y.clip(),k(D),y.restore()}else y.save(),k(),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?l_: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&Si&&!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,R(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=K.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}(St);function tv(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=Kd(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 g0=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=nVe,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(){$s(this.childAt(0))},t.prototype.downplay=function(){Fs(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),pa(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,Nt(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=Af(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),y&&s.attr("cursor",y);var A=r.getItemVisual(n,"style"),M=A.fill;if(s instanceof Xr){var P=s.style;s.useStyle(re({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},A))}else s.__isEmptyBrush?s.useStyle(re({},A)):s.useStyle(A),s.style.decal=null,s.setColor(M,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var k=r.getItemVisual(n,"liftZ"),I=this._z2;k!=null?I==null&&(this._z2=s.z2,s.z2+=k):I!=null&&(s.z2=I,this._z2=null);var O=o&&o.useNameLabel;Ur(s,g,{labelFetcher:l,labelDataIndex:n,defaultText:D,inheritColor:M,defaultOpacity:A.opacity});function D($){return O?r.getName($):tv(r,$)}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 B=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;N.scaleX=this._sizeX*B,N.scaleY=this._sizeY*B,this.setSymbolScale(1),Wt(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&&nu(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();nu(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return Gv(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Me);function nVe(e,t){this.parent.drift(e,t)}function U2(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 rG(e){return e!=null&&!Le(e)&&(e={isIgnore:e}),e||{}}function nG(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 m0=function(){function e(t){this.group=new Me,this._SymbolCtor=t||g0}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=rG(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=nG(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(U2(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(!U2(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=nG(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=rG(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 Dte(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 aVe(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 oVe(e,t,r,n,i,a,o,s){for(var l=aVe(e,t),u=[],c=[],f=[],h=[],d=[],v=[],g=[],m=Ete(i,t,o),y=e.getLayout("points")||[],_=t.getLayout("points")||[],b=0;b=i||g<0)break;if($c(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,A=t[T*2],M=t[T*2+1];A===y&&M===_&&m=n||$c(A,M))d=y,v=_;else{I=A-u,O=M-c;var B=y-u,$=A-y,F=_-c,G=M-_,z=void 0,U=void 0;if(s==="x"){z=Math.abs(B),U=Math.abs($);var H=I>0?1:-1;d=y-H*z*o,v=_,D=y+H*U*o,N=_}else if(s==="y"){z=Math.abs(F),U=Math.abs(G);var Y=O>0?1:-1;d=y,v=_-Y*z*o,D=y,N=_+Y*U*o}else z=Math.sqrt(B*B+F*F),U=Math.sqrt($*$+G*G),k=U/(U+z),d=y-I*o*(1-k),v=_-O*o*(1-k),D=y+I*o*k,N=_+O*o*k,D=sl(D,ll(A,y)),N=sl(N,ll(M,_)),D=ll(D,sl(A,y)),N=ll(N,sl(M,_)),I=D-y,O=N-_,d=y-I*z/U,v=_-O*z/U,d=sl(d,ll(u,y)),v=sl(v,ll(c,_)),d=ll(d,sl(u,y)),v=ll(v,sl(c,_)),I=y-d,O=_-v,D=y+I*U/z,N=_+O*U/z}e.bezierCurveTo(f,h,d,v,y,_),f=D,h=N}else e.lineTo(y,_)}u=y,c=_,g+=a}return m}var Nte=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),sVe=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:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new Nte},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&$c(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?Q1(s,d,g,y,r,c):Q1(l,v,m,_,r,c);if(T>0)for(var A=0;A=0){var S=u?$r(l,v,m,_,M):$r(s,d,g,y,M);return u?[r,S]:[S,r]}}s=y,l=_;break}}},t}(rt),lVe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Nte),jte=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 lVe},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&&$c(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 fVe(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=cVe(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";R(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 bf(0,0,0,0,h,!0);return _[i]=g,_[i+"2"]=m,_}}}function hVe(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&dVe(a,t))){var o=t.mapDimension(a.dim),s={};return R(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function dVe(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 vVe(e,t){return isNaN(e)||isNaN(t)}function pVe(e){for(var t=e.length/2;t>0&&vVe(e[t*2-2],e[t*2-1]);t--);return t-1}function lG(e,t){return[e[t*2],e[t*2+1]]}function gVe(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 zte(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,Wt(v,F,G,z);var H=sG(r.get("smooth")),Y=r.get("smoothMonotone");if(v.setShape({smooth:H,smoothMonotone:Y,connectNulls:M}),g){var Z=s.getCalculationInfo("stackedOnSeries"),J=0;g.useStyle(Pe(u.getAreaStyle(),{fill:D,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Z&&(J=sG(Z.get("smooth"))),g.setShape({smooth:H,stackedOnSmooth:J,smoothMonotone:Y,connectNulls:M}),Dr(g,r,"areaStyle"),De(g).seriesIndex=r.seriesIndex,Wt(g,F,G,z)}var ae=this._changePolyState;s.eachItemGraphicEl(function(ce){ce&&(ce.onHoverStateChange=ae)}),this._polyline.onHoverStateChange=ae,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=I,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=tf(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 g0(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 _t.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=tf(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 _t.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;uw(this._polyline,r),n&&uw(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new sVe({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 jte({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");Ae(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=Ae(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 A=i;a?(y=A.x,_=A.x+A.width,b=d.x):(y=A.y+A.height,_=A.y,b=d.y)}var M=_===y?0:(b-y)/(_-y);l&&(M=1-M);var P=Ae(f)?f(v):c*M+h,k=g.getSymbolPath(),I=k.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),I&&I.animateFrom({style:{opacity:0}},{duration:300,delay:P}),k.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(zte(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=pVe(l);c>=0&&(Ur(s,Nr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(f,h,d){return d!=null?Ote(o,d):tv(o,f)},enableTextSetter:!0},mVe(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),A=(y?0:-g)*(_?-1:1),M=y?"x":"y",P=gVe(f,S,M),k=P.range,I=k[1]-k[0],O=void 0;if(I>=1){if(I>1&&!d){var D=lG(f,k[0]);u.attr({x:D[0]+T,y:D[1]+A}),o&&(O=h.getRawValue(k[0]))}else{var D=c.getPointOn(S,M);D&&u.attr({x:D[0]+T,y:D[1]+A});var N=h.getRawValue(k[0]),B=h.getRawValue(k[1]);o&&(O=cQ(i,v,N,B,P.t))}a.lastFrameIndex=k[0]}else{var $=r===1||a.lastFrameIndex>0?k[0]:0,D=lG(f,$);o&&(O=h.getRawValue($)),u.attr({x:D[0]+T,y:D[1]+A})}if(o){var F=Rv(u);typeof F.setLabelText=="function"&&F.setLabelText(O)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,f=r.hostModel,h=oVe(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=ul(h.stackedOnCurrent,h.current,i,o,l),d=ul(h.current,null,i,o,l),m=ul(h.stackedOnNext,h.next,i,o,l),g=ul(h.next,null,i,o,l)),oG(d,g)>3e3||c&&oG(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;ve(a)?v=xVe[a]:Ae(a)&&(v=a),v&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,v,_Ve))}}}}}function bVe(e){e.registerChartView(yVe),e.registerSeriesModel(rVe),e.registerLayout(x0("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,$te("line"))}var Py=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 Yo(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)R(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=(A+_)/2;break}T===1&&(S=M-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}(St);St.registerClass(Py);var wVe=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 Yo(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=xu(Py.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:K.color.primary,borderWidth:2}},realtimeSort:!1}),t}(Py),SVe=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}(),Ow=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 SVe},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){Cs(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}(_t),uG={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=Y2(t.x,e.x),s=X2(t.x+t.width,i),l=Y2(t.y,e.y),u=X2(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=X2(t.r,e.r),a=Y2(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}},cG={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Xe({shape:re({},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?Ow:bn,c=new u({shape:n,z2:1});c.name="item";var f=Fte(i);if(c.calculateTextPosition=TVe(f,{isRoundCap:u===Ow}),a){var h=c.shape,d=i?"r":"endAngle",v={};h[d]=i?n.r0:n.startAngle,v[d]=n[d],(s?lt:Nt)(c,{shape:v},a)}return c}};function PVe(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 fG(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:Nt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?lt:Nt)(r,{shape:u},c,i)}function hG(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 IVe(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function Fte(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 vG(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=Ao(n.getModel("itemStyle"),c,!0);re(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:tv(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,AVe(e,m==="outside"?d:m,Fte(o),n.get(["label","rotate"]))}KQ(g,v,a.getRawValue(r),function(_){return Ote(t,_)});var y=n.getModel(["emphasis"]);Wt(e,y.get("focus"),y.get("blurScope"),y.get("disabled")),Dr(e,n),IVe(i)&&(e.style.fill="none",e.style.stroke="none",R(e.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function OVe(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 EVe=function(){function e(){}return e}(),pG=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 EVe},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 DVe(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 Vte(e,t,r){if(iu(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 NVe(e,t,r){var n=e.type==="polar"?bn:Xe;return new n({shape:Vte(t,r,e),silent:!0,z2:0})}function jVe(e){e.registerChartView(MVe),e.registerSeriesModel(wVe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Be(Hee,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Uee("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,$te("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 yG=Math.PI*2,h_=Math.PI/180;function RVe(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=pJ(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=o.viewRect,h=-n.get("startAngle")*h_,d=n.get("endAngle"),v=n.get("padAngle")*h_;d=d==="auto"?h-yG:-d*h_;var g=n.get("minAngle")*h_,m=g+v,y=0;i.each(a,function(G){!isNaN(G)&&y++});var _=i.getSum(a),b=Math.PI/(_||y)*2,S=n.get("clockwise"),T=n.get("roseType"),A=n.get("stillShowZeroSum"),M=i.getDataExtent(a);M[0]=0;var P=S?1:-1,k=[h,d],I=P*v/2;ST(k,!S),h=k[0],d=k[1];var O=Gte(n);O.startAngle=h,O.endAngle=d,O.clockwise=S,O.cx=s,O.cy=l,O.r=u,O.r0=c;var D=Math.abs(d-h),N=D,B=0,$=h;if(i.setLayout({viewRect:f,r:u}),i.each(a,function(G,z){var U;if(isNaN(G)){i.setItemLayout(z,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?U=_===0&&A?b:G*b:U=D/y,UU?(Y=$+P*U/2,Z=Y):(Y=$+I,Z=H-I),i.setItemLayout(z,{angle:U,startAngle:Y,endAngle:Z,clockwise:S,cx:s,cy:l,r0:c,r:T?gt(G,M,[c,u]):u}),$=H}),Nr?y:m,T=Math.abs(b.label.y-r);if(T>=S.maxY){var A=b.label.x-t-b.len2*i,M=n+b.len,P=Math.abs(A)e.unconstrainedWidth?null:h:null;n.setStyle("width",d)}Hte(a,n)}}}function Hte(e,t){_G.rect=e,pte(_G,t,$Ve)}var $Ve={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},_G={};function q2(e){return e.position==="center"}function FVe(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*BVe,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function d(A){A.ignore=!0}function v(A){if(!A.ignore)return!0;for(var M in A.states)if(A.states[M].ignore===!1)return!0;return!1}t.each(function(A){var M=t.getItemGraphicEl(A),P=M.shape,k=M.getTextContent(),I=M.getTextGuideLine(),O=t.getItemModel(A),D=O.getModel("label"),N=D.get("position")||O.get(["emphasis","label","position"]),B=D.get("distanceToLabelLine"),$=D.get("alignTo"),F=de(D.get("edgeDistance"),u),G=D.get("bleedMargin");G==null&&(G=Math.min(u,h)>200?10:2);var z=O.getModel("labelLine"),U=z.get("length");U=de(U,u);var H=z.get("length2");if(H=de(H,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Z>0?"left":"right"}var Fe=Math.PI,Ye=0,vt=D.get("rotate");if(ot(vt))Ye=vt*(Fe/180);else if(N==="center")Ye=0;else if(vt==="radial"||vt===!0){var Vt=Z<0?-Y+Fe:-Y;Ye=Vt}else if(vt==="tangential"&&N!=="outside"&&N!=="outer"){var nr=Math.atan2(Z,J);nr<0&&(nr=Fe*2+nr);var jn=J>0;jn&&(nr=Fe+nr),Ye=nr-Fe}if(a=!!Ye,k.x=ae,k.y=ce,k.rotation=Ye,k.setStyle({verticalAlign:"middle"}),xe){k.setStyle({align:We});var Jn=k.states.select;Jn&&(Jn.x+=k.x,Jn.y+=k.y)}else{var qr=new Oe(0,0,0,0);Hte(qr,k),r.push({label:k,labelLine:I,position:N,len:U,len2:H,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new Ie(Z,J),linePoints:ge,textAlign:We,labelDistance:B,labelAlignTo:$,edgeDistance:F,bleedMargin:G,rect:qr,unconstrainedWidth:qr.width,labelStyleWidth:k.style.width})}M.setTextConfig({inside:xe})}}),!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}(_t);function Yv(e,t,r){t=ie(t)&&{coordDimensions:t}||re({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=Wv(n,t).dimensions,a=new Dn(i,e);return a.initData(n,r),a}var Xv=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}(),WVe=Je(),Ute=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 Xv(pe(this.getData,this),pe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Yv(this,{coordDimensions:["value"],encodeDefaulter:Be(UN,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=WVe(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=eQ(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){ef(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}(St);RBe({fullType:Ute.type,getCoord2:function(e){return e.getShallow("center")}});function HVe(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 UVe(e){e.registerChartView(GVe),e.registerSeriesModel(Ute),oee("pie",e.registerAction),e.registerLayout(Be(RVe,"pie")),e.registerProcessor(Zv("pie")),e.registerProcessor(HVe("pie"))}var ZVe=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 Yo(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:K.color.primary}},universalTransition:{divideShape:"clone"}},t}(St),Zte=4,YVe=function(){function e(){}return e}(),XVe=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 YVe},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}(),KVe=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=x0("").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 qVe:new m0,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}(_t),Yte={left:0,right:0,top:0,bottom:0},Ew=["25%","25%"],QVe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Sf(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Fo(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Fo(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:Yte,outerBoundsContain:"all",outerBoundsClampWidth:Ew[0],outerBoundsClampHeight:Ew[1],backgroundColor:K.color.transparent,borderWidth:1,borderColor:K.color.neutral30},t}(Qe),WI=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",tr).models[0]},t.type="cartesian2dAxis",t}(Qe);fr(WI,Uv);var Xte={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:K.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:K.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:K.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[K.color.backgroundTint,K.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:K.color.neutral00,borderColor:K.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},JVe=He({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},Xte),Cj=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:K.color.axisMinorSplitLine,width:1}}},Xte),e6e=He({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Cj),t6e=Pe({logBase:10},Cj);const qte={category:JVe,value:Cj,time:e6e,log:t6e};var r6e={value:1,category:1,time:1,log:1},HI=null;function n6e(e){HI||(HI=e)}function _0(){return HI}function rv(e,t,r,n){R(r6e,function(i,a){var o=He(He({},qte[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=yy(this),d=h?Sf(c):{},v=f.getTheme();He(c,v.get(a+"Axis")),He(c,this.getDefaultOption()),c.type=bG(c),h&&Fo(c,d,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=Ty.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=_0();return f?f.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",bG)}function bG(e){return e.type||(e.data?"category":"value")}var i6e=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}(),UI=["x","y"];function wG(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var a6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=UI,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!wG(r)||!wG(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=da([],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 ur(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 ur(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}(i6e),Kte=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}(_a),zT="expandAxisBreak",Qte="collapseAxisBreak",Jte="toggleAxisBreak",Mj="axisbreakchanged",o6e={type:zT,event:Mj,update:"update",refineEvent:Pj},s6e={type:Qte,event:Mj,update:"update",refineEvent:Pj},l6e={type:Jte,event:Mj,update:"update",refineEvent:Pj};function Pj(e,t,r,n){var i=[];return R(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function u6e(e){e.registerAction(o6e,t),e.registerAction(s6e,t),e.registerAction(l6e,t);function t(r,n){var i=[],a=od(n,r);function o(s,l){R(a[s],function(u){var c=u.updateAxisBreaks(r);R(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 Il=Math.PI,c6e=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],f6e=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],nv=Je(),ere=Je(),tre=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 h6e(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=Lj(e.axisName)&&ev(e.nameLocation);R(n,function(v){var g=Vo(v);if(!(!g||g.label.ignore)){o.push(g);var m=a.transGroup;l&&(m.transform?da(Gp,m.transform):i0(Gp),g.transform&&Fa(Gp,Gp,g.transform),Oe.copy(d_,g.localRect),d_.applyTransform(Gp),s?s.union(d_):Oe.copy(s=new Oe(0,0,0,0),d_))}});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 Gp=Wr(),d_=new Oe(0,0,0,0),rre=function(e,t,r,n,i,a){if(ev(e.nameLocation)){var o=a.stOccupiedRect;o&&nre(cFe({},o,a.transGroup.transform),n,i)}else ire(a.labelInfoList,a.dirVec,n,i)};function nre(e,t,r){var n=new Ie;RT(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&RI(t,n)}function ire(e,t,r,n){for(var i=Ie.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):Zd(i-Il)?(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}(),d6e=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],v6e={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&&(ur(c,c,u),ur(f,f,u));var d=re({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())_0().buildAxisBreakLine(n,i,a,v);else{var g=new yr(re({shape:{x1:c[0],y1:c[1],x2:f[0],y2:f[1]}},v));qd(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"]);ve(m)&&(m=[m,m]),(ve(y)||ot(y))&&(y=[y,y]);var _=Af(n.get(["axisLine","symbolOffset"])||0,y),b=y[0],S=y[1];R([{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,A){if(m[A]!=="none"&&m[A]!=null){var M=xr(m[A],-b/2,-S/2,b,S,d.stroke,!0),P=T.r+T.offset,k=h?f:c;M.attr({rotation:T.rotate,x:k[0]+P*Math.cos(e.rotation),y:k[1]-P*Math.sin(e.rotation),silent:!0,z2:11}),i.add(M)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=TG(t,i,s);l&&SG(e,t,r,n,i,a,o,Ya.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=TG(t,i,s);l&&SG(e,t,r,n,i,a,o,Ya.determine);var u=y6e(e,i,a,n);m6e(e,t.labelLayoutList,u),x6e(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(Lj(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(qs(_,_,e.rotation));var b=n.get("nameRotate");b!=null&&(b=b*Il/180);var S,T;ev(c)?S=Hn.innerTextLayout(e.rotation,b??e.rotation,f):(S=p6e(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 A=h.getFont(),M=n.get("nameTruncate",!0)||{},P=M.ellipsis,k=nn(e.raw.nameTruncateMaxWidth,M.maxWidth,T),I=s.nameMarginLevel||0,O=new at({x:m.x,y:m.y,rotation:S.rotation,silent:Hn.isLabelSilent(n),style:Mt(h,{text:u,font:A,overflow:"truncate",width:k,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:O,componentModel:n,itemName:u}),O.__fullText=u,O.anid="name",n.get("triggerEvent")){var D=Hn.makeAxisEventDataBase(n);D.targetType="axisName",D.name=u,De(O).eventData=D}a.add(O),O.updateTransform(),t.nameEl=O;var N=l.nameLayout=Vo({label:O,priority:O.z2,defaultAttr:{ignore:O.ignore},marginDefault:ev(c)?c6e[I]:f6e[I]});if(l.nameLocation=c,i.add(O),O.decomposeTransform(),e.shouldNameMoveOverlap&&N){var B=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,N,y,B)}}}};function SG(e,t,r,n,i,a,o,s){ore(t)||_6e(e,t,i,s,n,o);var l=t.labelLayoutList;b6e(e,n,l,a),T6e(n,e.rotation,l);var u=e.optionHideOverlap;g6e(n,l,u),u&>e(ht(l,function(c){return c&&!c.label.ignore})),h6e(e,r,n,l)}function p6e(e,t,r,n){var i=lN(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return Zd(i-Il/2)?(o=l?"bottom":"top",a="center"):Zd(i-Il*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iIl/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function g6e(e,t,r){if(Jee(e.axis))return;function n(s,l,u){var c=Vo(t[l]),f=Vo(t[u]);if(!(!c||!f)){if(s===!1||c.suggestIgnore){xg(c.label);return}if(f.suggestIgnore){xg(f.label);return}var h=.1;if(!r){var d=[0,0,0,0];c=BI({marginForce:d},c),f=BI({marginForce:d},f)}RT(c,f,null,{touchThreshold:h})&&xg(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 m6e(e,t,r){e.showMinorTicks||R(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(v)&&isFinite(u[0]);)d=N2(d),v=u[1]-d*o;else{var m=e.getTicks().length-1;m>o&&(d=N2(d));var y=d*o;g=Math.ceil(u[1]/d)*d,v=mr(g-y),v<0&&u[0]>=0?(v=0,g=mr(y)):g>0&&u[1]<=0&&(g=0,v=-mr(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 CG=[[3,1],[0,2]],P6e=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=UI,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;II(g)&&v.get("alignTicks")&&v.get("interval")==null?c.push(d):(lf(g,v),II(g)&&(s=d))}c.length&&(s||(s=c.pop(),lf(s.scale,s.model)),R(c,function(m){sre(m.scale,m.model,s.scale)}))}}i(n.x),i(n.y);var a={};R(n.x,function(o){MG(n,"y",o,a)}),R(n.y,function(o){MG(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=jr(t,r),a=this._rect=$t(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(YI(o,a),!n){var u=I6e(a,s,o,l,r),c=void 0;if(l)XI?(XI(this._axesList,a),YI(o,a)):c=kG(a.clone(),"axisLabel",null,a,o,u,i);else{var f=O6e(t,a,i),h=f.outerBoundsRect,d=f.parsedOuterBoundsContain,v=f.outerBoundsClamp;h&&(c=kG(h,d,v,a,o,u,i))}lre(a,o,Ya.determine,null,c,i)}R(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]}Le(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return af(n,s,!0,!0,r),YI(i,n),l;function u(h){R(i[Re[h]],function(d){if(Ay(d.model)){var v=a.ensureRecord(d.model),g=v.labelInfoList;if(g)for(var m=0;m0&&!mn(d)&&d>1e-4&&(h/=d),h}}function I6e(e,t,r,n,i){var a=new tre(E6e);return R(r,function(o){return R(o,function(s){if(Ay(s.model)){var l=!n;s.axisBuilder=C6e(e,t,s.model,i,a,l)}})}),a}function lre(e,t,r,n,i,a){var o=r===Ya.determine;R(t,function(u){return R(u,function(c){Ay(c.model)&&(M6e(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[Re[1-u]]=e[Tr[u]]<=a.refContainer[Tr[u]]*.5?0:1-u===1?2:1}R(t,function(u,c){return R(u,function(f){Ay(f.model)&&((n==="all"||o)&&f.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&f.axisBuilder.build({axisLine:!0}))})})}function O6e(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=$t(e.get("outerBounds",!0)||Yte,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||Ge(["all","axisLabel"],a)<0?o="all":o=a;var s=[aw(be(e.get("outerBoundsClampWidth",!0),Ew[0]),t.width),aw(be(e.get("outerBoundsClampHeight",!0),Ew[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var E6e=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";rre(e,t,r,n,i,a),ev(e.nameLocation)||R(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&ire(s.labelInfoList,s.dirVec,n,i)})};function D6e(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return N6e(r,e,t),r.seriesInvolved&&R6e(r,e),r}function N6e(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];R(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Ly(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,f=c.getModel("tooltip",n);if(R(s.getAxes(),Be(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)&&R(v.baseAxes,Be(g,d?"cross":!0,h)),d&&R(v.otherAxes,Be(g,"cross",!1))}function g(m,y,_){var b=_.model.getModel("axisPointer",i),S=b.get("show");if(!(!S||S==="auto"&&!m&&!qI(b))){y==null&&(y=b.get("triggerTooltip")),b=m?j6e(_,f,i,t,m,y):b;var T=b.get("snap"),A=b.get("triggerEmphasis"),M=Ly(_.model),P=y||T||_.type==="category",k=e.axesInfo[M]={key:M,axis:_,coordSys:s,axisPointerModel:b,triggerTooltip:y,triggerEmphasis:A,involveSeries:P,snap:T,useHandle:qI(b),seriesModels:[],linkGroup:null};u[M]=k,e.seriesInvolved=e.seriesInvolved||P;var I=B6e(a,_);if(I!=null){var O=o[I]||(o[I]={axesInfo:{}});O.axesInfo[M]=k,O.mapper=a[I].mapper,k.linkGroup=O}}}})}function j6e(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};R(s,function(h){l[h]=Ce(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 tt(l,r,n))}function R6e(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||R(e.coordSysAxesInfo[Ly(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 B6e(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function z6e(e){var t=kj(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=qI(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 U6e=Je();function EG(e,t,r,n){if(e instanceof Kte){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?vre(r,o,u,n):Z6e(e,t,r,n,o,l):r}function vre(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 Z6e(e,t,r,n,i,a){var o=U6e(e);o.items||(o.items=[]);var s=o.items,l=DG(s,t,r,n,i,a,1),u=DG(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||f&&h>f/2-n?vre(r,i,f,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function DG(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(Ce(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(ve(c)){var y=m.name;m.name=c.replace("{value}",y??"")}else Ae(c)&&(m.name=c(m.name,m));var _=new tt(m,null,this.ecModel);return fr(_,Uv.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:K.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:He({lineStyle:{color:K.color.neutral20}},Wp.axisLine),axisLabel:v_(Wp.axisLabel,!1),axisTick:v_(Wp.axisTick,!1),splitLine:v_(Wp.splitLine,!0),splitArea:v_(Wp.splitArea,!0),indicator:[]},t}(Qe),rGe=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 Hn(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});R(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=ie(h)?h:[h],g=ie(d)?d:[d],m=[],y=[];function _($,F,G){var z=G%F.length;return $[z]=$[z]||[],z}if(a==="circle")for(var b=i[0].getTicksCoords(),S=n.cx,T=n.cy,A=0;A3?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(!(RG(this._zr,"globalPan")||Hp(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)&&(zs(a.event),a.__ecRoamConsumed=!0,BG(r,n,i,a,o))},t}(ya);function Hp(e){return e.__ecRoamConsumed}var cGe=Je();function $T(e){var t=cGe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Up(e,t,r,n){for(var i=$T(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=_re(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=J2[s];if(c&&ye(J2,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=VG[s];if(d&&ye(VG,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 Yd({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Wi(r,n),vi(t,n,this._defsUsePending,!1,!1),vGe(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(){J2={g:function(t,r){var n=new Me;return Wi(r,n),vi(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Xe;return Wi(r,n),vi(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 Zo;return Wi(r,n),vi(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 yr;return Wi(r,n),vi(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 l0;return Wi(r,n),vi(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=HG(n));var a=new wn({shape:{points:i||[]},silent:!0});return Wi(r,a),vi(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=HG(n));var a=new on({shape:{points:i||[]},silent:!0});return Wi(r,a),vi(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new Xr;return Wi(r,n),vi(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),vi(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),vi(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=jQ(n);return Wi(r,i),vi(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),VG={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 bf(t,r,n,i);return GG(e,a),WG(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 SN(t,r,n);return GG(e,i),WG(e,i),i}};function GG(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function WG(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={};xre(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=En(o),u=l&&l[3];u&&(l[3]*=Ts(s),o=sa(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 HG(e){for(var t=VT(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=VT(o);switch(i=i||Wr(),s){case"translate":Ua(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":vT(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":qs(i,i,-parseFloat(l[0])*eM,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*eM);Fa(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*eM);Fa(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 ZG=/([^\s:;]+)\s*:\s*([^:;]+)/g;function xre(e,t,r){var n=e.getAttribute("style");if(n){ZG.lastIndex=0;for(var i;(i=ZG.exec(n))!=null;){var a=i[1],o=ye(Nw,a)?Nw[a]:null;o&&(t[o]=i[2]);var s=ye(jw,a)?jw[a]:null;s&&(r[s]=i[2])}}}function _Ge(e,t,r){for(var n=0;n<$G.length;n++){var i=$G[n],a=e.getAttribute(i);a!=null&&(t[Nw[i]]=a)}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&&(bre(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 QG(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 JG(e,t,r,n,i){e.data||Qs({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function eW(e,t,r,n,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Wt(t,o,a.get("blurScope"),a.get("disabled")),e.isGeo&&L5e(t,i,r),o}function tW(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(),R(e,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=K.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:K.color.tertiary},itemStyle:{borderWidth:.5,borderColor:K.color.border,areaColor:K.color.background},emphasis:{label:{show:!0,color:K.color.primary},itemStyle:{areaColor:K.color.highlight}},select:{label:{show:!0,color:K.color.primary},itemStyle:{color:K.color.highlight}},nameProperty:"name"},t}(St);function $Ge(e,t){var r={};return R(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=$t(S,v),b=gJ(e,b,g)}this.setViewRect(b.x,b.y,b.width,b.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function WGe(e,t){R(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var HGe=function(){function e(){this.dimensions=Sre}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 JI(l+s,l,re({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=aW,u.resize(o,r)}),t.eachSeries(function(o){d0({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",tr).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)}}),R(a,function(o,s){var l=se(o,function(c){return c.get("nameMap")}),u=new JI(s,s,re({nameMap:fT(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=nn.apply(null,se(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=aW,u.resize(o[0],r),R(o,function(c){c.coordinateSystem=u,WGe(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 KGe(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){JGe(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=eWe(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function QGe(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function oW(e){return arguments.length?e:nWe}function _g(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function JGe(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 eWe(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=tM(s),a=rM(a),s&&a;){i=tM(i),o=rM(o),i.hierNode.ancestor=e;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+n(s,a);h>0&&(rWe(tWe(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&&!tM(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!rM(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function tM(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function rM(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function tWe(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function rWe(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 nWe(e,t){return e.parentNode===t.parentNode?1:2}var iWe=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),aWe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new iWe},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=de(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 M=T?"left":"right",P=s.getModel("label"),k=P.get("rotate"),I=k*(Math.PI/180),O=m.getTextContent();O&&(m.setTextConfig({position:P.get("position")||M,rotation:k==null?-S:I,origin:"center"}),O.setStyle("verticalAlign","middle"))}var D=s.get(["emphasis","focus"]),N=D==="relative"?Wd(o.getAncestorsIndices(),o.getDescendantIndices()):D==="ancestor"?o.getAncestorsIndices():D==="descendant"?o.getDescendantIndices():null;N&&(De(r).focus=N),sWe(i,o,c,r,v,d,g,n),r.__edge&&(r.onHoverStateChange=function(B){if(B!=="blur"){var $=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);$&&$.hoverState===s0||uw(r.__edge,B)}})}function sWe(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 Dv({shape:eO(c,f,h,i,i)})),lt(g,{shape:eO(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(ve(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 Lre(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function Bj(e,t){var r=Lre(e);return Ge(r,t)>=0}function GT(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 gWe=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 tt(i,this,this.ecModel),o=Rj.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 Ar("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=GT(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:K.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(St);function mWe(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 yWe(e,t){e.eachSeriesByType("tree",function(r){xWe(r,t)})}function xWe(e,t){var r=jr(e,t).refContainer,n=$t(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=oW(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=oW());var l=e.getData().tree.root,u=l.children[0];if(u){qGe(l),mWe(u,KGe,s),l.hierNode.modifier=-u.hierNode.prelim,Xp(u,QGe);var c=u,f=u,h=u;Xp(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),Xp(u,function(S){y=(S.getLayout().x+v)*g,_=(S.depth-1)*m;var T=_g(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),Xp(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),Xp(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 _We(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");re(s,o)})})}function bWe(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=FT(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function wWe(e){e.registerChartView(oWe),e.registerSeriesModel(gWe),e.registerLayout(yWe),e.registerVisual(_We),bWe(e)}var fW=["treemapZoomToNode","treemapRender","treemapMove"];function SWe(e){for(var t=0;t1;)a=a.parentNode;var o=mI(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var TWe=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};Ire(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new tt({itemStyle:o},this,n);a=r.levels=AWe(a,n);var l=se(a||[],function(f){return new tt(f,s,n)},this),u=Rj.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 Ar("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=GT(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},re(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(){kre(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,coordinateSystemUsage:"box",left:K.size.l,top:K.size.xxxl,right:K.size.l,bottom:K.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:K.size.m,emptyItemWidth:25,itemStyle:{color:K.color.backgroundShade,textStyle:{color:K.color.secondary}},emphasis:{itemStyle:{color:K.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:K.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:K.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}(St);function Ire(e){var t=0;R(e.children,function(n){Ire(n);var i=n.value;ie(i)&&(i=i[0]),t+=i});var r=e.value;ie(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ie(e.value)?e.value[0]=r:e.value=r}function AWe(e,t){var r=Pt(t.get("color")),n=Pt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;R(e,function(s){var l=new tt(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 CWe=8,hW=8,nM=5,MWe=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=$t(h,f);this._prepare(n,d,u),this._renderContent(t,d,v,s,l,u,c,i),kT(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+CWe*2,r.emptyItemWidth);r.totalWidth+=s+hW,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 wn({shape:{points:PWe(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:Ov*1e4,onclick:Be(l,y)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Mt(s,{text:b}),S.ensureState("emphasis").style=v,Wt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),LWe(S,t,y),u+=_+hW}},e.prototype.remove=function(){this.group.removeAll()},e}();function PWe(e,t,r,n,i,a){var o=[[i?e:e-nM,t],[e+r,t],[e+r,t+n],[i?e:e-nM,t+n]];return!a&&o.splice(2,0,[e+r+nM,t+n/2]),!i&&o.push([e,t+n/2]),o}function LWe(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&>(r,t)}}var kWe=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;ivW||Math.abs(r.dy)>vW)){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();Ua(m,m,[-n,-i]),vT(m,m,[v,v]),Ua(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&&dw(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 MWe(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(Bj(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=qp(),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}(_t);function qp(){return{nodeGroup:[],background:[],content:[]}}function jWe(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,A=h.getModel("itemStyle"),M=h.getModel(["emphasis","itemStyle"]),P=h.getModel(["blur","itemStyle"]),k=h.getModel(["select","itemStyle"]),I=A.get("borderRadius")||0,O=ce("nodeGroup",tO);if(!O)return;if(l.add(O),O.x=c.x||0,O.y=c.y||0,O.markRedraw(),Rw(O).nodeWidth=d,Rw(O).nodeHeight=v,c.isAboveViewRoot)return O;var D=ce("background",dW,u,EWe);D&&H(O,D,T&&c.upperLabelHeight);var N=h.getModel("emphasis"),B=N.get("focus"),$=N.get("blurScope"),F=N.get("disabled"),G=B==="ancestor"?o.getAncestorsIndices():B==="descendant"?o.getDescendantIndices():B;if(T)py(O)&&Ac(O,!1),D&&(Ac(D,!F),f.setItemGraphicEl(o.dataIndex,D),oI(D,G,$));else{var z=ce("content",dW,u,DWe);z&&Y(O,z),D.disableMorphing=!0,D&&py(D)&&Ac(D,!1),Ac(O,!F),f.setItemGraphicEl(o.dataIndex,O);var U=h.getShallow("cursor");U&&z.attr("cursor",U),oI(O,G,$)}return O;function H(xe,ne,fe){var le=De(ne);if(le.dataIndex=o.dataIndex,le.seriesIndex=e.seriesIndex,ne.setShape({x:0,y:0,width:d,height:v,r:I}),m)Z(ne);else{ne.invisible=!1;var ee=o.getVisual("style"),$e=ee.stroke,Se=mW(A);Se.fill=$e;var Fe=sc(M);Fe.fill=M.get("borderColor");var Ye=sc(P);Ye.fill=P.get("borderColor");var vt=sc(k);if(vt.fill=k.get("borderColor"),fe){var Vt=d-2*g;J(ne,$e,ee.opacity,{x:g,y:0,width:Vt,height:S})}else ne.removeTextContent();ne.setStyle(Se),ne.ensureState("emphasis").style=Fe,ne.ensureState("blur").style=Ye,ne.ensureState("select").style=vt,nf(ne)}xe.add(ne)}function Y(xe,ne){var fe=De(ne);fe.dataIndex=o.dataIndex,fe.seriesIndex=e.seriesIndex;var le=Math.max(d-2*g,0),ee=Math.max(v-2*g,0);if(ne.culling=!0,ne.setShape({x:g,y:g,width:le,height:ee,r:I}),m)Z(ne);else{ne.invisible=!1;var $e=o.getVisual("style"),Se=$e.fill,Fe=mW(A);Fe.fill=Se,Fe.decal=$e.decal;var Ye=sc(M),vt=sc(P),Vt=sc(k);J(ne,Se,$e.opacity,null),ne.setStyle(Fe),ne.ensureState("emphasis").style=Ye,ne.ensureState("blur").style=vt,ne.ensureState("select").style=Vt,nf(ne)}xe.add(ne)}function Z(xe){!xe.invisible&&a.push(xe)}function J(xe,ne,fe,le){var ee=h.getModel(le?gW:pW),$e=Ir(h.get("name"),null),Se=ee.getShallow("show");Ur(xe,Nr(h,le?gW:pW),{defaultText:Se?$e:null,inheritColor:ne,defaultOpacity:fe,labelFetcher:e,labelDataIndex:o.dataIndex});var Fe=xe.getTextContent();if(Fe){var Ye=Fe.style,vt=r0(Ye.padding||0);le&&(xe.setTextConfig({layoutRect:le}),Fe.disableLabelLayout=!0),Fe.beforeUpdate=function(){var nr=Math.max((le?le.width:xe.shape.width)-vt[1]-vt[3],0),jn=Math.max((le?le.height:xe.shape.height)-vt[0]-vt[2],0);(Ye.width!==nr||Ye.height!==jn)&&Fe.setStyle({width:nr,height:jn})},Ye.truncateMinChar=2,Ye.lineOverflow="truncate",ae(Ye,le,c);var Vt=Fe.getState("emphasis");ae(Vt?Vt.style:null,le,c)}}function ae(xe,ne,fe){var le=xe?xe.text:null;if(!ne&&fe.isLeafRoot&&le!=null){var ee=e.get("drillDownIcon",!0);xe.text=ee?ee+" "+le:le}}function ce(xe,ne,fe,le){var ee=_!=null&&r[xe][_],$e=i[xe];return ee?(r[xe][_]=null,ge($e,ee)):m||(ee=new ne,ee instanceof va&&(ee.z2=RWe(fe,le)),We($e,ee)),t[xe][y]=ee}function ge(xe,ne){var fe=xe[y]={};ne instanceof tO?(fe.oldX=ne.x,fe.oldY=ne.y):fe.oldShape=re({},ne.shape)}function We(xe,ne){var fe=xe[y]={},le=o.parentNode,ee=ne instanceof Me;if(le&&(!n||n.direction==="drillDown")){var $e=0,Se=0,Fe=i.background[le.getRawIndex()];!n&&Fe&&Fe.oldShape&&($e=Fe.oldShape.width,Se=Fe.oldShape.height),ee?(fe.oldX=0,fe.oldY=Se):fe.oldShape={x:$e,y:Se,width:0,height:0}}fe.fadein=!ee}}function RWe(e,t){return e*OWe+t}var Iy=R,BWe=Le,Bw=-1,Hr=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=Ce(t);this.type=n,this.mappingMethod=r,this._normalizeData=FWe[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(iM(i),zWe(i)):r==="category"?i.categories?$We(i):iM(i,!0):(_n(r!=="linear"||i.dataExtent),iM(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return pe(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){Le(t)?R(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=ie(t)?[]:Le(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&&Iy(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(ie(t))t=t.slice();else if(BWe(t)){var r=[];Iy(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 iM(e,t){var r=e.visual,n=[];Le(r)?Iy(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]),Ore(e,n)}function g_(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:rO([0,1])}}function yW(e){var t=this.option.visual;return t[Math.round(gt(e,[0,1],[0,t.length-1],!0))]||{}}function Kp(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function bg(e){var t=this.option.visual;return t[this.option.loop&&e!==Bw?e%t.length:e]}function lc(){return this.option.visual[0]}function rO(e){return{linear:function(t){return gt(t,e,this.option.visual,!0)},category:bg,piecewise:function(t,r){var n=nO.call(this,r);return n==null&&(n=gt(t,e,this.option.visual,!0)),n},fixed:lc}}function nO(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 Ore(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=se(t,function(r){var n=En(r);return n||[0,0,0,1]})),t}var FWe={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??Bw},fixed:lr};function m_(e,t,r){return e?t<=r:t=r.length||g===r[g.depth]){var y=ZWe(i,l,g,m,v,n);Dre(g,y,r,n)}})}}}function WWe(e,t,r){var n=re({},t),i=r.designatedVisualItemStyle;return R(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function xW(e){var t=aM(e,"color");if(t){var r=aM(e,"colorAlpha"),n=aM(e,"colorSaturation");return n&&(t=As(t,null,null,n)),r&&(t=cy(t,r)),t}}function HWe(e,t){return t!=null?As(t,null,null,e):null}function aM(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function UWe(e,t,r,n,i,a){if(!(!a||!a.length)){var o=oM(t,"color")||i.color!=null&&i.color!=="none"&&(oM(t,"colorAlpha")||oM(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 Ere(h).drColorMappingBy=c,h}}}function oM(e,t){var r=e.get(t);return ie(r)&&r.length?{name:t,range:r}:null}function ZWe(e,t,r,n,i,a){var o=re({},t);if(i){var s=i.type,l=s==="color"&&Ere(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 Oy=Math.max,zw=Math.min,_W=nn,zj=R,Nre=["itemStyle","borderWidth"],YWe=["itemStyle","gapWidth"],XWe=["upperLabel","show"],qWe=["upperLabel","height"];const KWe={seriesType:"treemap",reset:function(e,t,r,n){var i=e.option,a=jr(e,r).refContainer,o=$t(e.getBoxLayoutParams(),a),s=i.size||[],l=de(_W(o.width,s[0]),a.width),u=de(_W(o.height,s[1]),a.height),c=n&&n.type,f=["treemapZoomToNode","treemapRootToNode"],h=ky(n,f,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,v=e.getViewRoot(),g=Lre(v);if(c!=="treemapMove"){var m=c==="treemapZoomToNode"?nHe(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),jre(v,_,!1,0),b=v.getLayout(),zj(g,function(T,A){var M=(g[A+1]||v).getValue();T.setLayout(re({dataExtent:[M,M],borderWidth:0,upperHeight:0},b))})}var S=e.getData().tree.root;S.setLayout(iHe(o,d,h),!0),e.setLayoutInfo(o),Rre(S,new Oe(-o.x,-o.y,r.getWidth(),r.getHeight()),g,v,0)}};function jre(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(Nre),u=s.get(YWe)/2,c=Bre(s),f=Math.max(l,c),h=l-u,d=f-u;e.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),i=Oy(i-2*h,0),a=Oy(a-h-d,0);var v=i*a,g=QWe(e,s,v,t,r,n);if(g.length){var m={x:h,y:d,width:i,height:a},y=zw(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 rHe(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?Oy(u*n/l,l/(u*i)):1/0}function bW(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;fXk&&(u=Xk),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 M=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*M+c[0],a.y=c[1]+k,v=S[0]<0?"right":"left",a.originX=-y*M,a.originY=-k;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=A[0],a.y=A[1]+k,v="center",a.originY=-k;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*M+f[0],a.y=f[1]+k,v=S[0]>=0?"right":"left",a.originX=y*M,a.originY=-k;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||v})}},t}(Me),Wj=function(){function e(t){this.group=new Me,this._LineCtor=t||Gj}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=MW(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=MW(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!bHe(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function MW(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 PW(e){return isNaN(e[0])||isNaN(e[1])}function fM(e){return e&&!PW(e[0])&&!PW(e[1])}var hM=[],dM=[],vM=[],sh=rn,pM=Wl,LW=Math.abs;function kW(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){hM[0]=sh(n[0],i[0],a[0],c),hM[1]=sh(n[1],i[1],a[1],c);var f=LW(pM(hM,t)-l);f=0?s=s+u:s=s-u:v>=0?s=s-u:s=s+u}return s}function gM(e,t){var r=[],n=ly,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=[Io(u[0]),Io(u[1])],u[2]&&u.__original.push(Io(u[2])));var h=u.__original;if(u[2]!=null){if(Pn(i[0],h[0]),Pn(i[1],h[2]),Pn(i[2],h[1]),c&&c!=="none"){var d=Sg(s.node1),v=kW(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=Sg(s.node2),v=kW(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]}Pn(u[0],i[0]),Pn(u[1],i[2]),Pn(u[2],i[1])}else{if(Pn(a[0],h[0]),Pn(a[1],h[1]),Ml(o,a[1],a[0]),_f(o,o),c&&c!=="none"){var d=Sg(s.node1);Z1(a[0],a[0],o,d*t)}if(f&&f!=="none"){var d=Sg(s.node2);Z1(a[1],a[1],o,-d*t)}Pn(u[0],a[0]),Pn(u[1],a[1])}})}var Hre=Je();function wHe(e){if(e)return Hre(e).bridge}function IW(e,t){e&&(Hre(e).bridge=t)}function OW(e){return e.type==="view"}var SHe=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 m0,a=new Wj,o=this.group,s=new Me;this._controller=new Mf(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(OW(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)}gM(r.getGraph(),wg(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,A=S.getGraphicEl(),M=S.getModel();if(A){A.off("drag").off("dragend");var P=M.get("draggable");P&&A.on("drag",function(I){switch(m){case"force":v.warmUp(),!a._layouting&&a._startForceLayoutIteration(v,i,g),v.setFixed(T),h.setItemLayout(T,[A.x,A.y]);break;case"circular":h.setItemLayout(T,[A.x,A.y]),S.setLayout({fixed:!0},!0),Vj(r,"symbolSize",S,[I.offsetX,I.offsetY]),a.updateLayout(r);break;case"none":default:h.setItemLayout(T,[A.x,A.y]),Fj(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){v&&v.setUnfixed(T)}),A.setDraggable(P,!!M.get("cursor"));var k=M.get(["emphasis","focus"]);k==="adjacency"&&(De(A).focus=S.getAdjacentDataIndices())}}),h.graph.eachEdge(function(S){var T=S.getGraphicEl(),A=S.getModel().get(["emphasis","focus"]);T&&A==="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){Vre(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(!OW(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&&(Oj(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(Ej(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),gM(r.getGraph(),wg(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=wg(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(gM(r.getGraph(),wg(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=wHe(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 uc||(r=this._nodesMap[lh(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}(),Ure=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 Zre(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)}}}fr(uc,Zre("hostGraph","data"));fr(Ure,Zre("hostGraph","edgeData"));function Hj(e,t,r,n,i){for(var a=new THe(n),o=0;o "+h)),u++)}var d=r.get("coordinateSystem"),v;if(d==="cartesian2d"||d==="polar"||d==="matrix")v=Yo(e,r);else{var g=$v.get(d),m=g?g.dimensions||[]:[];Ge(m,"value")<0&&m.concat(["value"]);var y=Wv(e,{coordDimensions:m,encodeDefine:r.getEncode()}).dimensions;v=new Dn(y,r),v.initData(e)}var _=new Dn(["value"],r);return _.initData(l,s),i&&i(v,_),Mre({mainData:v,struct:a,structAttr:"graph",datas:{node:v,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var AHe=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 Xv(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),ef(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){fHe(this);var s=Hj(a,i,this,!0,l);return R(s.edges,function(u){hHe(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=tt.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),Ar("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=qJ({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:re({value:0},i)}),n=new Dn(["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:K.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:K.color.primary}}},t}(St);function CHe(e){e.registerChartView(SHe),e.registerSeriesModel(AHe),e.registerProcessor(oHe),e.registerVisual(sHe),e.registerVisual(lHe),e.registerLayout(dHe),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,pHe),e.registerLayout(mHe),e.registerCoordinateSystem("graphView",{dimensions:Pf.dimensions,create:xHe}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},lr),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},lr),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=FT(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var EW=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=re(Ao(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=re(Ao(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");Wt(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,A,M){return r.getFormattedLabel(_,b,"node",T,fi(A,f.normal&&f.normal.get("formatter"),n.get("name")),M)}},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}(bn),MHe=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=re(Ao(c.getModel("itemStyle"),u,!0),u),m=this;if(isNaN(g.sStartAngle)||isNaN(g.tStartAngle)){m.setShape(g);return}o?(m.setShape(g),DW(m,l,r,h)):(pa(m),DW(m,l,r,h),lt(m,{shape:g},s,i)),Wt(this,v==="adjacency"?l.getAdjacentDataIndices():v,d.get("blurScope"),d.get("disabled")),Dr(m,f,"lineStyle"),n.setItemGraphicEl(l.dataIndex,m)},t}(rt);function DW(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(ve(l)&&ve(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 bf(f,h,d,v,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var PHe=Math.PI/180,LHe=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")*PHe;if(a.diff(o).add(function(c){var f=a.getItemLayout(c);if(f){var h=new EW(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&&Cs(h,r,f);return}h?h.updateData(a,c,l):h=new EW(a,c,l),s.add(h)}).remove(function(c){var f=o.getItemGraphicEl(c);f&&Cs(f,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=de(u[0],i.getWidth()),this.group.originY=de(u[1],i.getHeight()),Nt(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 MHe(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&&Cs(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(_t),kHe=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 Xv(pe(this.getData,this),pe(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=Hj(a,i,this,!0,s);return o.data}function s(l,u){var c=tt.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),Ar("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return Ar("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}(St),mM=Math.PI/180;function IHe(e,t){e.eachSeriesByType("chord",function(r){OHe(r,t)})}function OHe(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=pJ(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=Math.max((e.get("padAngle")||0)*mM,0),h=Math.max((e.get("minAngle")||0)*mM,0),d=-e.get("startAngle")*mM,v=d+Math.PI*2,g=e.get("clockwise"),m=g?1:-1,y=[d,v];ST(y,!g);var _=y[0],b=y[1],S=b-_,T=r.getSum("value")===0&&i.getSum("value")===0,A=[],M=0;n.eachEdge(function(z){var U=T?1:z.getValue("value");T&&(U>0||h)&&(M+=2);var H=z.node1.dataIndex,Y=z.node2.dataIndex;A[H]=(A[H]||0)+U,A[Y]=(A[Y]||0)+U});var P=0;if(n.eachNode(function(z){var U=z.getValue("value");isNaN(U)||(A[z.dataIndex]=Math.max(U,A[z.dataIndex]||0)),!T&&(A[z.dataIndex]>0||h)&&M++,P+=A[z.dataIndex]||0}),!(M===0||P===0)){f*M>=Math.abs(S)&&(f=Math.max(0,(Math.abs(S)-h*M)/M)),(f+h)*M>=Math.abs(S)&&(h=(Math.abs(S)-f*M)/M);var k=(S-f*M*m)/P,I=0,O=0,D=0;n.eachNode(function(z){var U=A[z.dataIndex]||0,H=k*(P?U:1)*m;Math.abs(H)O){var B=I/O;n.eachNode(function(z){var U=z.getLayout().angle;Math.abs(U)>=h?z.setLayout({angle:U*B,ratio:B},!0):z.setLayout({angle:h,ratio:h===0?1:U/h},!0)})}else n.eachNode(function(z){if(!N){var U=z.getLayout().angle,H=Math.min(U/D,1),Y=H*I;U-Yh&&h>0){var H=N?1:Math.min(U/D,1),Y=U-h,Z=Math.min(Y,Math.min($,I*H));$-=Z,z.setLayout({angle:U-Z,ratio:(U-Z)/U},!0)}else h>0&&z.setLayout({angle:h,ratio:U===0?1:h/U},!0)}});var F=_,G=[];n.eachNode(function(z){var U=Math.max(z.getLayout().angle,h);z.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:F,endAngle:F+U*m,clockwise:g},!0),G[z.dataIndex]=F,F+=(U+f)*m}),n.eachEdge(function(z){var U=T?1:z.getValue("value"),H=k*(P?U:1)*m,Y=z.node1.dataIndex,Z=G[Y]||0,J=Math.abs((z.node1.getLayout().ratio||1)*H),ae=Z+J*m,ce=[s+c*Math.cos(Z),l+c*Math.sin(Z)],ge=[s+c*Math.cos(ae),l+c*Math.sin(ae)],We=z.node2.dataIndex,xe=G[We]||0,ne=Math.abs((z.node2.getLayout().ratio||1)*H),fe=xe+ne*m,le=[s+c*Math.cos(xe),l+c*Math.sin(xe)],ee=[s+c*Math.cos(fe),l+c*Math.sin(fe)];z.setLayout({s1:ce,s2:ge,sStartAngle:Z,sEndAngle:ae,t1:le,t2:ee,tStartAngle:xe,tEndAngle:fe,cx:s,cy:l,r:c,value:U,clockwise:g}),G[Y]=ae,G[We]=fe})}}}function EHe(e){e.registerChartView(LHe),e.registerSeriesModel(kHe),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,IHe),e.registerProcessor(Zv("chord"))}var DHe=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),NHe=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 DHe},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}(rt);function jHe(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=de(r[0],t.getWidth()),s=de(r[1],t.getHeight()),l=de(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function x_(e,t){var r=e==null?"":e+"";return t&&(ve(t)?r=t.replace("{value}",r):Ae(t)&&(r=t(e))),r}var RHe=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=jHe(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?Ow:bn,v=f.get("show"),g=f.getModel("lineStyle"),m=g.get("width"),y=[u,c];ST(y,!l),u=y[0],c=y[1];for(var _=c-u,b=u,S=[],T=0;v&&T=k&&(I===0?0:a[I-1][0])Math.PI/2&&(ae+=Math.PI)):J==="tangential"?ae=-P-Math.PI/2:ot(J)&&(ae=J*Math.PI/180),ae===0?f.add(new at({style:Mt(b,{text:U,x:Y,y:Z,verticalAlign:$<-.8?"top":$>.8?"bottom":"middle",align:B<-.4?"left":B>.4?"right":"center"},{inheritColor:H}),silent:!0})):f.add(new at({style:Mt(b,{text:U,x:Y,y:Z,verticalAlign:"middle",align:"center"},{inheritColor:H}),silent:!0,originX:Y,originY:Z,rotation:ae}))}if(_.get("show")&&F!==S){var G=_.get("distance");G=G?G+c:c;for(var ce=0;ce<=T;ce++){B=Math.cos(P),$=Math.sin(P);var ge=new yr({shape:{x1:B*(v-G)+h,y1:$*(v-G)+d,x2:B*(v-M-G)+h,y2:$*(v-M-G)+d},silent:!0,style:D});D.stroke==="auto"&&ge.setStyle({stroke:a((F+ce/T)/S)}),f.add(ge),P+=I}P-=I}else P+=k}},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"),A=[S,T],M=[s,l];function P(I,O){var D=_.getItemModel(I),N=D.getModel("pointer"),B=de(N.get("width"),o.r),$=de(N.get("length"),o.r),F=r.get(["pointer","icon"]),G=N.get("offsetCenter"),z=de(G[0],o.r),U=de(G[1],o.r),H=N.get("keepAspect"),Y;return F?Y=xr(F,z-B/2,U-$,B,$,null,H):Y=new NHe({shape:{angle:-Math.PI/2,width:B,r:$,x:z,y:U}}),Y.rotation=-(O+Math.PI/2),Y.x=o.cx,Y.y=o.cy,Y}function k(I,O){var D=m.get("roundCap"),N=D?Ow:bn,B=m.get("overlap"),$=B?m.get("width"):c/_.count(),F=B?o.r-$:o.r-(I+1)*$,G=B?o.r:o.r-I*$,z=new N({shape:{startAngle:s,endAngle:O,cx:o.cx,cy:o.cy,clockwise:u,r0:F,r:G}});return B&&(z.z2=gt(_.get(b,I),[S,T],[100,0],!0)),z}(y||g)&&(_.diff(h).add(function(I){var O=_.get(b,I);if(g){var D=P(I,s);Nt(D,{rotation:-((isNaN(+O)?M[0]:gt(O,A,M,!0))+Math.PI/2)},r),f.add(D),_.setItemGraphicEl(I,D)}if(y){var N=k(I,s),B=m.get("clip");Nt(N,{shape:{endAngle:gt(O,A,M,B)}},r),f.add(N),rI(r.seriesIndex,_.dataType,I,N),v[I]=N}}).update(function(I,O){var D=_.get(b,I);if(g){var N=h.getItemGraphicEl(O),B=N?N.rotation:s,$=P(I,B);$.rotation=B,lt($,{rotation:-((isNaN(+D)?M[0]:gt(D,A,M,!0))+Math.PI/2)},r),f.add($),_.setItemGraphicEl(I,$)}if(y){var F=d[O],G=F?F.shape.endAngle:s,z=k(I,G),U=m.get("clip");lt(z,{shape:{endAngle:gt(D,A,M,U)}},r),f.add(z),rI(r.seriesIndex,_.dataType,I,z),v[I]=z}}).execute(),_.each(function(I){var O=_.getItemModel(I),D=O.getModel("emphasis"),N=D.get("focus"),B=D.get("blurScope"),$=D.get("disabled");if(g){var F=_.getItemGraphicEl(I),G=_.getItemVisual(I,"style"),z=G.fill;if(F instanceof Xr){var U=F.style;F.useStyle(re({image:U.image,x:U.x,y:U.y,width:U.width,height:U.height},G))}else F.useStyle(G),F.type!=="pointer"&&F.setColor(z);F.setStyle(O.getModel(["pointer","itemStyle"]).getItemStyle()),F.style.fill==="auto"&&F.setStyle("fill",a(gt(_.get(b,I),A,[0,1],!0))),F.z2EmphasisLift=0,Dr(F,O),Wt(F,N,B,$)}if(y){var H=v[I];H.useStyle(_.getItemVisual(I,"style")),H.setStyle(O.getModel(["progress","itemStyle"]).getItemStyle()),H.z2EmphasisLift=0,Dr(H,O),Wt(H,N,B,$)}}),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+de(l[0],n.r),n.cy-o/2+de(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)),A=_.getModel("title");if(A.get("show")){var M=A.get("offsetCenter"),P=o.cx+de(M[0],o.r),k=o.cy+de(M[1],o.r),I=d[y];I.attr({z2:m?0:2,style:Mt(A,{x:P,y:k,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(I)}var O=_.getModel("detail");if(O.get("show")){var D=O.get("offsetCenter"),N=o.cx+de(D[0],o.r),B=o.cy+de(D[1],o.r),$=de(O.get("width"),o.r),F=de(O.get("height"),o.r),G=r.get(["progress","show"])?l.getItemVisual(y,"style").fill:T,I=v[y],z=O.get("formatter");I.attr({z2:m?0:2,style:Mt(O,{x:N,y:B,text:x_(b,z),width:isNaN($)?null:$,height:isNaN(F)?null:F,align:"center",verticalAlign:"middle"},{inheritColor:G})}),KQ(I,{normal:O},b,function(H){return x_(H,z)}),g&&QQ(I,y,l,r,{getFormattedLabel:function(H,Y,Z,J,ae,ce){return x_(ce?ce.interpolatedValue:b,z)}}),S.add(I)}h.add(S)}),this.group.add(h),this._titleEls=d,this._detailEls=v},t.type="gauge",t}(_t),BHe=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 Yv(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,K.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:K.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:K.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:K.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:K.color.neutral00,borderWidth:0,borderColor:K.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:K.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:K.color.transparent,borderWidth:0,borderColor:K.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:K.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(St);function zHe(e){e.registerChartView(RHe),e.registerSeriesModel(BHe)}var $He=["itemStyle","opacity"],FHe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new on,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($He);c=c??1,i||pa(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Nt(a,{style:{opacity:c}},o,n)):lt(a,{style:{opacity:c},shape:{points:l.points}},o,n),Dr(a,s),this._updateLabel(r,n),Wt(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}),yj(i,xj(l),{stroke:h})},t}(wn),VHe=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 FHe(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);Cs(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}(_t),GHe=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 Xv(pe(this.getData,this),pe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return Yv(this,{coordDimensions:["value"],encodeDefaulter:Be(UN,this)})},t.prototype._defaultLabelLine=function(r){ef(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:K.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:K.color.primary}}},t}(St);function WHe(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();oo8e)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||!xM(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 xM(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var u8e=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){R(["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);R(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}(Qe),c8e=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}(_a);function au(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=uh(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=uh(s,[0,o]),i=a=uh(s,[i,a]),n=0}t[0]=uh(t[0],r),t[1]=uh(t[1],r);var l=_M(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=uh(t[n],c);var f;return f=_M(t,n),i!=null&&(f.sign!==l.sign||f.spana&&(t[1-n]=t[n]+f.sign*a),t}function _M(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 uh(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var bM=R,Xre=Math.min,qre=Math.max,RW=Math.floor,f8e=Math.ceil,BW=mr,h8e=Math.PI,d8e=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;bM(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new c8e(o,p0(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();bM(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),lf(o.scale,o.model)},this)}},this)},e.prototype.resize=function(t,r){var n=jr(t,r).refContainer;this._rect=$t(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=__(t.get("axisExpandWidth"),l),f=__(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=__(d[1]-d[0],l),d[1]=d[0]+v;else{v=__(c*(f-1),l);var g=t.get("axisExpandCenter")||RW(u/2);d=[c*g-v/2],d[1]=d[0]+v}var m=(s-v)/(u-f);m<3&&(m=0);var y=[RW(BW(d[0]/c,1))+1,f8e(BW(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])}),bM(n,function(o,s){var l=(i.axisExpandable?p8e:v8e)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:h8e/2,vertical:0},f=[u[a].x+t.x,u[a].y+t.y],h=c[a],d=Wr();qs(d,d,h),Ua(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=[];R(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?au(l,i,o,"all"):u="none";else{var d=i[1]-i[0],v=o[1]*s/d;i=[qre(0,v-d/2)],i[1]=Xre(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function __(e,t){return Xre(qre(e,t[0]),t[1])}function v8e(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function p8e(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--)Mi(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;a_8e}function rne(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function nne(e,t,r,n){var i=new Me;return i.add(new Xe({name:"main",style:qj(r),silent:!0,draggable:!0,cursor:"move",drift:Be(FW,e,t,i,["n","s","w","e"]),ondragend:Be(cf,t,{isEnd:!0})})),R(n,function(a){i.add(new Xe({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Be(FW,e,t,i,a),ondragend:Be(cf,t,{isEnd:!0})}))}),i}function ine(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=iv(i,b8e),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;is(e,t,"main",o,s,v,g),n.transformable&&(is(e,t,"w",l,u,a,y),is(e,t,"e",h,u,a,y),is(e,t,"n",l,u,m,a),is(e,t,"s",l,d,m,a),is(e,t,"nw",l,u,a,a),is(e,t,"ne",h,u,a,a),is(e,t,"sw",l,d,a,a),is(e,t,"se",h,d,a,a))}function uO(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(qj(r)),i.attr({silent:!n,cursor:n?"move":"default"}),R([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?cO(e,a[0]):M8e(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?S8e[s]+"-resize":null})})}function is(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(L8e(Kj(e,t,[[n,i],[n+a,i+o]])))}function qj(e){return Pe({strokeNoScale:!0},e.brushStyle)}function ane(e,t,r,n){var i=[Dy(e,r),Dy(t,n)],a=[iv(e,r),iv(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function C8e(e){return Yl(e.group)}function cO(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=MT(r[t],C8e(e));return n[i]}function M8e(e,t){var r=[cO(e,t[0]),cO(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function FW(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=one(t,i,a);R(n,function(u){var c=w8e[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(ane(s[0][0],s[1][0],s[0][1],s[1][1])),Zj(t,r),cf(t,{isEnd:!1})}function P8e(e,t,r,n){var i=t.__brushOption.range,a=one(e,r,n);R(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Zj(e,t),cf(e,{isEnd:!1})}function one(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 Kj(e,t,r){var n=tne(e,t);return n&&n!==uf?n.clipPath(r,e._transform):Ce(r)}function L8e(e){var t=Dy(e[0][0],e[1][0]),r=Dy(e[0][1],e[1][1]),n=iv(e[0][0],e[1][0]),i=iv(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function k8e(e,t,r){if(!(!e._brushType||O8e(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=Xj(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var HT={lineX:WW(0),lineY:WW(1),rect:{createCover:function(e,t){function r(n){return n}return nne({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=rne(e);return ane(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){ine(e,t,r,n)},updateCommon:uO,contain:hO},polygon:{createCover:function(e,t){var r=new Me;return r.add(new on({name:"main",style:qj(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new wn({name:"main",draggable:!0,drift:Be(P8e,e,t),ondragend:Be(cf,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:Kj(e,t,r)})},updateCommon:uO,contain:hO}};function WW(e){return{createCover:function(t,r){return nne({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=rne(t),n=Dy(r[0][e],r[1][e]),i=iv(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=tne(t,r);if(o!==uf&&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(),ine(t,r,l,i)},updateCommon:uO,contain:hO}}function lne(e){return e=Qj(e),function(t){return MN(t,e)}}function une(e,t){return e=Qj(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 cne(e,t,r){var n=Qj(e);return function(i,a){return n.contain(a[0],a[1])&&!pre(i,t,r)}}function Qj(e){return Oe.create(e)}var E8e=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 Uj(n.getZr())).on("brush",pe(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!D8e(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=j8e(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,f=r.axis.dim,h=l.getAxisLayout(f),d=re({strokeContainThreshold:c},h),v=new Hn(r,i,d);v.build(),this._axisGroup.add(v.group),this._refreshBrushController(d,u,r,s,c,i),f0(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:lne(f),isTargetByCursor:cne(f,s,a),getLinearBrushOtherExtent:une(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(N8e(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}(Lt);function D8e(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function N8e(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 j8e(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var R8e={type:"axisAreaSelect",event:"axisAreaSelected"};function B8e(e){e.registerAction(R8e,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 z8e={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function fne(e){e.registerComponentView(s8e),e.registerComponentModel(u8e),e.registerCoordinateSystem("parallel",m8e),e.registerPreprocessor(n8e),e.registerComponentModel(sO),e.registerComponentView(E8e),rv(e,"parallel",sO,z8e),B8e(e)}function $8e(e){Ze(fne),e.registerChartView(XHe),e.registerSeriesModel(QHe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,r8e)}var F8e=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}(),V8e=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new F8e},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(){$s(this)},t.prototype.downplay=function(){Fs(this)},t}(rt),G8e=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 Mf(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),gre(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(v){var g=new V8e,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(),A=T.get("localX"),M=T.get("localY"),P=v.node2.getLayout(),k=v.node2.getModel(),I=k.get("localX"),O=k.get("localY"),D=v.getLayout(),N,B,$,F,G,z,U,H;g.shape.extent=Math.max(1,D.dy),g.shape.orient=d,d==="vertical"?(N=(A!=null?A*u:S.x)+D.sy,B=(M!=null?M*c:S.y)+S.dy,$=(I!=null?I*u:P.x)+D.ty,F=O!=null?O*c:P.y,G=N,z=B*(1-b)+F*b,U=$,H=B*b+F*(1-b)):(N=(A!=null?A*u:S.x)+S.dx,B=(M!=null?M*c:S.y)+D.sy,$=I!=null?I*u:P.x,F=(O!=null?O*c:P.y)+D.ty,G=N*(1-b)+$*b,z=B,U=N*b+$*(1-b),H=F),g.setShape({x1:N,y1:B,x2:$,y2:F,cpx1:G,cpy1:z,cpx2:U,cpy2:H}),g.useStyle(_.getItemStyle()),HW(g.style,d,v);var Y=""+y.get("value"),Z=Nr(y,"edgeLabel");Ur(g,Z,{labelFetcher:{getFormattedLabel:function(ce,ge,We,xe,ne,fe){return r.getFormattedLabel(ce,ge,"edge",xe,fi(ne,Z.normal&&Z.normal.get("formatter"),Y),fe)}},labelDataIndex:v.dataIndex,defaultText:Y}),g.setTextConfig({position:"inside"});var J=y.getModel("emphasis");Dr(g,y,"lineStyle",function(ce){var ge=ce.getItemStyle();return HW(ge,d,v),ge}),s.add(g),h.setItemGraphicEl(v.dataIndex,g);var ae=J.get("focus");Wt(g,ae==="adjacency"?v.getAdjacentDataIndices():ae==="trajectory"?v.getTrajectoryDataIndices():ae,J.get("blurScope"),J.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(M,P){return r.getFormattedLabel(M,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 A=b.get("focus");Wt(T,A==="adjacency"?v.getAdjacentDataIndices():A==="trajectory"?v.getTrajectoryDataIndices():A,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(W8e(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 Pf(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}(_t);function HW(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");ve(n)&&ve(i)&&(e.fill=new bf(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function W8e(e,t,r){var n=new Xe({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Nt(n,{shape:{width:e.width+20}},t,r),n}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.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 tt(o[l],this,n));var u=Hj(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 Ar("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 Ar("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:K.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:K.color.primary}},animationEasing:"linear",animationDuration:1e3},t}(St);function U8e(e,t){e.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=jr(r,t).refContainer,o=$t(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,f=u.edges;Y8e(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");Z8e(c,f,n,i,s,l,d,v,g)})}function Z8e(e,t,r,n,i,a,o,s,l){X8e(e,t,r,i,a,s,l),J8e(e,t,a,i,n,o,s),lUe(e,s)}function Y8e(e){R(e,function(t){var r=Kl(t.outEdges,$w),n=Kl(t.inEdges,$w),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function X8e(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"&&q8e(e,o,a,M);var P=a==="vertical"?(i-r)/M:(n-r)/M;Q8e(e,P,a)}function hne(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function q8e(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,rUe(s,l,o),wM(s,i,r,n,o),sUe(s,l,o),wM(s,i,r,n,o)}function eUe(e,t){var r=[],n=t==="vertical"?"y":"x",i=Kk(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),R(i.keys,function(a){r.push(i.buckets.get(a))}),r}function tUe(e,t,r,n,i,a){var o=1/0;R(e,function(s){var l=s.length,u=0;R(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 rUe(e,t,r){R(e.slice().reverse(),function(n){R(n,function(i){if(i.outEdges.length){var a=Kl(i.outEdges,nUe,r)/Kl(i.outEdges,$w);if(isNaN(a)){var o=i.outEdges.length;a=o?Kl(i.outEdges,iUe,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-ou(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-ou(i,r))*t;i.setLayout({y:l},!0)}}})})}function nUe(e,t){return ou(e.node2,t)*e.getValue()}function iUe(e,t){return ou(e.node2,t)}function aUe(e,t){return ou(e.node1,t)*e.getValue()}function oUe(e,t){return ou(e.node1,t)}function ou(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function $w(e){return e.getValue()}function Kl(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),R(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&&R(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function cUe(e){e.registerChartView(G8e),e.registerSeriesModel(H8e),e.registerLayout(U8e),e.registerVisual(uUe),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=FT(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var dne=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=[];R(m,function(S,T){var A;ie(S)?(A=S.slice(),S.unshift(T)):ie(S.value)?(A=re({},S),A.value=A.value.slice(),S.value.unshift(T)):A=S,y.push(A)}),t.data=y}var _=this.defaultValueDimensions,b=[{name:f,type:Sw(v),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:Sw(g),dimsDef:_.slice()}];return Yv(this,{coordDimensions:b,dimensionsCount:_.length+1,encodeDefaulter:Be(SJ,b,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),vne=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:K.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:K.color.shadow}},animationDuration:800},t}(St);fr(vne,dne,!0);var 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){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=UW(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?(pa(f),pne(h,f,a,u)):f=UW(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}(_t),hUe=function(){function e(){}return e}(),dUe=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 hUe},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 _Ue={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==sn){var n="";mt(n)}var i=xUe(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function bUe(e){e.registerSeriesModel(vne),e.registerChartView(fUe),e.registerLayout(pUe),e.registerTransform(_Ue)}var wUe=["itemStyle","borderColor"],SUe=["itemStyle","borderColor0"],TUe=["itemStyle","borderColorDoji"],AUe=["itemStyle","color"],CUe=["itemStyle","color0"];function Jj(e,t){return t.get(e>0?AUe:CUe)}function eR(e,t){return t.get(e===0?TUe:e>0?wUe:SUe)}var MUe={seriesType:"candlestick",plan:Fv(),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=Jj(s,o),l.stroke=eR(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");re(u,l)}}}}}},PUe=["color","borderColor"],LUe=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){yu(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&&ZW(u,f))return;var h=SM(f,c,!0);Nt(h,{shape:{points:f.ends}},r,c),TM(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&&ZW(u,d)){a.remove(h);return}h?(lt(h,{shape:{points:d.ends}},r,c),pa(h)):h=SM(d),TM(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(),YW(r,this.group);var n=r.get("clip",!0)?y0(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=SM(s);TM(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){YW(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}(_t),kUe=function(){function e(){}return e}(),IUe=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 kUe},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}(rt);function SM(e,t,r){var n=e.ends;return new IUe({shape:{points:r?OUe(n,e):n},z2:100})}function ZW(e,t){for(var r=!0,n=0;nT?O[a]:I[a],ends:B,brushRect:U(A,M,b)})}function G(Y,Z){var J=[];return J[i]=Z,J[a]=Y,isNaN(Z)||isNaN(Y)?[NaN,NaN]:t.dataToPoint(J)}function z(Y,Z,J){var ae=Z.slice(),ce=Z.slice();ae[i]=nb(ae[i]+n/2,1,!1),ce[i]=nb(ce[i]-n/2,1,!0),J?Y.push(ae,ce):Y.push(ce,ae)}function U(Y,Z,J){var ae=G(Y,J),ce=G(Z,J);return ae[i]-=n/2,ce[i]-=n/2,{x:ae[0],y:ae[1],width:n,height:ce[1]-ae[1]}}function H(Y){return Y[i]=nb(Y[i],1),Y}}function v(g,m){for(var y=So(g.count*4),_=0,b,S=[],T=[],A,M=m.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(A=g.next())!=null;){var k=M.get(s,A),I=M.get(u,A),O=M.get(c,A),D=M.get(f,A),N=M.get(h,A);if(isNaN(k)||isNaN(D)||isNaN(N)){y[_++]=NaN,_+=3;continue}y[_++]=XW(M,A,I,O,c,P),S[i]=k,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 XW(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 jUe(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=de(be(e.get("barMaxWidth"),i),i),o=de(be(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?de(s,i):Math.max(Math.min(i/2,a),o)}function RUe(e){e.registerChartView(LUe),e.registerSeriesModel(gne),e.registerPreprocessor(DUe),e.registerVisual(MUe),e.registerLayout(NUe)}function qW(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 BUe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new g0(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;Ae(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 ps(r.__p1,r.__cp1)+ps(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=rn,c=Nk;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}(mne),GUe=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),WUe=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:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new GUe},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(yQ(f,h,m,y,v,g,s,r,n))return l}else if(yl(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}(),xne={seriesType:"lines",plan:Fv(),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)&&y0(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=xne.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 HUe:new Wj(o?a?VUe:yne:a?mne:Gj),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}(_t),ZUe=typeof Uint32Array>"u"?Array:Uint32Array,YUe=typeof Float64Array>"u"?Array:Float64Array;function KW(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),fT([i,r[0],r[1]])}))}var XUe=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||[],KW(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(KW(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=Wd(this._flatCoords,n.flatCoords),this._flatCoordsOffset=Wd(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}(St);function b_(e){return e instanceof Array||(e=[e,e]),e}var qUe={seriesType:"lines",reset:function(e){var t=b_(e.get("symbol")),r=b_(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=b_(s.getShallow("symbol",!0)),u=b_(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 KUe(e){e.registerChartView(UUe),e.registerSeriesModel(XUe),e.registerLayout(xne),e.registerVisual(qUe)}var QUe=256,JUe=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=hi.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*I+P),T[A++]=D[O],T[A++]=D[O+1],T[A++]=D[O+2],T[A++]=D[O+3]*b*256}else A+=4}return h.putImageData(S,0,0),f},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=hi.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=K.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 e7e(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 QW(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var r7e=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()):QW(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&&(QW(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){yu(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=iu(s,"cartesian2d"),u=iu(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"]),A=Nr(r),M=r.getModel("emphasis"),P=M.get("focus"),k=M.get("blurScope"),I=M.get("disabled"),O=l||u?[y.mapDimension("x"),y.mapDimension("y"),y.mapDimension("value")]:[y.mapDimension("time"),y.mapDimension("value")],D=i;Dh[1]||Fd[1])continue;var G=s.dataToPoint([$,F]);N=new Xe({shape:{x:G[0]-c/2,y:G[1]-f/2,width:c,height:f},style:B})}else if(u){var z=s.dataToLayout([y.get(O[0],D),y.get(O[1],D)]).rect;if(mn(z.x))continue;N=new Xe({z2:1,shape:z,style:B})}else{if(isNaN(y.get(O[1],D)))continue;var U=s.dataToLayout([y.get(O[0],D)]),z=U.contentRect||U.rect;if(mn(z.x)||mn(z.y))continue;N=new Xe({z2:1,shape:z,style:B})}if(y.hasItemOption){var H=y.getItemModel(D),Y=H.getModel("emphasis");_=Y.getModel("itemStyle").getItemStyle(),b=H.getModel(["blur","itemStyle"]).getItemStyle(),S=H.getModel(["select","itemStyle"]).getItemStyle(),T=H.get(["itemStyle","borderRadius"]),P=Y.get("focus"),k=Y.get("blurScope"),I=Y.get("disabled"),A=Nr(H)}N.shape.r=T;var Z=r.getRawValue(D),J="-";Z&&Z[2]!=null&&(J=Z[2]+""),Ur(N,A,{labelFetcher:r,labelDataIndex:D,defaultOpacity:B.opacity,defaultText:J}),N.ensureState("emphasis").style=_,N.ensureState("blur").style=b,N.ensureState("select").style=S,Wt(N,P,k,I),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 JUe;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(M,P,k){var I=r.dataToPoint([M,P]);return I[0]-=h,I[1]-=d,I.push(k),I}),S=i.getExtent(),T=i.type==="visualMap.continuous"?t7e(S,i.option.range):e7e(S,i.getPieceList(),i.option.selected);u.update(b,m,y,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var A=new Xr({style:{width:m,height:y,x:h,y:d,image:u.canvas},silent:!0});this.group.add(A)},t.type="heatmap",t}(_t),n7e=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 Yo(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=$v.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:K.color.primary}}},t}(St);function i7e(e){e.registerChartView(r7e),e.registerSeriesModel(n7e)}var a7e=["itemStyle","borderWidth"],JW=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],MM=new Zo,o7e=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:JW[+c],categoryDim:JW[1-+c]};o.diff(s).add(function(v){if(o.hasValue(v)){var g=tH(o,v),m=eH(o,v,g,h),y=rH(o,h,m);o.setItemGraphicEl(v,y),a.add(y),iH(y,h,m)}}).update(function(v,g){var m=s.getItemGraphicEl(g);if(!o.hasValue(v)){a.remove(m);return}var y=tH(o,v),_=eH(o,v,y,h),b=Ane(o,_);m&&b!==m.__pictorialShapeStr&&(a.remove(m),o.setItemGraphicEl(v,null),m=null),m?d7e(m,h,_):m=rH(o,h,_,!0),o.setItemGraphicEl(v,m),m.__pictorialSymbolMeta=_,a.add(m),iH(m,h,_)}).remove(function(v){var g=s.getItemGraphicEl(v);g&&nH(s,v,g.__pictorialSymbolMeta.animationModel,g)}).execute();var d=r.get("clip",!0)?y0(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){nH(a,De(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(_t);function eH(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};s7e(r,a,i,n,h),l7e(e,t,i,a,o,h.boundingLength,h.pxSign,c,n,h),u7e(r,h.symbolScale,u,n,h);var d=h.symbolSize,v=Af(r.get("symbolOffset"),d);return c7e(r,d,i,a,o,v,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,n,h),h}function s7e(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(ie(o)){var f=[PM(s,o[0])-l,PM(s,o[1])-l];f[1]=0?1:-1:c>0?1:-1}function PM(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function l7e(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;ie(d)?v=d.slice():d==null?v=["100%","100%"]:v=[d,d],v[f.index]=de(v[f.index],h),v[c.index]=de(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 u7e(e,t,r,n,i){var a=e.get(a7e)||0;a&&(MM.attr({scaleX:t[0],scaleY:t[1],rotation:r}),MM.updateTransform(),a/=MM.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function c7e(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),_=nn(e.get("symbolMargin"),"15%")+"",b=!1;_.lastIndexOf("!")===_.length-1&&(b=!0,_=_.slice(0,_.length-1));var S=de(_,t[d.index]),T=Math.max(g+S*2,0),A=b?0:S*2,M=cN(n),P=M?n:aH((y+A)/T),k=y-P*g;S=k/2/(b?P:Math.max(P-1,1)),T=g+S*2,A=b?0:S*2,!M&&n!=="fixed"&&(P=u?aH((Math.abs(u)+A)/T):0),m=P*T-A,f.repeatTimes=P,f.symbolMargin=S}var I=v*(m/2),O=f.pathPosition=[];O[h.index]=r[h.wh]/2,O[d.index]=o==="start"?I:o==="end"?l-I:l/2,a&&(O[0]+=a[0],O[1]+=a[1]);var D=f.bundlePosition=[];D[h.index]=r[h.xy],D[d.index]=r[d.xy];var N=f.barRectShape=re({},r);N[d.wh]=v*Math.max(Math.abs(r[d.wh]),Math.abs(O[d.index]+I)),N[h.wh]=r[h.wh];var B=f.clipShape={};B[h.xy]=-r[h.xy],B[h.wh]=c.ecSize[h.wh],B[d.xy]=0,B[d.wh]=r[d.wh]}function _ne(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 bne(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(tR(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 wne(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?ud(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=_ne(r),i.add(a),ud(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 Sne(e,t,r){var n=re({},t.barRectShape),i=e.__pictorialBarRect;i?ud(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 Tne(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=re({},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],wf[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function tH(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=f7e,r.isAnimationEnabled=h7e,r}function f7e(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function h7e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function rH(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?bne(i,t,r):wne(i,t,r),Sne(i,r,n),Tne(i,t,r,n),i.__pictorialShapeStr=Ane(e,r),i.__pictorialSymbolMeta=r,i}function d7e(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?bne(e,t,r,!0):wne(e,t,r,!0),Sne(e,r,!0),Tne(e,t,r,!0)}function nH(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];tR(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),R(a,function(o){nu(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function Ane(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function tR(e,t,r){R(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function ud(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&wf[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function iH(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");tR(e,function(g){if(g instanceof Xr){var m=g.style;g.useStyle(re({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:tv(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Wt(e,c,f,a.get("disabled"))}function aH(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var v7e=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=xu(Py.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:K.color.primary}}}),t}(Py);function p7e(e){e.registerChartView(o7e),e.registerSeriesModel(v7e),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Be(Hee,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Uee("pictorialBar"))}var g7e=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 Vs(this._layersSeries||[],l,h,h),v=[];d.add(pe(g,this,"add")).update(pe(g,this,"update")).remove(pe(g,this,"remove")).execute();function g(m,y,_){var b=o._layers;if(m==="remove"){s.remove(b[y]);return}for(var S=[],T=[],A,M=l[y].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=f)}return{y0:i,max:a}}function b7e(e){e.registerChartView(g7e),e.registerSeriesModel(y7e),e.registerLayout(x7e),e.registerProcessor(Zv("themeRiver"))}var w7e=2,S7e=4,sH=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=w7e,o.textConfig={inside:!0},De(o).seriesIndex=n.seriesIndex;var s=new at({z2:S7e,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=re({},c);f.label=null;var h=n.getVisual("style");h.lineJoin="bevel";var d=n.getVisual("decal");d&&(h.decal=Qd(d,o));var v=Ao(l.getModel("itemStyle"),f,!0);re(f,v),R(Yn,function(_){var b=s.ensureState(_),S=l.getModel([_,"itemStyle"]);b.style=S.getItemStyle();var T=Ao(S,f);T&&(b.shape=T)}),r?(s.setShape(f),s.shape.r=c.r0,Nt(s,{shape:{r:c.r}},i,n.dataIndex)):(lt(s,{shape:f},i),pa(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"?Wd(n.getAncestorsIndices(),n.getDescendantIndices()):m==="ancestor"?n.getAncestorsIndices():m==="descendant"?n.getDescendantIndices():m;Wt(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)B&&!Zd(F-B)&&F<$;M==="outside"?(I=o.r+O,D=G?"right":"left"):!D||D==="center"?(s===2*Math.PI&&o.r0===0?I=0:I=(o.r+o.r0)/2,D="center"):D==="left"?(I=o.r0+O,D=G?"right":"left"):D==="right"&&(I=o.r-O,D=G?"left":"right"),S.style.align=D,S.style.verticalAlign=m(_,"verticalAlign")||"middle",S.x=I*u+o.cx,S.y=I*c+o.cy;var z=0;N==="radial"?z=Pi(-l)+(G?Math.PI:0):N==="tangential"?z=Pi(Math.PI/2-l)+(G?Math.PI:0):ot(N)&&(z=N*Math.PI/180),S.rotation=Pi(z)});function m(y,_){var b=y.get(_);return b??a.get(_)}h.dirtyStyle()},t}(bn),dO="sunburstRootToNode",lH="sunburstHighlight",T7e="sunburstUnhighlight";function A7e(e){e.registerAction({type:dO,update:"updateView"},function(t,r){r.eachComponent({mainType:"series",subType:"sunburst",query:t},n);function n(i,a){var o=ky(t,[dO],i);if(o){var s=i.getViewRoot();s&&(t.direction=Bj(s,o.node)?"rollUp":"drillDown"),i.resetViewRoot(o.node)}}}),e.registerAction({type:lH,update:"none"},function(t,r,n){t=re({},t),r.eachComponent({mainType:"series",subType:"sunburst",query:t},i);function i(a){var o=ky(t,[lH],a);o&&(t.dataIndex=o.node.dataIndex)}n.dispatchAction(re(t,{type:"highlight"}))}),e.registerAction({type:T7e,update:"updateView"},function(t,r,n){t=re({},t),n.dispatchAction(re(t,{type:"downplay"}))})}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,a){var o=this;this.seriesModel=r,this.api=i,this.ecModel=n;var s=r.getData(),l=s.tree.root,u=r.getViewRoot(),c=this.group,f=r.get("renderLabelForZeroData"),h=[];u.eachNode(function(_){h.push(_)});var d=this._oldChildren||[];v(h,d),y(l,u),this._initEvents(),this._oldChildren=h;function v(_,b){if(_.length===0&&b.length===0)return;new Vs(b,_,S,S).add(T).update(T).remove(Be(T,null)).execute();function S(A){return A.getId()}function T(A,M){var P=A==null?null:_[A],k=M==null?null:b[M];g(P,k)}}function g(_,b){if(!f&&_&&!_.getValue()&&(_=null),_!==l&&b!==l){if(b&&b.piece)_?(b.piece.updateData(!1,_,r,n,i),s.setItemGraphicEl(_.dataIndex,b.piece)):m(b);else if(_){var S=new sH(_,r,n,i);c.add(S),s.setItemGraphicEl(_.dataIndex,S)}}}function m(_){_&&_.piece&&(c.remove(_.piece),_.piece=null)}function y(_,b){b.depth>0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,r,n,i):(o.virtualPiece=new sH(_,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";dw(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:dO,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}(_t),M7e=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};Cne(i);var a=this._levelModels=se(r.levels||[],function(l){return new tt(l,this,n)},this),o=Rj.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=GT(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(){kre(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}(St);function Cne(e){var t=0;R(e.children,function(n){Cne(n);var i=n.value;ie(i)&&(i=i[0]),t+=i});var r=e.value;ie(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ie(e.value)?e.value[0]=r:e.value=r}var uH=Math.PI/180;function P7e(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");ie(a)||(a=[0,a]),ie(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=de(i[0],o),c=de(i[1],s),f=de(a[0],l/2),h=de(a[1],l/2),d=-n.get("startAngle")*uH,v=n.get("minAngle")*uH,g=n.getData().tree.root,m=n.getViewRoot(),y=m.depth,_=n.get("sort");_!=null&&Mne(m,_);var b=0;R(m.children,function(F){!isNaN(F.getValue())&&b++});var S=m.getValue(),T=Math.PI/(S||b)*2,A=m.depth>0,M=m.height-(A?-1:1),P=(h-f)/(M||1),k=n.get("clockwise"),I=n.get("stillShowZeroSum"),O=k?1:-1,D=function(F,G){if(F){var z=G;if(F!==g){var U=F.getValue(),H=S===0&&I?T:U*T;H1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&ve(s)&&(s=J1(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");re(u,l)})})}function I7e(e){e.registerChartView(C7e),e.registerSeriesModel(M7e),e.registerLayout(Be(P7e,"sunburst")),e.registerProcessor(Be(Zv,"sunburst")),e.registerVisual(k7e),A7e(e)}var cH={color:"fill",borderColor:"stroke"},O7e={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Ms=Je(),E7e=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 Yo(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=Ms(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}(St);function D7e(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 N7e(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:pe(D7e,e)}}}function j7e(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 R7e(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:pe(j7e,e)}}}function B7e(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:pe(B7e,e)}}}function $7e(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 F7e(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:pe($7e,e)}}}function V7e(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 G7e(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 Pne(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||ye(e,"text")))}function Lne(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},ye(n,"text")&&(o.text=n.text),ye(n,"rich")&&(o.rich=n.rich),ye(n,"textFill")&&(o.fill=n.textFill),ye(n,"textStroke")&&(o.stroke=n.textStroke),ye(n,"fontFamily")&&(o.fontFamily=n.fontFamily),ye(n,"fontSize")&&(o.fontSize=n.fontSize),ye(n,"fontStyle")&&(o.fontStyle=n.fontStyle),ye(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=ye(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),ye(n,"textPosition")&&(i.position=n.textPosition),ye(n,"textOffset")&&(i.offset=n.textOffset),ye(n,"textRotation")&&(i.rotation=n.textRotation),ye(n,"textDistance")&&(i.distance=n.textDistance)}return fH(o,e),R(o.rich,function(l){fH(l,l)}),{textConfig:i,textContent:a}}function fH(e,t){t&&(t.font=t.textFont||t.font,ye(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),ye(t,"textAlign")&&(e.align=t.textAlign),ye(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),ye(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),ye(t,"textWidth")&&(e.width=t.textWidth),ye(t,"textHeight")&&(e.height=t.textHeight),ye(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),ye(t,"textPadding")&&(e.padding=t.textPadding),ye(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),ye(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),ye(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),ye(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),ye(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),ye(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),ye(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function hH(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||K.color.neutral99;dH(n,t);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||K.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||K.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,R(t.rich,function(s){dH(s,s)}),n}function dH(e,t){t&&(ye(t,"fill")&&(e.textFill=t.fill),ye(t,"stroke")&&(e.textStroke=t.fill),ye(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),ye(t,"font")&&(e.font=t.font),ye(t,"fontStyle")&&(e.fontStyle=t.fontStyle),ye(t,"fontWeight")&&(e.fontWeight=t.fontWeight),ye(t,"fontSize")&&(e.fontSize=t.fontSize),ye(t,"fontFamily")&&(e.fontFamily=t.fontFamily),ye(t,"align")&&(e.textAlign=t.align),ye(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),ye(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),ye(t,"width")&&(e.textWidth=t.width),ye(t,"height")&&(e.textHeight=t.height),ye(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),ye(t,"padding")&&(e.textPadding=t.padding),ye(t,"borderColor")&&(e.textBorderColor=t.borderColor),ye(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),ye(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),ye(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),ye(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),ye(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),ye(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),ye(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),ye(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),ye(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),ye(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var kne={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},vH=it(kne);ha(Bo,function(e,t){return e[t]=1,e},{});Bo.join(", ");var Fw=["","style","shape","extra"],av=Je();function rR(e,t,r,n,i){var a=e+"Animation",o=Nv(e,n,i)||{},s=av(t).userDuring;return o.duration>0&&(o.during=s?pe(Y7e,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),re(o,r[a]),o}function fb(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=av(e),u=t.style;l.userDuring=t.during;var c={},f={};if(q7e(e,t,f),e.type==="compound")for(var h=e.shape.paths,d=t.shape.paths,v=0;v0&&e.animateFrom(m,y)}else H7e(e,t,i||0,r,c);Ine(e,t),u?e.dirty():e.markRedraw()}function Ine(e,t){for(var r=av(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function U7e(e,t){ye(t,"silent")&&(e.silent=t.silent),ye(t,"ignore")&&(e.ignore=t.ignore),e instanceof va&&ye(t,"invisible")&&(e.invisible=t.invisible),e instanceof rt&&ye(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var co={},Z7e={setTransform:function(e,t){return co.el[e]=t,this},getTransform:function(e){return co.el[e]},setShape:function(e,t){var r=co.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=co.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=co.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=co.el.style;if(t)return t[e]},setExtra:function(e,t){var r=co.el.extra||(co.el.extra={});return r[e]=t,this},getExtra:function(e){var t=co.el.extra;if(t)return t[e]}};function Y7e(){var e=this,t=e.el;if(t){var r=av(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}co.el=t,n(Z7e)}}function pH(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]={}),Fc(l))re(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(z,F):void 0}var U=t.get(G.name,F),H=G&&G.ordinalMeta;return H?H.categories[U]:U}function M($,F){F==null&&(F=c);var G=t.getItemVisual(F,"style"),z=G&&G.fill,U=G&&G.opacity,H=b(F,Ol).getItemStyle();z!=null&&(H.fill=z),U!=null&&(H.opacity=U);var Y={inheritColor:ve(z)?z:K.color.neutral99},Z=S(F,Ol),J=Mt(Z,null,Y,!1,!0);J.text=Z.getShallow("show")?be(e.getFormattedLabel(F,Ol),tv(t,F)):null;var ae=cw(Z,Y,!1);return I($,H),H=hH(H,J,ae),$&&k(H,$),H.legacy=!0,H}function P($,F){F==null&&(F=c);var G=b(F,Ps).getItemStyle(),z=S(F,Ps),U=Mt(z,null,null,!0,!0);U.text=z.getShallow("show")?fi(e.getFormattedLabel(F,Ps),e.getFormattedLabel(F,Ol),tv(t,F)):null;var H=cw(z,null,!0);return I($,G),G=hH(G,U,H),$&&k(G,$),G.legacy=!0,G}function k($,F){for(var G in F)ye(F,G)&&($[G]=F[G])}function I($,F){$&&($.textFill&&(F.textFill=$.textFill),$.textPosition&&(F.textPosition=$.textPosition))}function O($,F){if(F==null&&(F=c),ye(cH,$)){var G=t.getItemVisual(F,"style");return G?G[cH[$]]:null}if(ye(O7e,$))return t.getItemVisual(F,$)}function D($){if(o.type==="cartesian2d"){var F=o.getBaseAxis();return r$e(Pe({axis:F},$))}}function N(){return r.getCurrentSeriesIndices()}function B($){return kN($,r)}}function s9e(e){var t={};return R(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 EM(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=sR(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Wt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function sR(e,t,r,n,i,a){var o=-1,s=t;t&&Nne(t,n,i)&&(o=Ge(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=aR(n),s&&n9e(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,u9e(u,r,n,i,l,Hi),l9e(u,r,n,i,l),oR(e,u,r,n,Hi,i,l),ye(n,"info")&&(Ms(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function Nne(e,t,r){var n=Ms(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&v9e(a)&&jne(a)!==n.customPathData||i==="image"&&ye(o,"image")&&o.image!==n.customImagePath}function l9e(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&&Nne(o,a,n)&&(o=null),o||(o=aR(a),e.setClipPath(o)),oR(null,o,t,a,null,n,i)}}function u9e(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){mH(r,null,a),mH(r,Ps,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=aR(o),e.setTextContent(c)),oR(null,c,t,o,null,n,i);for(var f=o&&o.style,h=0;h=c;d--){var v=t.childAt(d);f9e(t,v,i)}}}function f9e(e,t,r){t&&UT(t,Ms(e).option,r)}function h9e(e){new Vs(e.oldChildren,e.newChildren,yH,yH,e).add(xH).update(xH).remove(d9e).execute()}function yH(e,t){var r=e&&e.name;return r??t9e+t}function xH(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;sR(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function d9e(e){var t=this.context,r=t.oldChildren[e];r&&UT(r,Ms(r).option,t.seriesModel)}function jne(e){return e&&(e.pathData||e.d)}function v9e(e){return e&&(ye(e,"pathData")||ye(e,"d"))}function p9e(e){e.registerChartView(i9e),e.registerSeriesModel(E7e)}var dc=Je(),_H=Ce,DM=pe,uR=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=Be(bH,r,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,r)}SH(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=kj(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=dc(t).pointerEl=new wf[a.type](_H(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=dc(t).labelEl=new at(_H(r.label));t.add(a),wH(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=dc(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=dc(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),wH(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=jv(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){zs(u.event)},onmousedown:DM(this._onHandleDragMove,this,0,0),drift:DM(this._onHandleDragMove,this),ondragend:DM(this._onHandleDragEnd,this)}),n.add(i)),SH(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");ie(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,Vv(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){bH(this._axisPointerModel,!r&&this._moveAnimation,this._handle,NM(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(NM(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(NM(i)),dc(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),_y(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 bH(e,t,r,n){Rne(dc(r).lastProp,n)||(dc(r).lastProp=n,t?lt(r,n,e):(r.stopAnimation(),r.attr(n)))}function Rne(e,t){if(Le(e)&&Le(t)){var r=!0;return R(t,function(n,i){r=r&&Rne(e[i],n)}),!!r}else return e===t}function wH(e,t){e[t.get(["label","show"])?"show":"hide"]()}function NM(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function SH(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 Bne(e,t,r,n,i){var a=r.get("value"),o=zne(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=gT(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),g9e(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 g9e(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 zne(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:Tw(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};R(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),ve(o)?a=o.replace("{value}",a):Ae(o)&&(a=o(s))}return a}function fR(e,t,r){var n=Wr();return qs(n,n,r.rotation),Ua(n,n,r.position),Ga([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function $ne(e,t,r,n,i,a){var o=Hn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Bne(t,n,i,a,{position:fR(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function hR(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function Fne(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function TH(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var m9e=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=AH(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var h=cR(a),d=y9e[u](s,f,c);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=Dw(l.getRect(),i);$ne(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=Dw(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=fR(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=AH(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}(uR);function AH(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var y9e={line:function(e,t,r){var n=hR([t,r[0]],[t,r[1]],CH(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:Fne([t-n/2,r[0]],[n,i],CH(e))}}};function CH(e){return e.dim==="x"?0:1}var x9e=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:K.color.border,width:1,type:"dashed"},shadowStyle:{color:K.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:K.color.neutral00,padding:[5,7,5,7],backgroundColor:K.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:K.color.accent40,throttle:40}},t}(Qe),xs=Je(),_9e=R;function Vne(e,t,r){if(!nt.node){var n=t.getZr();xs(n).records||(xs(n).records={}),b9e(n,t);var i=xs(n).records[e]||(xs(n).records[e]={});i.handler=r}}function b9e(e,t){if(xs(e).initialized)return;xs(e).initialized=!0,r("click",Be(MH,"click")),r("mousemove",Be(MH,"mousemove")),r("globalout",S9e);function r(n,i){e.on(n,function(a){var o=T9e(t);_9e(xs(e).records,function(s){s&&i(s,a,o.dispatchAction)}),w9e(o.pendings,t)})}}function w9e(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 S9e(e,t,r){e.handler("leave",null,r)}function MH(e,t,r,n){t.handler(e,r,n)}function T9e(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 gO(e,t){if(!nt.node){var r=t.getZr(),n=(xs(r).records||{})[e];n&&(xs(r).records[e]=null)}}var A9e=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";Vne("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){gO("axisPointer",n)},t.prototype.dispose=function(r,n){gO("axisPointer",n)},t.type="axisPointer",t}(Lt);function Gne(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=tf(a,e);if(o==null||o<0||ie(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 PH=Je();function C9e(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||pe(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){hb(i)&&(i=Gne({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=hb(i),u=a.axesInfo,c=s.axesInfo,f=n==="leave"||hb(i),h={},d={},v={list:[],map:{}},g={showPointer:Be(P9e,d),showTooltip:Be(L9e,v)};R(s.coordSysMap,function(y,_){var b=l||y.containPoint(i);R(s.coordSysAxesInfo[_],function(S,T){var A=S.axis,M=E9e(u,S);if(!f&&b&&(!u||M)){var P=M&&M.value;P==null&&!l&&(P=A.pointToData(i)),P!=null&&LH(S,P,g,!1,h)}})});var m={};return R(c,function(y,_){var b=y.linkGroup;b&&!d[_]&&R(b.axesInfo,function(S,T){var A=d[T];if(S!==y&&A){var M=A.value;b.mapper&&(M=y.axis.scale.parse(b.mapper(M,kH(S),kH(y)))),m[y.key]=M}})}),R(m,function(y,_){LH(c[_],y,g,!0,h)}),k9e(d,c,h),I9e(v,i,e,o),O9e(c,o,r),h}}function LH(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=M9e(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&re(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function M9e(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return R(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),R(h,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:i}}function P9e(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function L9e(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=Ly(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 k9e(e,t,r){var n=r.axesInfo=[];R(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 I9e(e,t,r,n){if(hb(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 O9e(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=PH(n)[i]||{},o=PH(n)[i]={};R(e,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&R(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];R(a,function(u,c){!o[c]&&l.push(u)}),R(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 E9e(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 kH(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 hb(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function b0(e){Cf.registerAxisPointerClass("CartesianAxisPointer",m9e),e.registerComponentModel(x9e),e.registerComponentView(A9e),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!ie(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=D6e(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},C9e)}function D9e(e){Ze(dre),Ze(b0)}var N9e=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=R9e[h](s,l,f,c);v.style=d,r.graphicKey=v.type,r.pointer=v}var g=a.get(["label","margin"]),m=j9e(n,i,a,l,g);Bne(r,i,a,o,m)},t}(uR);function j9e(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),Ua(h,h,[n.cx,n.cy]),u=Ga([o,-i],h);var d=t.getModel("axisLabel").get("rotate")||0,v=Hn.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 R9e={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:hR(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:TH(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:TH(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},B9e=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}(Qe),dR=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",tr).models[0]},t.type="polarAxis",t}(Qe);fr(dR,Uv);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}(dR),$9e=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}(dR),vR=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}(_a);vR.prototype.dataToRadius=_a.prototype.dataToCoord;vR.prototype.radiusToData=_a.prototype.coordToData;var F9e=Je(),pR=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=gT(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=F9e(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}(_a);pR.prototype.dataToAngle=_a.prototype.dataToCoord;pR.prototype.angleToData=_a.prototype.coordToData;var Wne=["radius","angle"],V9e=function(){function e(t){this.dimensions=Wne,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new vR,this._angleAxis=new pR,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=IH(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=IH(r);return i===this?this.pointToData(n):null},e}();function IH(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function G9e(e,t,r){var n=t.get("center"),i=jr(t,r).refContainer;e.cx=de(n[0],i.width)+i.x,e.cy=de(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%"]:ie(s)||(s=[0,s]);var l=[de(s[0],o),de(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function W9e(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();R(Aw(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),R(Aw(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),lf(n.scale,n.model),lf(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 H9e(e){return e.mainType==="angleAxis"}function OH(e,t){var r;if(e.type=t.get("type"),e.scale=p0(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),H9e(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 U9e={dimensions:Wne,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new V9e(i+"");a.update=W9e;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");OH(o,l),OH(s,u),G9e(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",tr).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},Z9e=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function w_(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 S_(e){var t=e.getRadiusAxis();return t.inverse?0:1}function EH(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 Y9e=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=Ce(c);var f=i.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(h),c});EH(u),EH(s),R(Z9e,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&X9e[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(Cf),X9e={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=S_(r),f=c?0:1,h,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new wf[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 Ev({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[S_(r)],u=se(n,function(c){return new yr({shape:w_(r,[l,l+s],c.coord)})});e.add(Ti(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[S_(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];Le(T)&&T.textStyle&&(d=new tt(T.textStyle,l,l.ecModel))}var A=new at({silent:Hn.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(A),Qs({el:A,componentModel:t,itemName:f.formattedLabel,formatterParamsExtra:{isTruncated:function(){return A.isTruncated},value:f.rawLabel,tickIndex:h}}),c){var M=Hn.makeAxisEventDataBase(t);M.targetType="axisLabel",M.value=f.rawLabel,De(A).eventData=M}},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",$=k;T&&(n[c][N]||(n[c][N]={p:k,n:k}),$=n[c][N][B]);var F=void 0,G=void 0,z=void 0,U=void 0;if(v.dim==="radius"){var H=v.dataToCoord(D)-k,Y=l.dataToCoord(N);Math.abs(H)=U})}}})}function tZe(e){var t={};R(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=Une(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=Hne(n);h[d]||f.autoWidthCount++,h[d]=h[d]||{width:0,maxWidth:0};var v=de(n.get("barWidth"),c),g=de(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 R(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=de(n.categoryGap,o),l=de(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),R(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=DH(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=DH(r);return i===this?this.pointToData(n):null},e}();function DH(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function fZe(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new cZe(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",tr).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var hZe={create:fZe,dimensions:Zne},NH=["x","y"],dZe=["width","height"],vZe=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=jM(l,1-Ww(s)),c=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var h=cR(a),d=pZe[f](s,c,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=mO(i);$ne(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=mO(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=fR(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=Ww(o),u=jM(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=jM(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}(uR),pZe={line:function(e,t,r){var n=hR([t,r[0]],[t,r[1]],Ww(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:Fne([t-n/2,r[0]],[n,i],Ww(e))}}};function Ww(e){return e.isHorizontal()?0:1}function jM(e,t){var r=e.getRect();return[r[NH[t]],r[NH[t]]+r[dZe[t]]]}var gZe=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}(Lt);function mZe(e){Ze(b0),Cf.registerAxisPointerClass("SingleAxisPointer",vZe),e.registerComponentView(gZe),e.registerComponentView(sZe),e.registerComponentModel(db),rv(e,"single",db,db.defaultOption),e.registerCoordinateSystem("single",hZe)}var yZe=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=Sf(r);e.prototype.init.apply(this,arguments),jH(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),jH(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:K.color.axisLine,width:1,type:"solid"}},itemStyle:{color:K.color.neutral00,borderWidth:1,borderColor:K.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:K.size.s,color:K.color.secondary},monthLabel:{show:!0,position:"start",margin:K.size.s,align:"center",formatter:null,color:K.color.secondary},yearLabel:{show:!0,position:null,margin:K.size.xl,formatter:null,color:K.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(Qe);function jH(e,t){var r=e.cellSize,n;ie(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=se([0,1],function(a){return $Be(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Fo(e,t,{type:"box",ignoreSize:i})}var xZe=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 on({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 ve(r)&&r?EBe(r,n):Ae(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||ve(s))&&(s&&(n=hI(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/RM)-Math.floor(r[0].time/RM)+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){d0({targetModel:a,coordSysType:"calendar",coordSysProvider:hJ})}),n},e.dimensions=["time","value"],e}();function BM(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function bZe(e){e.registerComponentModel(yZe),e.registerComponentView(xZe),e.registerCoordinateSystem("calendar",_Ze)}var cs={level:1,leaf:2,nonLeaf:3},Ls={none:0,all:1,body:2,corner:3};function yO(e,t,r){var n=t[Re[r]].getCell(e);return!n&&ot(e)&&e<0&&(n=t[Re[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function Yne(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 Xne(e,t,r,n,i){RH(e[0],t,i,r,n,0),RH(e[1],t,i,r,n,1)}function RH(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=ie(o)?o:[o],l=s.length,u=!!r;if(l>=1?(BH(e,t,s,u,i,a,0),l>1&&BH(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Re[1-a]].getLocatorCount(a),f=i[Re[a]].getLocatorCount(a)-1;r===Ls.body?c=gr(0,c):r===Ls.corner&&(f=Ii(-1,f)),f=t[0]&&e[0]<=t[1]}function FH(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 TZe(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 VH(e,t,r,n){var i=yO(t[n][0],r,n),a=yO(t[n][1],r,n);e[Re[n]]=e[Tr[n]]=NaN,i&&a&&(e[Re[n]]=i.xy,e[Tr[n]]=a.xy+a.wh-i.xy)}function Qp(e,t,r,n){return e[Re[t]]=r,e[Re[1-t]]=n,e}function AZe(e){return e&&(e.type===cs.leaf||e.type===cs.nonLeaf)?e:null}function Hw(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var GH=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=CZe(t);var n=r.get("data",!0);n!=null&&!ie(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&&R(u,function(d,v){var g;ve(d)?g={value:d}:Le(d)?(g=d,d.value!=null&&!ve(d.value)&&(g={value:null})):g={value:null};var m={type:cs.nonLeaf,ordinal:NaN,level:f,firstLeafLocator:c,id:new Ie,span:Qp(new Ie,r.dimIdx,1,1),option:g,xy:NaN,wh:NaN,dim:r,rect:Hw()};o++,(a[c]||(a[c]=[])).push(m),i[f]||(i[f]={type:cs.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[Re[r.dimIdx]]=_,h+=_,c+=_}),h}function l(){for(var u=[];n.length=1,b=r[Re[n]],S=a.getLocatorCount(n)-1,T=new Ul;for(o.resetLayoutIterator(T,n);T.next();)A(T.item);for(a.resetLayoutIterator(T,n);T.next();)A(T.item);function A(M){mn(M.wh)&&(M.wh=y),M.xy=b,M.id[Re[n]]===S&&!_&&(M.wh=r[Re[n]]+r[Tr[n]]-M.xy),b+=M.wh}}function qH(e,t){for(var r=t[Re[e]].resetCellIterator();r.next();){var n=r.item;Uw(n.rect,e,n.id,n.span,t),Uw(n.rect,1-e,n.id,n.span,t),n.type===cs.nonLeaf&&(n.xy=n.rect[Re[e]],n.wh=n.rect[Tr[e]])}}function KH(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;Uw(i,0,a,n,t),Uw(i,1,a,n,t)}})}function Uw(e,t,r,n,i){e[Tr[t]]=0;var a=r[Re[t]],o=a<0?i[Re[1-t]]:i[Re[t]],s=o.getUnitLayoutInfo(t,r[Re[t]]);if(e[Re[t]]=s.xy,e[Tr[t]]=s.wh,n[Re[t]]>1){var l=o.getUnitLayoutInfo(t,r[Re[t]]+n[Re[t]]-1);e[Tr[t]]=l.xy+l.wh-s.xy}}function zZe(e,t,r){var n=aw(e,r[Tr[t]]);return _O(n,r[Tr[t]])}function _O(e,t){return Math.max(Math.min(e,be(t,1/0)),0)}function FM(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var dn={inBody:1,inCorner:2,outside:3},lo={x:null,y:null,point:[]};function QH(e,t,r,n,i){var a=r[Re[t]],o=r[Re[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[Re[t]]=dn.outside;return}if(i===Ls.body){l?(e[Re[t]]=dn.inBody,f=Ii(s.xy+s.wh,gr(l.xy,f)),e.point[t]=f):e[Re[t]]=dn.outside;return}else if(i===Ls.corner){c?(e[Re[t]]=dn.inCorner,f=Ii(c.xy+c.wh,gr(u.xy,f)),e.point[t]=f):e[Re[t]]=dn.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[Re[t]]=dn.outside;return}f=v}e.point[t]=f,e[Re[t]]=h<=f&&f<=v?dn.inBody:d<=f&&f<=h?dn.inCorner:dn.outside}function JH(e,t,r,n){var i=1-r;if(e[Re[r]]!==dn.outside)for(n[Re[r]].resetCellIterator($M);$M.next();){var a=$M.item;if(t8(e.point[r],a.rect,r)&&t8(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Re[i]];return}}}function e8(e,t,r,n){if(e[Re[r]]!==dn.outside){var i=e[Re[r]]===dn.inCorner?n[Re[1-r]]:n[Re[r]];for(i.resetLayoutIterator(P_,r);P_.next();)if($Ze(e.point[r],P_.item)){t[r]=P_.item.id[Re[r]];return}}}function $Ze(e,t){return t.xy<=e&&e<=t.xy+t.wh}function t8(e,t,r){return t[Re[r]]<=e&&e<=t[Re[r]]+t[Tr[r]]}function FZe(e){e.registerComponentModel(kZe),e.registerComponentView(NZe),e.registerCoordinateSystem("matrix",BZe)}function VZe(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 r8(e,t){var r;return R(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function GZe(e,t,r){var n=re({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(He(i,n,!0),Fo(i,n,{ignoreSize:!0}),mJ(r,i),L_(r,i),L_(r,i,"shape"),L_(r,i,"style"),L_(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var Kne=["transition","enterFrom","leaveTo"],WZe=Kne.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function L_(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?Kne:WZe,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=kT(d,f,_,null,{hv:f.hv,boundingMode:f.bounding},b);if(!qi(d).isNew&&S){for(var T=f.transition,A={},M=0;M=0)?A[P]=k:d[P]=k}lt(d,A,r,0)}else d.attr(b)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){vb(i,qi(i).option,n,r._lastGraphicModel)}),this._elMap=_e()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Lt);function bO(e){var t=ye(n8,e)?n8[e]:gy(e),r=new t({});return qi(r).type=e,r}function i8(e,t,r,n){var i=bO(r);return t.add(i),n.set(e,i),qi(i).id=e,qi(i).isNew=!0,i}function vb(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){vb(a,t,r,n)}),UT(e,t,n),r.removeKey(qi(e).id))}function a8(e,t,r,n){e.isGroup||R([["cursor",va.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];ye(t,a)?e[a]=be(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),R(it(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=Ae(a)?a:null}}),ye(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function YZe(e){return e=re({},e),R(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(dJ),function(t){delete e[t]}),e}function XZe(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 qZe(e){e.registerComponentModel(UZe),e.registerComponentView(ZZe),e.registerPreprocessor(function(t){var r=t.graphic;ie(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var o8=["x","y","radius","angle","single"],KZe=["cartesian2d","polar","singleAxis"];function QZe(e){var t=e.get("coordinateSystem");return Ge(KZe,t)>=0}function El(e){return e+"Axis"}function JZe(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 Qne(e){var t=e.ecModel,r={infoList:[],infoMap:_e()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(El(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 VM=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}(),Ny=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=s8(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=s8(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;R([["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 R(o8,function(i){var a=this.getReferringComponents(El(i),mRe);if(a.specified){n=!0;var o=new VM;R(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 VM;if(h.add(f.componentIndex),r.set(c,h),a=!1,c==="x"||c==="y"){var d=f.getReferringComponents("grid",tr).models[0];d&&R(u,function(v){f.componentIndex!==v.componentIndex&&d===v.getReferringComponents("grid",tr).models[0]&&h.add(v.componentIndex)})}}}a&&R(o8,function(u){if(a){var c=i.findComponents({mainType:El(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new VM;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");R([["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(El(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){R(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(El(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;R([["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;R(["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 bh(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)}});bh(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;bh(["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=sN(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 nYe(e,t,r){var n=[1/0,-1/0];bh(r,function(o){b$e(n,o.getData(),t)});var i=e.getAxisModel(),a=Kee(i.axis.scale,i,n).calculate();return[a.min,a.max]}var iYe={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(El(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 rYe(i,a,s,e),r.push(o.__dzAxisProxy))});var n=_e();return R(r,function(i){R(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 aYe(e){e.registerAction("dataZoom",function(t,r){var n=JZe(r,t);R(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var u8=!1;function xR(e){u8||(u8=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,iYe),aYe(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function oYe(e){e.registerComponentModel(eYe),e.registerComponentView(tYe),xR(e)}var ea=function(){function e(){}return e}(),Jne={};function wh(e,t){Jne[e]=t}function eie(e){return Jne[e]}var sYe=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;R(this.option.feature,function(n,i){var a=eie(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:K.color.border,borderRadius:0,borderWidth:0,padding:K.size.m,itemSize:15,itemGap:K.size.s,showTitle:!0,iconStyle:{borderColor:K.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:K.color.accent50}},tooltip:{show:!1,position:"bottom"}},t}(Qe);function tie(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 lYe=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=[];R(u,function(_,b){f.push(b)}),new Vs(this._featureNames||[],f).add(h).update(h).remove(Be(h,null)).execute(),this._featureNames=f;function h(_,b){var S=f[_],T=f[b],A=u[S],M=new tt(A,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(A.title=a.newTitle),S&&!T){if(uYe(S))P={onclick:M.option.onclick,featureName:S};else{var k=eie(S);if(!k)return;P=new k}c[S]=P}else if(P=c[T],!P)return;P.uid=Bv("toolbox-feature"),P.model=M,P.ecModel=n,P.api=i;var I=P instanceof ea;if(!S&&T){I&&P.dispose&&P.dispose(n,i);return}if(!M.get("show")||I&&P.unusable){I&&P.remove&&P.remove(n,i);return}d(M,P,S),M.setIconStatus=function(O,D){var N=this.option,B=this.iconPaths;N.iconStatus=N.iconStatus||{},N.iconStatus[O]=D,B[O]&&(D==="emphasis"?$s:Fs)(B[O])},P instanceof ea&&P.render&&P.render(M,n,i,a)}function d(_,b,S){var T=_.getModel("iconStyle"),A=_.getModel(["emphasis","iconStyle"]),M=b instanceof ea&&b.getIcons?b.getIcons():_.get("icon"),P=_.get("title")||{},k,I;ve(M)?(k={},k[S]=M):k=M,ve(P)?(I={},I[S]=P):I=P;var O=_.iconPaths={};R(k,function(D,N){var B=jv(D,{},{x:-s/2,y:-s/2,width:s,height:s});B.setStyle(T.getItemStyle());var $=B.ensureState("emphasis");$.style=A.getItemStyle();var F=new at({style:{text:I[N],align:A.get("textAlign"),borderRadius:A.get("textBorderRadius"),padding:A.get("textPadding"),fill:null,font:kN({fontStyle:A.get("textFontStyle"),fontFamily:A.get("textFontFamily"),fontSize:A.get("textFontSize"),fontWeight:A.get("textFontWeight")},n)},ignore:!0});B.setTextContent(F),Qs({el:B,componentModel:r,itemName:N,formatterParamsExtra:{title:I[N]}}),B.__title=I[N],B.on("mouseover",function(){var G=A.getItemStyle(),z=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";F.setStyle({fill:A.get("textFill")||G.fill||G.stroke||K.color.neutral99,backgroundColor:A.get("textBackgroundColor")}),B.setTextConfig({position:A.get("textPosition")||z}),F.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){_.get(["iconStatus",N])!=="emphasis"&&i.leaveEmphasis(this),F.hide()}),(_.get(["iconStatus",N])==="emphasis"?$s:Fs)(B),o.add(B),B.on("click",pe(b.onclick,b,n,i,N)),O[N]=B})}var v=jr(r,i).refContainer,g=r.getBoxLayoutParams(),m=r.get("padding"),y=$t(g,v,m);Bc(r.get("orient"),o,r.get("itemGap"),y.width,y.height),kT(o,g,v,m),o.add(tie(o.getBoundingRect(),r)),l||o.eachChild(function(_){var b=_.__title,S=_.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),A=_.getTextContent(),M=A&&A.ensureState("emphasis");if(M&&!Ae(M)&&b){var P=M.style||(M.style={}),k=gT(b,at.makeFont(P)),I=_.x+o.x,O=_.y+o.y+s,D=!1;O+k.height>i.getHeight()&&(T.position="top",D=!0);var N=D?-5-k.height:s+10;I+k.width/2>i.getWidth()?(T.position=["100%",N],P.align="right"):I-k.width/2<0&&(T.position=[0,N],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){R(this._features,function(o){o instanceof ea&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){R(this._features,function(i){i instanceof ea&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){R(this._features,function(i){i instanceof ea&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(Lt);function uYe(e){return e.indexOf("my")===0}var cYe=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")||K.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 A=i.get("lang"),M='',P=window.open();P.document.write(M),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:K.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(ea),c8="__ec_magicType_stack__",fYe=[["line","bar"],["stack"]],hYe=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 R(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(f8[i]){var s={series:[]},l=function(f){var h=f.subType,d=f.id,v=f8[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(_,tr).models[0],S=b.componentIndex;s[_]=s[_]||[];for(var T=0;T<=S;T++)s[_][S]=s[_][S]||{};s[_][S].boundaryGap=i==="bar"}}};R(fYe,function(f){Ge(f,i)>=0&&R(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),f8={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")===c8;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),He({id:t,stack:i?"":c8},n.get(["option","stack"])||{},!0)}};Ka({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var ZT=new Array(60).join("-"),ov=" ";function dYe(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 vYe(e){var t=[];return R(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()];R(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(ov)],c=0;c=0)return!0}var wO=new RegExp("["+av+"]+","g");function yYe(e){for(var t=e.split(/\n+/g),r=Uw(t.shift()).split(wO),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 TYe(e){var t=_R(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return rie(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 AYe(e){nie(e).snapshots=null}function CYe(e){return _R(e).length}function _R(e){var t=nie(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var MYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){AYe(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);Ka({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var PYe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],bR=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=h8(r,t);R(LYe,function(o,s){(!n||!n.include||Ve(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=VM[n.brushType](0,a,i);n.__rangeOffset={offset:g8[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){R(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&R(a.coordSyses,function(o){var s=VM[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){R(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=VM[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?g8[n.brushType](a.values,o.offset,kYe(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:lne(i),isTargetByCursor:cne(i,t,n.coordSysModel),getLinearBrushOtherExtent:une(i)}})},e.prototype.controlSeries=function(t,r,n){var i=this.findTargetInfo(t,n);return i===!0||i&&Ve(i.coordSyses,r.coordinateSystem)>=0},e.prototype.findTargetInfo=function(t,r){for(var n=this._targetInfoList,i=h8(r,t),a=0;ae[1]&&e.reverse(),e}function h8(e,t){return ad(e,t,{includeMainTypes:PYe})}var LYe={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=_e(),o={},s={};!r&&!n&&!i||(R(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),R(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),R(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=[];R(u.getCartesians(),function(f,h){(Ve(r,f.getAxis("x").model)>=0||Ve(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:v8.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){R(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:v8.geo})})}},d8=[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}],v8={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Zl(e)),t}},VM={lineX:Be(p8,0),lineY:Be(p8,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=[SO([i[0],a[0]]),SO([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 p8(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=SO(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 g8={lineX:Be(m8,0),lineY:Be(m8,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 m8(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function kYe(e,t){var r=y8(e),n=y8(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 y8(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var TO=R,IYe=hRe("toolbox-dataZoom_"),OYe=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 Uj(i.getZr()),this._brushController.on("brush",pe(this._onBrush,this)).mount()),NYe(r,n,this,a,i),DYe(r,n)},t.prototype.onclick=function(r,n,i){EYe[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 bR(wR(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)}}),SYe(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=iu(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=[];TO(r,function(i,a){n.push(Ce(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:K.color.backgroundTint}};return n},t}(ea),EYe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(TYe(this.ecModel))}};function wR(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 DYe(e,t){e.setIconStatus("back",CYe(t)>1?"emphasis":"normal")}function NYe(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 bR(wR(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)}ZBe("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=wR(n),o=ad(e,a);TO(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),TO(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:IYe+u+f};h[c]=f,i.push(h)}return i});function jYe(e){e.registerComponentModel(sYe),e.registerComponentView(lYe),bh("saveAsImage",cYe),bh("magicType",hYe),bh("dataView",bYe),bh("dataZoom",OYe),bh("restore",MYe),Ze(oYe)}var RYe=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:K.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:K.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:K.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:K.color.tertiary,fontSize:14}},t}(Qe);function iie(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function aie(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 WYe(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?""+SR+i:",left"+i+",top"+i)),$Ye+":"+a}function x8(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;"+SR+":"+o+";":[["top",0],["left",0],[oie,o]]}function HYe(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),R(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function UYe(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=XJ(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(WYe(a,r,n)),o&&i.push("background-color:"+o),R(["width","color","radius"],function(v){var g="border-"+v,m=GN(g),y=e.get(m);y!=null&&i.push(g+":"+y+(v==="color"?"":"px"))}),i.push(HYe(f)),h!=null&&i.push("padding:"+Bv(h).join("px ")+"px"),i.join(";")+";"}function _8(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&INe(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 ZYe=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&&(ve(a)?document.querySelector(a):Qc(a)?a:Ae(a)&&a(t.getDom()));_8(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=FYe+UYe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+x8(a[0],a[1],!0)+("border-color:"+of(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(ve(a)&&n.get("trigger")==="item"&&!iie(n)&&(s=GYe(n,i,a)),ve(t))o.innerHTML=t+s;else if(t){o.innerHTML="",ie(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=S8(a,i);this._ticket="";var s=a.dataByCoordSys,l=eXe(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=XYe;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=Gne(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(S8(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=Jp([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;Cc(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=pe(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=Jp([n.tooltipOption],a),l=this._renderMode,u=[],c=Ar("section",{blocks:[],noHeader:!0}),f=[],h=new S2;R(r,function(x){R(x.dataByAxis,function(b){var S=i.getComponent(b.axisDim+"Axis",b.axisIndex),T=b.value;if(!(!S||T==null)){var A=zne(T,S.axis,i,b.seriesDataIndices,b.valueLabelOpt),M=Ar("section",{header:A,noHeader:!Ci(A),sortBlocks:!0,blocks:[]});c.blocks.push(M),R(b.seriesDataIndices,function(P){var k=i.getSeriesByIndex(P.seriesIndex),I=P.dataIndexInside,O=k.getDataParams(I);if(!(O.dataIndex<0)){O.axisDim=b.axisDim,O.axisIndex=b.axisIndex,O.axisType=b.axisType,O.axisId=b.axisId,O.axisValue=Sw(S.axis,{value:T}),O.axisValueLabel=A,O.marker=h.makeTooltipMarker("item",of(O.color),l);var D=zV(k.formatTooltip(I,!0,null)),N=D.frag;if(N){var B=Jp([k],a).get("valueFormatter");M.blocks.push(B?re({valueFormatter:B},N):N)}D.text&&f.push(D.text),u.push(O)}})}})}),c.blocks.reverse(),f.reverse();var d=n.position,v=s.get("order"),g=HV(c,h,l,v,i.get("useUTC"),s.get("textStyle"));g&&f.unshift(g);var m=l==="richText"?` +`),meta:t.meta}}function Zw(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function mYe(e){var t=e.slice(0,e.indexOf(` +`));if(t.indexOf(ov)>=0)return!0}var wO=new RegExp("["+ov+"]+","g");function yYe(e){for(var t=e.split(/\n+/g),r=Zw(t.shift()).split(wO),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 TYe(e){var t=_R(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return rie(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 AYe(e){nie(e).snapshots=null}function CYe(e){return _R(e).length}function _R(e){var t=nie(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var MYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){AYe(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);Ka({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var PYe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],bR=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=h8(r,t);R(LYe,function(o,s){(!n||!n.include||Ge(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=GM[n.brushType](0,a,i);n.__rangeOffset={offset:g8[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){R(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&R(a.coordSyses,function(o){var s=GM[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){R(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=GM[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?g8[n.brushType](a.values,o.offset,kYe(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:lne(i),isTargetByCursor:cne(i,t,n.coordSysModel),getLinearBrushOtherExtent:une(i)}})},e.prototype.controlSeries=function(t,r,n){var i=this.findTargetInfo(t,n);return i===!0||i&&Ge(i.coordSyses,r.coordinateSystem)>=0},e.prototype.findTargetInfo=function(t,r){for(var n=this._targetInfoList,i=h8(r,t),a=0;ae[1]&&e.reverse(),e}function h8(e,t){return od(e,t,{includeMainTypes:PYe})}var LYe={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=_e(),o={},s={};!r&&!n&&!i||(R(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),R(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),R(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=[];R(u.getCartesians(),function(f,h){(Ge(r,f.getAxis("x").model)>=0||Ge(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:v8.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){R(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:v8.geo})})}},d8=[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}],v8={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Yl(e)),t}},GM={lineX:Be(p8,0),lineY:Be(p8,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=[SO([i[0],a[0]]),SO([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 p8(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=SO(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 g8={lineX:Be(m8,0),lineY:Be(m8,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 m8(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function kYe(e,t){var r=y8(e),n=y8(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 y8(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var TO=R,IYe=hRe("toolbox-dataZoom_"),OYe=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 Uj(i.getZr()),this._brushController.on("brush",pe(this._onBrush,this)).mount()),NYe(r,n,this,a,i),DYe(r,n)},t.prototype.onclick=function(r,n,i){EYe[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 bR(wR(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)}}),SYe(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=au(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=[];TO(r,function(i,a){n.push(Ce(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:K.color.backgroundTint}};return n},t}(ea),EYe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(TYe(this.ecModel))}};function wR(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 DYe(e,t){e.setIconStatus("back",CYe(t)>1?"emphasis":"normal")}function NYe(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 bR(wR(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)}ZBe("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=wR(n),o=od(e,a);TO(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),TO(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:IYe+u+f};h[c]=f,i.push(h)}return i});function jYe(e){e.registerComponentModel(sYe),e.registerComponentView(lYe),wh("saveAsImage",cYe),wh("magicType",hYe),wh("dataView",bYe),wh("dataZoom",OYe),wh("restore",MYe),Ze(oYe)}var RYe=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:K.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:K.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:K.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:K.color.tertiary,fontSize:14}},t}(Qe);function iie(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function aie(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 WYe(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?""+SR+i:",left"+i+",top"+i)),$Ye+":"+a}function x8(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;"+SR+":"+o+";":[["top",0],["left",0],[oie,o]]}function HYe(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),R(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function UYe(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=XJ(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(WYe(a,r,n)),o&&i.push("background-color:"+o),R(["width","color","radius"],function(v){var g="border-"+v,m=GN(g),y=e.get(m);y!=null&&i.push(g+":"+y+(v==="color"?"":"px"))}),i.push(HYe(f)),h!=null&&i.push("padding:"+zv(h).join("px ")+"px"),i.join(";")+";"}function _8(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&INe(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 ZYe=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&&(ve(a)?document.querySelector(a):Jc(a)?a:Ae(a)&&a(t.getDom()));_8(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=FYe+UYe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+x8(a[0],a[1],!0)+("border-color:"+sf(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(ve(a)&&n.get("trigger")==="item"&&!iie(n)&&(s=GYe(n,i,a)),ve(t))o.innerHTML=t+s;else if(t){o.innerHTML="",ie(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=S8(a,i);this._ticket="";var s=a.dataByCoordSys,l=eXe(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=XYe;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=Gne(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(S8(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=eg([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;Mc(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=pe(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=eg([n.tooltipOption],a),l=this._renderMode,u=[],c=Ar("section",{blocks:[],noHeader:!0}),f=[],h=new T2;R(r,function(_){R(_.dataByAxis,function(b){var S=i.getComponent(b.axisDim+"Axis",b.axisIndex),T=b.value;if(!(!S||T==null)){var A=zne(T,S.axis,i,b.seriesDataIndices,b.valueLabelOpt),M=Ar("section",{header:A,noHeader:!Ci(A),sortBlocks:!0,blocks:[]});c.blocks.push(M),R(b.seriesDataIndices,function(P){var k=i.getSeriesByIndex(P.seriesIndex),I=P.dataIndexInside,O=k.getDataParams(I);if(!(O.dataIndex<0)){O.axisDim=b.axisDim,O.axisIndex=b.axisIndex,O.axisType=b.axisType,O.axisId=b.axisId,O.axisValue=Tw(S.axis,{value:T}),O.axisValueLabel=A,O.marker=h.makeTooltipMarker("item",sf(O.color),l);var D=zV(k.formatTooltip(I,!0,null)),N=D.frag;if(N){var B=eg([k],a).get("valueFormatter");M.blocks.push(B?re({valueFormatter:B},N):N)}D.text&&f.push(D.text),u.push(O)}})}})}),c.blocks.reverse(),f.reverse();var d=n.position,v=s.get("order"),g=HV(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=Jp([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),x=new S2;y.marker=x.makeTooltipMarker("item",of(y.color),d);var b=zV(u.formatTooltip(c,!1,f)),S=g.get("order"),T=g.get("valueFormatter"),A=b.frag,M=A?HV(T?re({valueFormatter:T},A):A,x,d,S,a.get("useUTC"),g.get("textStyle")):b.text,P="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,M,y,P,r.offsetX,r.offsetY,r.position,r.target,x)}),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(ve(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Ce(l),l.content=On(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=Jp(f,this._tooltipModel,d?{position:d}:null),g=v.get("content"),m=Math.random()+"",y=new S2;this._showOrMove(v,function(){var x=Ce(v.get("formatterParams")||{});this._showTooltipContent(v,g,x,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(ve(h)){var m=r.ecModel.get("useUTC"),y=ie(i)?i[0]:i,x=y&&y.axisType&&y.axisType.indexOf("time")>=0;d=h,x&&(d=f0(y.axisValue,d,m)),d=WN(d,i,!0)}else if(Ae(h)){var b=pe(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"||ie(n))return{color:a||o};if(!ie(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),Ae(n)&&(n=n([i,a],s,o.el,v,{viewSize:[u,c],contentSize:f.slice()})),ie(n))i=de(n[0],u),a=de(n[1],c);else if(Le(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(ve(n)&&l){var y=JYe(n,v,f,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=KYe(i,a,o,u,c,h?null:20,d?null:20);i=y[0],a=y[1]}if(h&&(i-=T8(h)?f[0]/2:h==="right"?f[0]:0),d&&(a-=T8(d)?f[1]/2:d==="bottom"?f[1]:0),iie(r)){var y=QYe(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&&R(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&R(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&&R(g,function(y,x){var b=m[x];o=o&&y.seriesIndex===b.seriesIndex&&y.dataIndex===b.dataIndex}),a&&R(h.seriesDataIndices,function(y){var x=y.seriesIndex,b=n[x],S=a[x];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()||(xy(this,"_updatePosition"),this._tooltipContent.dispose(),gO("itemTooltip",n))},t.type="tooltip",t}(Lt);function Jp(e,t,r){var n=t.ecModel,i;r?(i=new tt(r,n,n),i=new tt(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof tt&&(o=o.get("tooltip",!0)),ve(o)&&(o={formatter:o}),o&&(i=new tt(o,i,n)))}return i}function S8(e,t){return e.dispatchAction||pe(t.dispatchAction,t)}function KYe(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 QYe(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 JYe(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 T8(e){return e==="center"||e==="middle"}function eXe(e,t,r){var n=hN(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=kv(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 tXe(e){Ze(_0),e.registerComponentModel(RYe),e.registerComponentView(qYe),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},lr),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},lr)}var rXe=["rect","polygon","keep","clear"];function nXe(e,t){var r=Pt(e?e.brush:[]);if(r.length){var n=[];R(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;ie(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),iXe(s),t&&!s.length&&s.push.apply(s,rXe)}}function iXe(e){var t={};R(e,function(r){t[r]=1}),e.length=0,R(t,function(r,n){e.push(n)})}var A8=R;function C8(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function AO(e,t,r){var n={};return A8(t,function(a){var o=n[a]=i();A8(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=Ce(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 lie(e,t,r){var n;R(r,function(i){t.hasOwnProperty(i)&&C8(t[i])&&(n=!0)}),n&&R(r,function(i){t.hasOwnProperty(i)&&C8(t[i])?e[i]=Ce(t[i]):delete e[i]})}function aXe(e,t,r,n,i,a){var o={};R(e,function(f){var h=Hr.prepareVisualTypes(t[f]);o[f]=h});var s;function l(f){return ej(r,s,f)}function u(f,h){aee(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,x=m.length;yt[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&I8(t)}};function I8(e){return new Oe(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var dXe=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 Uj(n.getZr())).on("brush",pe(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){uie(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:Ce(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Ce(i),$from:n})},t.type="brush",t}(Lt),vXe=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&&lie(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 O8(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=O8(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:K.color.backgroundTint,borderColor:K.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:K.color.disabled},t}(Qe);function O8(e,t){return We({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new tt(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var pXe=["rect","polygon","lineX","lineY","keep","clear"],gXe=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,R(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 R(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:pXe.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 mXe(e){e.registerComponentView(dXe),e.registerComponentModel(vXe),e.registerPreprocessor(nXe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,lXe),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"},lr),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},lr),bh("brush",gXe)}var yXe=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:K.size.m,backgroundColor:K.color.transparent,borderColor:K.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:K.color.primary},subtextStyle:{fontSize:12,color:K.color.quaternary}},t}(Qe),xXe=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(){hw(v,"_"+r.get("target"))}),g&&d.on("click",function(){hw(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(),x=r.getBoxLayoutParams();x.width=y.width,x.height=y.height;var b=jr(r,i),S=zt(x,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 A=S.margin,M=r.getItemStyle(["color","opacity"]);M.fill=r.get("backgroundColor");var P=new Xe({shape:{x:y.x-A[3],y:y.y-A[0],width:y.width+A[1]+A[3],height:y.height+A[0]+A[2],r:r.get("borderRadius")},style:M,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(Lt);function _Xe(e){e.registerComponentModel(yXe),e.registerComponentView(xXe)}var E8=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=[],R(n,function(u,c){var f=Ir(Lv(u),""),h;Le(u)?(h=Ce(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 Dn([{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:K.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:K.color.secondary},data:[]},t}(Qe),cie=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=yu(E8.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:K.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:K.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:K.color.tertiary},itemStyle:{color:K.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:K.color.accent50,borderColor:K.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:K.color.accent50,borderColor:K.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:K.color.accent60},itemStyle:{color:K.color.accent60,borderColor:K.color.accent60},controlStyle:{color:K.color.accent70,borderColor:K.color.accent70}},progress:{lineStyle:{color:K.color.accent30},itemStyle:{color:K.color.accent40}},data:[]}),t}(E8);fr(cie,IT.prototype);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.type="timeline",t}(Lt),wXe=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}(_a),WM=Math.PI,D8=Je(),SXe=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 Ar("nameValue",{noName:!0,value:c})},R(["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=AXe(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:WM/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*WM/180;var x,b,S,T=h.get("position",!0),A=d&&h.get("showPlayBtn",!0),M=d&&h.get("showPrevBtn",!0),P=d&&h.get("showNextBtn",!0),k=0,I=f;T==="left"||T==="bottom"?(A&&(x=[0,0],k+=m),M&&(b=[k,0],k+=m),P&&(S=[I-v,0],I-=m)):(A&&(x=[I-v,0],I-=m),M&&(b=[0,0],k+=m),P&&(S=[I-v,0],I-=m));var O=[k,I];return r.get("inverse")&&O.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:x,prevBtnPosition:b,nextBtnPosition:S,axisExtent:O,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;Ua(s,s,[-l,-u]),qs(s,s,-WM/2),Ua(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=x(o),f=x(i.getBoundingRect()),h=x(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||ve(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 x(S){return[[S.x,S.x+S.width],[S.y,S.y+S.height]]}function b(S,T,A,M,P){S[M]+=A[M][P]-T[M][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=TXe(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 wXe("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 yr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:re({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new yr({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=[],R(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:pe(o._changeTimeline,o,u.value)},m=N8(f,h,n,g);m.ensureState("emphasis").style=d.getItemStyle(),m.ensureState("progress").style=v.getItemStyle(),Ul(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=[],R(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:pe(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),Ul(y),D8(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",pe(this._changeTimeline,this,f?"-":"+")),h(r.prevBtnPosition,"prev",pe(this._changeTimeline,this,f?"+":"-")),h(r.playPosition,c?"stop":"play",pe(this._handlePlayClick,this,!c),!0);function h(d,v,g,m){if(d){var y=Za(be(a.get(["controlStyle",v+"BtnSize"]),o),o),x=[0,-y/2,y,y],b=CXe(a,v+"Icon",x,{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),Ul(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=pe(u._handlePointerDrag,u),f.ondragend=pe(u._handlePointerDragend,u),j8(f,u._progressLine,s,i,a,!0)},onUpdate:function(f){j8(f,u._progressLine,s,i,a)}};this._currentPointer=N8(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=Mi(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(v)),[s,d]}var O_={min:Be(I_,"min"),max:Be(I_,"max"),average:Be(I_,"average"),median:Be(I_,"median")};function Ny(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!OXe(t)&&!ie(t.coord)&&ie(i)){var a=fie(t,r,n,e);if(t=Ce(t),t.type&&O_[t.type]&&a.baseAxis&&a.valueAxis){var o=Ve(i,a.baseAxis.dim),s=Ve(i,a.valueAxis.dim),l=O_[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||!ie(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&O_[t.type]){var c=n.getOtherAxis(u);c&&(t.value=Zw(r,r.mapDimension(c.dim),t.type))}}else for(var f=t.coord,h=0;h<2;h++)O_[f[h]]&&(f[h]=Zw(r,r.mapDimension(i[h]),f[h]));return t}}function fie(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(EXe(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 EXe(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function jy(e,t){return e&&e.containData&&t.coord&&!MO(t)?e.containData(t.coord):!0}function DXe(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!MO(t)&&!MO(r)?e.containZone(t.coord,r.coord):!0}function hie(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return Xl(o,t[a])}:function(r,n,i,a){return Xl(r.value,t[a])}}function Zw(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 HM=Je(),AR=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){HM(s).keep=!1}),n.eachSeries(function(s){var l=Go.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!HM(s).keep&&a.group.remove(s.group)}),NXe(n,o,this.type)},t.prototype.markKeep=function(r){HM(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;R(r,function(a){var o=Go.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?MQ(l):_N(l))})}})},t.type="marker",t}(Lt);function NXe(e,t,r){e.eachSeries(function(n){var i=Go.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=af(i),s=o.z,l=o.zlevel;MT(a.group,s,l)}})}function B8(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=de(l.get("x"),c)+h,m=de(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),x=e.get(n.dimensions[1],s);v=n.dataToPoint([y,x])}isNaN(g)||(v[0]=g),isNaN(m)||(v[1]=m),e.setItemLayout(s,v)})}var jXe=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=Go.getMarkerModelFromSeries(a,"markPoint");o&&(B8(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 g0),f=RXe(o,r,n);n.setData(f),B8(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"),x=d.getShallow("symbolKeepAspect");if(Ae(v)||Ae(g)||Ae(m)||Ae(y)){var b=n.getRawValue(h),S=n.getDataParams(h);Ae(v)&&(v=v(b,S)),Ae(g)&&(g=g(b,S)),Ae(m)&&(m=m(b,S)),Ae(y)&&(y=y(b,S))}var T=d.getModel("itemStyle").getItemStyle(),A=d.get("z2"),M=d0(l,"color");T.fill||(T.fill=M),f.setItemVisual(h,{z2:be(A,0),symbol:v,symbolSize:g,symbolRotate:m,symbolOffset:y,symbolKeepAspect:x,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}(AR);function RXe(e,t,r){var n;e?n=se(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return re(re({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new Dn(n,r),a=se(r.get("data"),Be(Ny,t));e&&(a=ht(a,Be(jy,e)));var o=hie(!!e,n);return i.initData(a,null,o),i}function BXe(e){e.registerComponentModel(IXe),e.registerComponentView(jXe),e.registerPreprocessor(function(t){TR(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}(Go),E_=Je(),$Xe=function(e,t,r,n){var i=e.getData(),a;if(ie(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=nn(n.yAxis,n.xAxis);else{var u=fie(n,i,t,e);s=u.valueAxis;var c=dj(i,u.valueDataDim);l=Zw(i,c,o)}var f=s.dim==="x"?0:1,h=1-f,d=Ce(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=[Ny(e,a[0]),Ny(e,a[1]),re({},a[2])];return m[2].type=m[2].type||null,We(m[2],m[0]),We(m[2],m[1]),m};function Yw(e){return!isNaN(e)&&!isFinite(e)}function z8(e,t,r,n){var i=1-e,a=n.dimensions[e];return Yw(t[i])&&Yw(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function FXe(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(z8(1,r,n,e)||z8(0,r,n,e)))return!0}return jy(e,t[0])&&jy(e,t[1])}function UM(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=de(o.get("x"),i.getWidth()),u=de(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(nu(a,"cartesian2d")){var d=a.getAxis("x"),v=a.getAxis("y"),c=a.dimensions;Yw(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):Yw(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 VXe=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=Go.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=E_(o).from,u=E_(o).to;l.each(function(c){UM(l,c,!0,a,i),UM(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 Wj);this.group.add(c.group);var f=GXe(o,r,n),h=f.from,d=f.to,v=f.line;E_(n).from=h,E_(n).to=d,n.setData(v);var g=n.get("symbol"),m=n.get("symbolSize"),y=n.get("symbolRotate"),x=n.get("symbolOffset");ie(g)||(g=[g,g]),ie(m)||(m=[m,m]),ie(y)||(y=[y,y]),ie(x)||(x=[x,x]),f.from.each(function(S){b(h,S,!0),b(d,S,!1)}),v.each(function(S){var T=v.getItemModel(S),A=T.getModel("lineStyle").getLineStyle();v.setItemLayout(S,[h.getItemLayout(S),d.getItemLayout(S)]);var M=T.get("z2");A.stroke==null&&(A.stroke=h.getItemVisual(S,"style").fill),v.setItemVisual(S,{z2:be(M,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:A})}),c.updateData(v),f.line.eachItemGraphicEl(function(S){De(S).dataModel=n,S.traverse(function(T){De(T).dataModel=n})});function b(S,T,A){var M=S.getItemModel(T);UM(S,T,A,r,a);var P=M.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=d0(l,"color")),S.setItemVisual(T,{symbolKeepAspect:M.get("symbolKeepAspect"),symbolOffset:be(M.get("symbolOffset",!0),x[A?0:1]),symbolRotate:be(M.get("symbolRotate",!0),y[A?0:1]),symbolSize:be(M.get("symbolSize"),m[A?0:1]),symbol:be(M.get("symbol",!0),g[A?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(AR);function GXe(e,t,r){var n;e?n=se(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return re(re({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new Dn(n,r),a=new Dn(n,r),o=new Dn([],r),s=se(r.get("data"),Be($Xe,t,e,r));e&&(s=ht(s,Be(FXe,e)));var l=hie(!!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 WXe(e){e.registerComponentModel(zXe),e.registerComponentView(VXe),e.registerPreprocessor(function(t){TR(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var HXe=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}(Go),D_=Je(),UXe=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=Ny(e,i),s=Ny(e,a),l=o.coord,u=s.coord;l[0]=nn(l[0],-1/0),l[1]=nn(l[1],-1/0),u[0]=nn(u[0],1/0),u[1]=nn(u[1],1/0);var c=cT([{},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 Xw(e){return!isNaN(e)&&!isFinite(e)}function $8(e,t,r,n){var i=1-e;return Xw(t[i])&&Xw(r[i])}function ZXe(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 nu(e,"cartesian2d")?r&&n&&($8(1,r,n)||$8(0,r,n))?!0:DXe(e,i,a):jy(e,i)||jy(e,a)}function F8(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=de(o.get(r[0]),i.getWidth()),u=de(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(nu(a,"cartesian2d")){var x=a.getAxis("x"),b=a.getAxis("y"),g=e.get(r[0],t),m=e.get(r[1],t);Xw(g)?s[0]=x.toGlobalCoord(x.getExtent()[r[0]==="x0"?0:1]):Xw(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 V8=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],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=Go.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=se(V8,function(f){return F8(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=XXe(o,r,n);n.setData(f),f.each(function(h){var d=se(V8,function(I){return F8(f,h,I,r,a)}),v=o.getAxis("x").scale,g=o.getAxis("y").scale,m=v.getExtent(),y=g.getExtent(),x=[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))];Mi(x),Mi(b);var S=!(m[0]>x[1]||m[1]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:K.size.m,align:"auto",backgroundColor:K.color.transparent,borderColor:K.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:K.color.disabled,inactiveBorderColor:K.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:K.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:K.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:K.color.tertiary,borderWidth:1,borderColor:K.color.border},emphasis:{selectorLabel:{show:!0,color:K.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(Qe),fh=Be,LO=R,N_=Me,die=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 N_),this.group.add(this._selectorGroup=new N_),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=tie(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)}),LO(n.getData(),function(v,g){var m=this,y=v.get("name");if(!this.newlineDisabled&&(y===""||y===` -`)){var x=new N_;x.newline=!0,u.add(x);return}var b=i.getSeriesByName(y)[0];if(!c.get(y))if(b){var S=b.getData(),T=S.getVisual("legendLineStyle")||{},A=S.getVisual("legendIcon"),M=S.getVisual("style"),P=this._createItem(b,y,g,v,n,r,T,M,A,f,a);P.on("click",fh(G8,y,null,a,d)).on("mouseover",fh(kO,b.name,null,a,d)).on("mouseout",fh(IO,b.name,null,a,d)),i.ssr&&P.eachChild(function(k){var I=De(k);I.seriesIndex=b.seriesIndex,I.dataIndex=g,I.ssrType="legend"}),h&&P.eachChild(function(k){m.packEventData(k,n,b,g,y)}),c.set(y,!0)}else i.eachRawSeries(function(k){var I=this;if(!c.get(y)&&k.legendVisualProvider){var O=k.legendVisualProvider;if(!O.containName(y))return;var D=O.indexOfName(y),N=O.getItemVisual(D,"style"),B=O.getItemVisual(D,"legendIcon"),$=En(N.fill);$&&$[3]===0&&($[3]=.2,N=re(re({},N),{fill:sa($,"rgba")}));var F=this._createItem(k,y,g,v,n,r,{},N,B,f,a);F.on("click",fh(G8,null,y,a,d)).on("mouseover",fh(kO,null,y,a,d)).on("mouseout",fh(IO,null,y,a,d)),i.ssr&&F.eachChild(function(G){var z=De(G);z.seriesIndex=k.seriesIndex,z.dataIndex=g,z.ssrType="legend"}),h&&F.eachChild(function(G){I.packEventData(G,n,k,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();LO(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}),Ul(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"),x=a.get("symbolKeepAspect"),b=a.get("icon");c=b||c||"roundRect";var S=QXe(c,a,l,u,d,m,h),T=new N_,A=a.getModel("textStyle");if(Ae(r.getLegendIcon)&&(!b||b==="inherit"))T.add(r.getLegendIcon({itemWidth:v,itemHeight:g,icon:c,iconRotate:y,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:x}));else{var M=b==="inherit"&&r.getData().getVisual("symbol")?y==="inherit"?r.getData().getVisual("symbolRotate"):y:0;T.add(JXe({itemWidth:v,itemHeight:g,icon:c,iconRotate:M,itemStyle:S.itemStyle,symbolKeepAspect:x}))}var P=s==="left"?v+5:-5,k=s,I=o.get("formatter"),O=n;ve(I)&&I?O=I.replace("{name}",n??""):Ae(I)&&(O=I(n));var D=m?A.getTextColor():a.get("inactiveColor");T.add(new at({style:Mt(A,{text:O,x:P,y:g/2,fill:D,align:k,verticalAlign:"middle"},{inheritColor:D})}));var N=new Xe({shape:T.getBoundingRect(),style:{fill:"transparent"}}),B=a.getModel("tooltip");return B.get("show")&&Qs({el:N,componentModel:o,itemName:n,itemTooltipOption:B.option}),T.add(N),T.eachChild(function($){$.silent=!0}),N.silent=!f,this.getContentGroup().add(T),Ul(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Rc(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){Rc("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",x=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[x]=Math.min(0,h[x]+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}(Lt);function QXe(e,t,r,n,i,a,o){function s(m,y){m.lineWidth==="auto"&&(m.lineWidth=y.lineWidth>0?2:0),LO(m,function(x,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:Kd(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 JXe(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=K.color.neutral00,r.style.lineWidth=2),r}function G8(e,t,r,n){IO(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),kO(e,t,r,n)}function vie(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],x=[-v.x,-v.y],b=be(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(g){var S=r.get("pageButtonPosition",!0);S==="end"?x[a]+=i[o]-v[o]:y[a]+=v[o]+b}x[1-a]+=d[s]/2-v[s]/2,c.setPosition(m),f.setPosition(y),h.setPosition(x);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]+x[1-a]),f.__rectSize=i[o],g){var A={x:0,y:0};A[o]=Math.max(i[o]-v[o]-b,0),A[s]=T[s],f.setClipPath(new Xe({shape:A})),f.__rectSize=A[o]}else h.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var M=this._getPageInfo(r);return M.pageIndex!=null&<(c,{x:M.contentPosition[0],y:M.contentPosition[1]},g?r:null),this._updatePageInfoView(r,M),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;R(["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",ve(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=ZM[o],l=YM[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,x=g,b=null;m<=h;++m)b=S(c[m]),(!b&&x.e>y.s+a||b&&!T(b,y.s))&&(x.i>y.i?y=x:y=b,y&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=y.i),++v.pageCount)),x=b;for(var m=u-1,y=g,x=g,b=null;m>=-1;--m)b=S(c[m]),(!b||!T(x,b.s))&&y.i=M&&A.s<=M+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}(die);function iqe(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 aqe(e){Ze(pie),e.registerComponentModel(rqe),e.registerComponentView(nqe),iqe(e)}function oqe(e){Ze(pie),Ze(aqe)}var sqe=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=yu(Dy.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Dy),CR=Je();function lqe(e,t,r){CR(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function uqe(e,t){for(var r=CR(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 vqe(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=CR(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=_e());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=Qne(a);R(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,cqe(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){gie(i,a);return}var c=dqe(l,a,r);o.enable(c.controlType,c.opt),Fv(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var pqe=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(),lqe(i,r,{pan:pe(XM.pan,this),zoom:pe(XM.zoom,this),scrollMove:pe(XM.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){uqe(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(yR),XM={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=qM[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(iu(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Z8(function(e,t,r,n,i,a){var o=qM[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:Z8(function(e,t,r,n,i,a){var o=qM[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function Z8(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(iu(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var qM={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 mie(e){xR(e),e.registerComponentModel(sqe),e.registerComponentView(pqe),vqe(e)}var 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.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=yu(Dy.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:K.color.accent10,borderRadius:0,backgroundColor:K.color.transparent,dataBackground:{lineStyle:{color:K.color.accent30,width:.5},areaStyle:{color:K.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:K.color.accent40,width:.5},areaStyle:{color:K.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:K.color.neutral00,borderColor:K.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:K.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:K.color.tertiary},brushSelect:!0,brushStyle:{color:K.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:K.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(Dy),rg=Xe,mqe=1,KM=30,yqe=7,ng="horizontal",Y8="vertical",xqe=5,_qe=["line","bar","candlestick","scatter"],bqe={easing:"cubicOut",duration:100,delay:0},wqe=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=pe(this._onBrush,this),this._onBrushEnd=pe(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),Fv(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(){xy(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?yqe:0,o=jr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===ng?{right:o.width-s.x-s.width,top:o.height-KM-l-a,width:s.width,height:KM}:{right:l,top:s.y,width:KM,height:s.height},c=wf(r.option);R(["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===Y8&&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===ng&&!o?{scaleY:l?1:-1,scaleX:1}:i===ng&&o?{scaleY:l?1:-1,scaleX:-1}:i===Y8&&!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 rg({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new rg({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:pe(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=[],x=g[1]/Math.max(1,o.count()-1),b=n[0]/(f[1]-f[0]),S=r.thisAxis.type==="time",T=-x,A=Math.round(o.count()/n[0]),M;o.each([r.thisDim,l],function(D,N,B){if(A>0&&B%A){S||(T+=x);return}T=S?(+D-f[0])*b:T+x;var $=N==null||isNaN(N)||N==="",F=$?0:gt(N,h,v,!0);$&&!M&&B?(m.push([m[m.length-1][0],0]),y.push([y[y.length-1][0],0])):!$&&M&&(m.push([T,0]),y.push([T,0])),$||(m.push([T,F]),y.push([T,F])),M=$}),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 k(D){var N=P.getModel(D?"selectedDataBackground":"dataBackground"),B=new Me,$=new wn({shape:{points:u},segmentIgnoreThreshold:1,style:N.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),F=new on({shape:{points:c},segmentIgnoreThreshold:1,style:N.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return B.add($),B.add(F),B}for(var I=0;I<3;I++){var O=k(I===1);this._displayables.sliderGroup.add(O),this._displayables.dataShadowSegs.push(O)}},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();R(l,function(u){if(!i&&!(n!==!0&&Ve(_qe,u.get("type"))<0)){var c=a.getComponent(Ol(o),s).axis,f=Sqe(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 rg({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new rg({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:mqe,fill:K.color.transparent}})),R([0,1],function(b){var S=l.get("handleIcon");!pw[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:Tqe(this._orient),draggable:!0,drift:pe(this._onDragMove,this,b),ondragend:pe(this._onDragEnd,this),onmouseover:pe(this._showDataInfo,this,!0),onmouseout:pe(this._showDataInfo,this,!1),z2:5});var A=T.getBoundingRect(),M=l.get("handleSize");this._handleHeight=de(M,this._size[1]),this._handleWidth=A.width/A.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(),Ul(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[b]=T);var k=l.getModel("textStyle"),I=l.get("handleLabel")||{},O=I.show||!1;r.add(a[b]=new at({silent:!0,invisible:!O,style:Mt(k,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:k.getTextColor(),font:k.getFont()}),z2:10}))},this);var d=h;if(f){var v=de(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,K.color.neutral00,!0);y.silent=!0,y.y=s[1]+v/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var x=Math.min(s[1]/2,Math.max(v,10));d=n.moveZone=new Xe({invisible:!0,shape:{y:s[1]-x,height:v+x}}),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:pe(this._onDragMove,this,"all"),ondragstart:pe(this._showDataInfo,this,!0),ondragend:pe(this._onDragEnd,this),onmouseover:pe(this._showDataInfo,this,!0),onmouseout:pe(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];iu(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=Mi([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=Mi(i.slice()),o=this._size;R([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();iu(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=Mi([gt(l[0],o,s,!0),gt(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(zs(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 rg({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?bqe:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=Qne(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}(yR);function Sqe(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function Tqe(e){return e==="vertical"?"ns-resize":"ew-resize"}function yie(e){e.registerComponentModel(gqe),e.registerComponentView(wqe),xR(e)}function Aqe(e){Ze(mie),Ze(yie)}var xie={get:function(e,t,r){var n=Ce((Cqe[e]||{})[t]);return r&&ie(n)?n[n.length-1]:n}},Cqe={color:{active:["#006edd","#e0ffff"],inactive:[K.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]}},X8=Hr.mapVisual,Mqe=Hr.eachVisual,Pqe=ie,q8=R,Lqe=Mi,kqe=gt,qw=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&&lie(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=pe(r,this),this.controllerVisuals=AO(this.option.controller,n,r),this.targetVisuals=AO(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=kv(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){R(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||["<",">"],ie(r)&&(r=r.slice(),u=!0);var c=n?r:u?[f(r[0]),f(r[1])]:f(r);if(ve(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(Ae(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=Lqe([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={});We(a,i),We(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){Pqe(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]={},q8(v,function(m,y){if(Hr.isValidType(y)){var x=xie.get(y,"inactive",s);x!=null&&(g[y]=x,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";q8(this.stateList,function(y){var x=this.itemSize,b=f[y];b||(b=f[y]={color:s?v:[v]}),b.symbol==null&&(b.symbol=h&&Ce(h)||(s?m:[m])),b.symbolSize==null&&(b.symbolSize=d&&Ce(d)||(s?x[0]:[x[0],x[0]])),b.symbol=X8(b.symbol,function(A){return A==="none"?m:A});var S=b.symbolSize;if(S!=null){var T=-1/0;Mqe(S,function(A){A>T&&(T=A)}),b.symbolSize=X8(S,function(A){return kqe(A,[0,T],[0,x[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:K.color.transparent,borderColor:K.color.borderTint,contentColor:K.color.theme[0],inactiveColor:K.color.disabled,borderWidth:0,padding:K.size.m,textGap:10,precision:0,textStyle:{color:K.color.secondary}},t}(Qe),K8=[20,140],Iqe=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]=K8[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=K8[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):ie(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),R(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=Mi((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=Q8(this,"outOfRange",this.getExtent()),i=Q8(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);Oqe([0,1],function(f){var h=o[f];h.setStyle("fill",n.handlesColor[f]),h.y=r[f];var d=fo(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=Ga(i.handleLabelPoints[f],Zl(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=fo(r,s,u,!0),m=l[0]-v/2,y={x:f.x,y:f.y};f.y=g,f.x=m;var x=Ga(c.indicatorLabelPoint,Zl(f,this.group)),b=c.indicatorLabel;b.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,A=T==="horizontal";b.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:A?S:"middle",align:A?"center":S});var M={x:m,y:g,style:{fill:d}},P={style:{x:x[0],y:x[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var k={duration:100,easing:"cubicInOut",additive:!0};f.x=y.x,f.y=y.y,f.animateTo(M,k),b.animateTo(P,k)}else f.attr(M),b.attr(P);this._firstShowIndicator=!1;var I=this._shapes.handleLabels;if(I)for(var O=0;Oo[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||rU(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var v=pRe(h,d);this._dispatchHighDown("downplay",vb(v[0],i)),this._dispatchHighDown("highlight",vb(v[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(Cc(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 $qe(e,t,r,n){for(var i=t.targetVisuals[n],a=Hr.prepareVisualTypes(i),o={color:d0(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(Rqe,Bqe),R(zqe,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(Fqe))}function Sie(e){e.registerComponentModel(Iqe),e.registerComponentView(Nqe),wie(e)}var Vqe=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=[],Gqe[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=Ce(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=se(this._pieceList,function(l){return l=Ce(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=Hr.listVisualTypes(),a=this.isCategory();R(r.pieces,function(s){R(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),R(n,function(s,l){var u=!1;R(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&R(this.stateList,function(c){(r[c]||(r[c]={}))[l]=xie.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,R(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;R(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=Ce(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 R(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=yu(qw.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}(qw),Gqe={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 oU(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var Wqe=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=nn(n.get("showLabel",!0),!u),f=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),R(l.viewPieceList,function(h){var d=h.piece,v=new Me;v.onclick=pe(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),Rc(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:vb(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return bie(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=Ce(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,R(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}(_ie);function Tie(e){e.registerComponentModel(Vqe),e.registerComponentView(Wqe),wie(e)}function Hqe(e){Ze(Sie),Ze(Tie)}var Uqe=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:YQ(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}(),Zqe=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 Uqe(this);if(this._target=null,this.ecModel.eachSeries(function(i){IW(i,null)}),this.shouldShow()){var n=this.getTarget();IW(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:K.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:K.color.neutral30,borderColor:K.color.neutral40,opacity:.3},z:10},t}(Qe),Yqe=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 Mf),!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")||K.color.neutral00);var l=jr(r,i).refContainer,u=zt(vJ(r,!0),l),c=s.lineWidth||0,f=this._contentRect=nf(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(),lU(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),lU(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=da([],r.targetTrans),i=Fa([],this._coordSys.transform,n);this._transThisToTarget=da([],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 Cf(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",pe(this._onPan,this)).on("zoom",pe(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=ur([],[r.oldX,r.oldY],n),a=ur([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(sU(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=ur([],[r.originX,r.originY],n);this._api.dispatchAction(sU(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}(Lt);function sU(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,re(n,t),n}function lU(e,t){var r=af(e);MT(t.group,r.z,r.zlevel)}function Xqe(e){e.registerComponentModel(Zqe),e.registerComponentView(Yqe)}var qqe={label:{enabled:!0},decal:{show:!1}},uU=Je(),Kqe={};function Qqe(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=Ce(qqe);We(n.label,e.getLocaleModel().get("aria"),!1),We(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)),uU(h).scope=d}}),e.eachRawSeries(function(h){if(e.isSeriesFiltered(h))return;if(Ae(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var x=mI(h.ecModel,h.name,Kqe,e.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",S(b,x))}else{var v=h.getRawData(),g={},m=uU(h).scope;d.each(function(T){var A=d.getRawIndex(T);g[A]=T});var y=v.count();v.each(function(T){var A=g[T],M=v.getName(T)||T+"",P=mI(h.ecModel,M,m,y),k=d.getItemVisual(A,"decal");d.setItemVisual(A,"decal",S(k,P))})}function S(T,A){var M=T?re(re({},A),T):A;return M.dirty=!0,M}})}}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 x=f.get(["general","withTitle"]);m=o(x,{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,k){if(k1?f.get(["series","multiple",D]):f.get(["series","single",D]),I=o(I,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var N=P.getData();if(N.count()>d){var B=f.get(["data","partialData"]);I+=o(B,{displayCnt:d})}else I+=f.get(["data","allData"]);for(var $=f.get(["data","separator","middle"]),F=f.get(["data","separator","end"]),G=f.get(["data","excludeDimensionId"]),z=[],U=0;U":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},tKe=function(){function e(t){var r=this._condVal=ve(t)?new RegExp(t):yK(t)?t:null;if(r==null){var n="";mt(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return ve(r)?this._condVal.test(t):ot(r)?this._condVal.test(t+""):!1},e}(),rKe=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),nKe=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[N,B]}function c(N,B,$,F){Gh(N,$)&&Gh(B,F)||i.push(N,B,$,F,$,F)}function f(N,B,$,F,G,z){var U=Math.abs(B-N),H=Math.tan(U/4)*4/3,Y=BP:O2&&n.push(i),n}function EO(e,t,r,n,i,a,o,s,l,u){if(Gh(e,r)&&Gh(t,n)&&Gh(i,o)&&Gh(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,x=a-s,b=g*g+m*m,S=y*y+x*x;if(b=0&&P=0){l.push(o,s);return}var k=[],I=[];tu(e,r,i,o,.5,k),tu(t,n,a,s,.5,I),EO(k[0],I[0],k[1],I[1],k[2],I[2],k[3],I[3],l,u),EO(k[4],I[4],k[5],I[5],k[6],I[6],k[7],I[7],l,u)}function mKe(e,t){var r=OO(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),f=Cie([l,u],c?0:1,t),h=(c?s:u)/f.length,d=0;di,o=Cie([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 _Ke(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 dh(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function bKe(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),bKe(t,u,c)}function Kw(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);Kw(e,a[0],i,n),Kw(e,a[1],r-i,n)}return n}function wKe(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 eS(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:IKe(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 Lie(e){return AKe(e.path,e.count)}function DO(){return{fromIndividuals:[],toIndividuals:[],count:0}}function OKe(e,t,r){var n=[];function i(T){for(var A=0;A=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 DKe={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;yU(e)&&(u=e,c=t),yU(t)&&(u=t,c=e);function f(y,x,b,S,T){var A=y.many,M=y.one;if(A.length===1&&!T){var P=x?A[0]:M,k=x?M:A[0];if(Qw(P))f({many:[P],one:k},!0,b,S,!0);else{var I=s?Pe({delay:s(b,S)},l):l;PR(P,k,I),a(P,k,P,k,I)}}else for(var O=Pe({dividePath:DKe[r],individualDelay:s&&function(G,z,U,H){return s(G+b,S)}},l),D=x?OKe(A,M,O):EKe(M,A,O),N=D.fromIndividuals,B=D.toIndividuals,$=N.length,F=0;F<$;F++){var I=s?Pe({delay:s(F,$)},l):l;a(N[F],B[F],x?A[F]:y.one,x?y.one:A[F],I)}}for(var h=u?u===e:e.length>t.length,d=u?xU(c,u):xU(h?t:e,[h?e:t]),v=0,g=0;gkie))for(var a=n.getIndices(),o=0;o0&&A.group.traverse(function(P){P instanceof rt&&!P.animators.length&&P.animateFrom({style:{opacity:0}},M)})})}function TU(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function AU(e){return ie(e)?e.sort().join(","):e}function yl(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function FKe(e,t){var r=_e(),n=_e(),i=_e();return R(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=TU(a),c=AU(u);n.set(c,{dataGroupId:s,data:l}),ie(u)&&R(u,function(f){i.set(f,{key:c,dataGroupId:s,data:l})})}),R(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=TU(a),u=AU(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:yl(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:yl(s),data:s}]});else if(ie(l)){var f=[];R(l,function(v){var g=n.get(v);g.data&&f.push({dataGroupId:g.dataGroupId,divide:yl(g.data),data:g.data})}),f.length&&r.set(u,{oldSeries:f,newSeries:[{dataGroupId:o,data:s,divide:yl(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:yl(h.data)}],newSeries:[]},r.set(h.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:yl(s)})}}}}),r}function CU(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:yl(t.oldData[s]),groupIdDim:o.dimension})}),R(Pt(e.to),function(o){var s=CU(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:yl(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&Iie(i,a,n)}function GKe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){R(Pt(n.seriesTransition),function(i){R(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=MU,n=PU,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 HKe(){return new WKe}var MU=0,PU=0;function UKe(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()}};R(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=LR(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));R(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 ZKe(e,t,r,n,i,a){e!=="no"&&R(r,function(o){var s=LR(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}R(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:Ce(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(ve(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&&R(["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 R(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function kR(e,t){return jO(t)===jO(e)}function jO(e){return e.start+"_\0_"+e.end}function XKe(e,t,r){var n=[];R(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),R(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=pu(n,function(u){return kR(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return R(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function qKe(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=pu(r,function(f){return kR(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"?mr(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 KKe(e,t,r){var n={noNegative:!0},i=NO(e,r,n),a=NO(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 QKe={vmin:"start",vmax:"end"};function JKe(e,t){return t&&(e=e||{},e.break={type:QKe[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function eQe(){wBe({createScaleBreakContext:HKe,pruneTicksByBreak:ZKe,addBreaksToTicks:YKe,parseAxisBreakOption:NO,identifyAxisBreak:kR,serializeAxisBreakIdentifier:jO,retrieveAxisBreakPairs:XKe,getTicksLogTransformBreak:qKe,logarithmicParseBreaksFromOption:KKe,makeAxisLabelFormatterParamBreak:JKe})}var LU=Je();function tQe(e,t){var r=pu(e,function(n){return Sr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function rQe(e){R(e,function(t){return t.shouldRemove=!0})}function nQe(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function iQe(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(k){return k.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,x=v.fill,b=new Me({ignoreModelZ:!0}),S=a.isHorizontal(),T=LU(t).visualList||(LU(t).visualList=[]);rQe(T);for(var A=function(k){var I=o[k][0].break.parsedBreak,O=[];O[0]=a.toGlobalCoord(a.dataToCoord(I.vmin,!0)),O[1]=a.toGlobalCoord(a.dataToCoord(I.vmax,!0)),O[1]=z;ge&&(J=z);var Ge=[],xe=[];Ge[F]=O,xe[F]=D,!ce&&!ge&&(Ge[F]+=Z?-l:l,xe[F]-=Z?l:-l),Ge[G]=J,xe[G]=J,H.push(Ge),Y.push(xe);var ne=void 0;if(aex[1]&&x.reverse(),{coordPair:x,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),RI(r[0],m),RI(r[1],y)}function sQe(e,t){var r={breaks:[]};return R(t.breaks,function(n){if(n){var i=pu(e.get("breaks",!0),function(s){return Sr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===BT?!0:a===Qte?!1:a===Jte?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function lQe(){n6e({adjustBreakLabelPair:oQe,buildAxisBreakLine:aQe,rectCoordBuildBreakAxis:iQe,updateModelAxisBreak:sQe})}function uQe(e){u6e(e),eQe(),lQe()}function cQe(){k6e(fQe)}function fQe(e,t){R(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=hQe(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 hQe(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof Qd?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=Wv(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 LQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function kQe(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function IQe({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=>OU.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(x=>{const b=LQe(x.latitude),S=IU[b%IU.length],T=OU.includes(x.role),A=x.node_num===r,M=f.has(x.node_num),P=r===null||A||M;return{id:String(x.node_num),name:x.short_name,value:x.node_num,symbolSize:kQe(x.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:x.node_num,longName:x.long_name,role:x.role}}),y=c.map(x=>{const b=r===null||x.from_node===r||x.to_node===r;return{source:String(x.from_node),target:String(x.to_node),value:x.snr,lineStyle:{color:PQe(x.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]),_.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[_.jsx(MQe,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:g,opts:{renderer:"canvas"}}),_.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:[_.jsx(FE,{size:14,className:"text-slate-500"}),_.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:m,label: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:y},m))}),_.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes • ",c.length," edges"]})]}),_.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[_.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),_.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=>_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:m.color}}),_.jsx("span",{className:"text-xs text-slate-500",children:m.label})]},m.label))})]}),_.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[_.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),_.jsxs("div",{className:"space-y-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),_.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-blue-500"}),_.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function Die(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 OQe(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const EQe=1;function DQe(e){return Object.freeze({__version:EQe,map:e})}function Nie(e,t){return Object.freeze({...e,...t})}const jie=W.createContext(null),Rie=jie.Provider;function qT(){const e=W.useContext(jie);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function NQe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return W.useImperativeHandle(n,()=>i),r.children==null?null:Q.createElement(Rie,{value:a},r.children)}return W.forwardRef(t)}function jQe(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?tZ.createPortal(r.children,s):null}return W.forwardRef(t)}function RQe(e){function t(r,n){const{instance:i}=e(r).current;return W.useImperativeHandle(n,()=>i),null}return W.forwardRef(t)}function DR(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 KT(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function BQe(e,t){return function(n,i){const a=qT(),o=e(KT(n,a),a);return Die(a.map,n.attribution),DR(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var zO={exports:{}};/* @preserve +`:"
",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=eg([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 T2;y.marker=_.makeTooltipMarker("item",sf(y.color),d);var b=zV(u.formatTooltip(c,!1,f)),S=g.get("order"),T=g.get("valueFormatter"),A=b.frag,M=A?HV(T?re({valueFormatter:T},A):A,_,d,S,a.get("useUTC"),g.get("textStyle")):b.text,P="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,M,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(ve(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Ce(l),l.content=On(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=eg(f,this._tooltipModel,d?{position:d}:null),g=v.get("content"),m=Math.random()+"",y=new T2;this._showOrMove(v,function(){var _=Ce(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(ve(h)){var m=r.ecModel.get("useUTC"),y=ie(i)?i[0]:i,_=y&&y.axisType&&y.axisType.indexOf("time")>=0;d=h,_&&(d=h0(y.axisValue,d,m)),d=WN(d,i,!0)}else if(Ae(h)){var b=pe(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"||ie(n))return{color:a||o};if(!ie(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),Ae(n)&&(n=n([i,a],s,o.el,v,{viewSize:[u,c],contentSize:f.slice()})),ie(n))i=de(n[0],u),a=de(n[1],c);else if(Le(n)){var g=n;g.width=f[0],g.height=f[1];var m=$t(g,{width:u,height:c});i=m.x,a=m.y,h=null,d=null}else if(ve(n)&&l){var y=JYe(n,v,f,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=KYe(i,a,o,u,c,h?null:20,d?null:20);i=y[0],a=y[1]}if(h&&(i-=T8(h)?f[0]/2:h==="right"?f[0]:0),d&&(a-=T8(d)?f[1]/2:d==="bottom"?f[1]:0),iie(r)){var y=QYe(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&&R(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&R(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&&R(g,function(y,_){var b=m[_];o=o&&y.seriesIndex===b.seriesIndex&&y.dataIndex===b.dataIndex}),a&&R(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()||(_y(this,"_updatePosition"),this._tooltipContent.dispose(),gO("itemTooltip",n))},t.type="tooltip",t}(Lt);function eg(e,t,r){var n=t.ecModel,i;r?(i=new tt(r,n,n),i=new tt(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof tt&&(o=o.get("tooltip",!0)),ve(o)&&(o={formatter:o}),o&&(i=new tt(o,i,n)))}return i}function S8(e,t){return e.dispatchAction||pe(t.dispatchAction,t)}function KYe(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 QYe(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 JYe(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 T8(e){return e==="center"||e==="middle"}function eXe(e,t,r){var n=hN(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=Iv(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 tXe(e){Ze(b0),e.registerComponentModel(RYe),e.registerComponentView(qYe),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},lr),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},lr)}var rXe=["rect","polygon","keep","clear"];function nXe(e,t){var r=Pt(e?e.brush:[]);if(r.length){var n=[];R(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;ie(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),iXe(s),t&&!s.length&&s.push.apply(s,rXe)}}function iXe(e){var t={};R(e,function(r){t[r]=1}),e.length=0,R(t,function(r,n){e.push(n)})}var A8=R;function C8(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function AO(e,t,r){var n={};return A8(t,function(a){var o=n[a]=i();A8(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=Ce(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 lie(e,t,r){var n;R(r,function(i){t.hasOwnProperty(i)&&C8(t[i])&&(n=!0)}),n&&R(r,function(i){t.hasOwnProperty(i)&&C8(t[i])?e[i]=Ce(t[i]):delete e[i]})}function aXe(e,t,r,n,i,a){var o={};R(e,function(f){var h=Hr.prepareVisualTypes(t[f]);o[f]=h});var s;function l(f){return ej(r,s,f)}function u(f,h){aee(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 oXe(e,t,r,n){var i={};return R(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 ej(s,f,T)}function c(T,A){aee(s,f,T,A)}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&&I8(t)}};function I8(e){return new Oe(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var dXe=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 Uj(n.getZr())).on("brush",pe(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){uie(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:Ce(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Ce(i),$from:n})},t.type="brush",t}(Lt),vXe=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&&lie(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 O8(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=O8(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:K.color.backgroundTint,borderColor:K.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:K.color.disabled},t}(Qe);function O8(e,t){return He({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new tt(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var pXe=["rect","polygon","lineX","lineY","keep","clear"],gXe=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,R(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 R(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:pXe.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 mXe(e){e.registerComponentView(dXe),e.registerComponentModel(vXe),e.registerPreprocessor(nXe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,lXe),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"},lr),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},lr),wh("brush",gXe)}var yXe=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:K.size.m,backgroundColor:K.color.transparent,borderColor:K.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:K.color.primary},subtextStyle:{fontSize:12,color:K.color.quaternary}},t}(Qe),xXe=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(){dw(v,"_"+r.get("target"))}),g&&d.on("click",function(){dw(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=$t(_,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 A=S.margin,M=r.getItemStyle(["color","opacity"]);M.fill=r.get("backgroundColor");var P=new Xe({shape:{x:y.x-A[3],y:y.y-A[0],width:y.width+A[1]+A[3],height:y.height+A[0]+A[2],r:r.get("borderRadius")},style:M,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(Lt);function _Xe(e){e.registerComponentModel(yXe),e.registerComponentView(xXe)}var E8=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=[],R(n,function(u,c){var f=Ir(kv(u),""),h;Le(u)?(h=Ce(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 Dn([{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:K.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:K.color.secondary},data:[]},t}(Qe),cie=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=xu(E8.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:K.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:K.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:K.color.tertiary},itemStyle:{color:K.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:K.color.accent50,borderColor:K.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:K.color.accent50,borderColor:K.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:K.color.accent60},itemStyle:{color:K.color.accent60,borderColor:K.color.accent60},controlStyle:{color:K.color.accent70,borderColor:K.color.accent70}},progress:{lineStyle:{color:K.color.accent30},itemStyle:{color:K.color.accent40}},data:[]}),t}(E8);fr(cie,OT.prototype);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.type="timeline",t}(Lt),wXe=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}(_a),HM=Math.PI,D8=Je(),SXe=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 Ar("nameValue",{noName:!0,value:c})},R(["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=AXe(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:HM/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*HM/180;var _,b,S,T=h.get("position",!0),A=d&&h.get("showPlayBtn",!0),M=d&&h.get("showPrevBtn",!0),P=d&&h.get("showNextBtn",!0),k=0,I=f;T==="left"||T==="bottom"?(A&&(_=[0,0],k+=m),M&&(b=[k,0],k+=m),P&&(S=[I-v,0],I-=m)):(A&&(_=[I-v,0],I-=m),M&&(b=[0,0],k+=m),P&&(S=[I-v,0],I-=m));var O=[k,I];return r.get("inverse")&&O.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:O,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;Ua(s,s,[-l,-u]),qs(s,s,-HM/2),Ua(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||ve(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,A,M,P){S[M]+=A[M][P]-T[M][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=TXe(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 wXe("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 yr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:re({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new yr({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=[],R(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:pe(o._changeTimeline,o,u.value)},m=N8(f,h,n,g);m.ensureState("emphasis").style=d.getItemStyle(),m.ensureState("progress").style=v.getItemStyle(),Zl(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=[],R(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:pe(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),Zl(y),D8(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",pe(this._changeTimeline,this,f?"-":"+")),h(r.prevBtnPosition,"prev",pe(this._changeTimeline,this,f?"+":"-")),h(r.playPosition,c?"stop":"play",pe(this._handlePlayClick,this,!c),!0);function h(d,v,g,m){if(d){var y=Za(be(a.get(["controlStyle",v+"BtnSize"]),o),o),_=[0,-y/2,y,y],b=CXe(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),Zl(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=pe(u._handlePointerDrag,u),f.ondragend=pe(u._handlePointerDragend,u),j8(f,u._progressLine,s,i,a,!0)},onUpdate:function(f){j8(f,u._progressLine,s,i,a)}};this._currentPointer=N8(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=Mi(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(v)),[s,d]}var E_={min:Be(O_,"min"),max:Be(O_,"max"),average:Be(O_,"average"),median:Be(O_,"median")};function jy(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!OXe(t)&&!ie(t.coord)&&ie(i)){var a=fie(t,r,n,e);if(t=Ce(t),t.type&&E_[t.type]&&a.baseAxis&&a.valueAxis){var o=Ge(i,a.baseAxis.dim),s=Ge(i,a.valueAxis.dim),l=E_[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||!ie(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&E_[t.type]){var c=n.getOtherAxis(u);c&&(t.value=Yw(r,r.mapDimension(c.dim),t.type))}}else for(var f=t.coord,h=0;h<2;h++)E_[f[h]]&&(f[h]=Yw(r,r.mapDimension(i[h]),f[h]));return t}}function fie(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(EXe(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 EXe(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function Ry(e,t){return e&&e.containData&&t.coord&&!MO(t)?e.containData(t.coord):!0}function DXe(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!MO(t)&&!MO(r)?e.containZone(t.coord,r.coord):!0}function hie(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return ql(o,t[a])}:function(r,n,i,a){return ql(r.value,t[a])}}function Yw(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 UM=Je(),AR=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){UM(s).keep=!1}),n.eachSeries(function(s){var l=Go.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!UM(s).keep&&a.group.remove(s.group)}),NXe(n,o,this.type)},t.prototype.markKeep=function(r){UM(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;R(r,function(a){var o=Go.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?MQ(l):_N(l))})}})},t.type="marker",t}(Lt);function NXe(e,t,r){e.eachSeries(function(n){var i=Go.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=of(i),s=o.z,l=o.zlevel;PT(a.group,s,l)}})}function B8(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=de(l.get("x"),c)+h,m=de(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 jXe=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=Go.getMarkerModelFromSeries(a,"markPoint");o&&(B8(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 m0),f=RXe(o,r,n);n.setData(f),B8(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(Ae(v)||Ae(g)||Ae(m)||Ae(y)){var b=n.getRawValue(h),S=n.getDataParams(h);Ae(v)&&(v=v(b,S)),Ae(g)&&(g=g(b,S)),Ae(m)&&(m=m(b,S)),Ae(y)&&(y=y(b,S))}var T=d.getModel("itemStyle").getItemStyle(),A=d.get("z2"),M=v0(l,"color");T.fill||(T.fill=M),f.setItemVisual(h,{z2:be(A,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}(AR);function RXe(e,t,r){var n;e?n=se(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return re(re({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new Dn(n,r),a=se(r.get("data"),Be(jy,t));e&&(a=ht(a,Be(Ry,e)));var o=hie(!!e,n);return i.initData(a,null,o),i}function BXe(e){e.registerComponentModel(IXe),e.registerComponentView(jXe),e.registerPreprocessor(function(t){TR(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}(Go),D_=Je(),$Xe=function(e,t,r,n){var i=e.getData(),a;if(ie(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=nn(n.yAxis,n.xAxis);else{var u=fie(n,i,t,e);s=u.valueAxis;var c=dj(i,u.valueDataDim);l=Yw(i,c,o)}var f=s.dim==="x"?0:1,h=1-f,d=Ce(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=[jy(e,a[0]),jy(e,a[1]),re({},a[2])];return m[2].type=m[2].type||null,He(m[2],m[0]),He(m[2],m[1]),m};function Xw(e){return!isNaN(e)&&!isFinite(e)}function z8(e,t,r,n){var i=1-e,a=n.dimensions[e];return Xw(t[i])&&Xw(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function FXe(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(z8(1,r,n,e)||z8(0,r,n,e)))return!0}return Ry(e,t[0])&&Ry(e,t[1])}function ZM(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=de(o.get("x"),i.getWidth()),u=de(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(iu(a,"cartesian2d")){var d=a.getAxis("x"),v=a.getAxis("y"),c=a.dimensions;Xw(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):Xw(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 VXe=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=Go.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=D_(o).from,u=D_(o).to;l.each(function(c){ZM(l,c,!0,a,i),ZM(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 Wj);this.group.add(c.group);var f=GXe(o,r,n),h=f.from,d=f.to,v=f.line;D_(n).from=h,D_(n).to=d,n.setData(v);var g=n.get("symbol"),m=n.get("symbolSize"),y=n.get("symbolRotate"),_=n.get("symbolOffset");ie(g)||(g=[g,g]),ie(m)||(m=[m,m]),ie(y)||(y=[y,y]),ie(_)||(_=[_,_]),f.from.each(function(S){b(h,S,!0),b(d,S,!1)}),v.each(function(S){var T=v.getItemModel(S),A=T.getModel("lineStyle").getLineStyle();v.setItemLayout(S,[h.getItemLayout(S),d.getItemLayout(S)]);var M=T.get("z2");A.stroke==null&&(A.stroke=h.getItemVisual(S,"style").fill),v.setItemVisual(S,{z2:be(M,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:A})}),c.updateData(v),f.line.eachItemGraphicEl(function(S){De(S).dataModel=n,S.traverse(function(T){De(T).dataModel=n})});function b(S,T,A){var M=S.getItemModel(T);ZM(S,T,A,r,a);var P=M.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=v0(l,"color")),S.setItemVisual(T,{symbolKeepAspect:M.get("symbolKeepAspect"),symbolOffset:be(M.get("symbolOffset",!0),_[A?0:1]),symbolRotate:be(M.get("symbolRotate",!0),y[A?0:1]),symbolSize:be(M.get("symbolSize"),m[A?0:1]),symbol:be(M.get("symbol",!0),g[A?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(AR);function GXe(e,t,r){var n;e?n=se(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return re(re({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new Dn(n,r),a=new Dn(n,r),o=new Dn([],r),s=se(r.get("data"),Be($Xe,t,e,r));e&&(s=ht(s,Be(FXe,e)));var l=hie(!!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 WXe(e){e.registerComponentModel(zXe),e.registerComponentView(VXe),e.registerPreprocessor(function(t){TR(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var HXe=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}(Go),N_=Je(),UXe=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=jy(e,i),s=jy(e,a),l=o.coord,u=s.coord;l[0]=nn(l[0],-1/0),l[1]=nn(l[1],-1/0),u[0]=nn(u[0],1/0),u[1]=nn(u[1],1/0);var c=fT([{},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 qw(e){return!isNaN(e)&&!isFinite(e)}function $8(e,t,r,n){var i=1-e;return qw(t[i])&&qw(r[i])}function ZXe(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 iu(e,"cartesian2d")?r&&n&&($8(1,r,n)||$8(0,r,n))?!0:DXe(e,i,a):Ry(e,i)||Ry(e,a)}function F8(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=de(o.get(r[0]),i.getWidth()),u=de(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(iu(a,"cartesian2d")){var _=a.getAxis("x"),b=a.getAxis("y"),g=e.get(r[0],t),m=e.get(r[1],t);qw(g)?s[0]=_.toGlobalCoord(_.getExtent()[r[0]==="x0"?0:1]):qw(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 V8=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],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=Go.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=se(V8,function(f){return F8(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=XXe(o,r,n);n.setData(f),f.each(function(h){var d=se(V8,function(I){return F8(f,h,I,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))];Mi(_),Mi(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:K.size.m,align:"auto",backgroundColor:K.color.transparent,borderColor:K.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:K.color.disabled,inactiveBorderColor:K.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:K.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:K.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:K.color.tertiary,borderWidth:1,borderColor:K.color.border},emphasis:{selectorLabel:{show:!0,color:K.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(Qe),hh=Be,LO=R,j_=Me,die=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 j_),this.group.add(this._selectorGroup=new j_),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=$t(f,c,h),v=this.layoutInner(r,o,d,a,l,u),g=$t(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=tie(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)}),LO(n.getData(),function(v,g){var m=this,y=v.get("name");if(!this.newlineDisabled&&(y===""||y===` +`)){var _=new j_;_.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")||{},A=S.getVisual("legendIcon"),M=S.getVisual("style"),P=this._createItem(b,y,g,v,n,r,T,M,A,f,a);P.on("click",hh(G8,y,null,a,d)).on("mouseover",hh(kO,b.name,null,a,d)).on("mouseout",hh(IO,b.name,null,a,d)),i.ssr&&P.eachChild(function(k){var I=De(k);I.seriesIndex=b.seriesIndex,I.dataIndex=g,I.ssrType="legend"}),h&&P.eachChild(function(k){m.packEventData(k,n,b,g,y)}),c.set(y,!0)}else i.eachRawSeries(function(k){var I=this;if(!c.get(y)&&k.legendVisualProvider){var O=k.legendVisualProvider;if(!O.containName(y))return;var D=O.indexOfName(y),N=O.getItemVisual(D,"style"),B=O.getItemVisual(D,"legendIcon"),$=En(N.fill);$&&$[3]===0&&($[3]=.2,N=re(re({},N),{fill:sa($,"rgba")}));var F=this._createItem(k,y,g,v,n,r,{},N,B,f,a);F.on("click",hh(G8,null,y,a,d)).on("mouseover",hh(kO,null,y,a,d)).on("mouseout",hh(IO,null,y,a,d)),i.ssr&&F.eachChild(function(G){var z=De(G);z.seriesIndex=k.seriesIndex,z.dataIndex=g,z.ssrType="legend"}),h&&F.eachChild(function(G){I.packEventData(G,n,k,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();LO(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}),Zl(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=QXe(c,a,l,u,d,m,h),T=new j_,A=a.getModel("textStyle");if(Ae(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 M=b==="inherit"&&r.getData().getVisual("symbol")?y==="inherit"?r.getData().getVisual("symbolRotate"):y:0;T.add(JXe({itemWidth:v,itemHeight:g,icon:c,iconRotate:M,itemStyle:S.itemStyle,symbolKeepAspect:_}))}var P=s==="left"?v+5:-5,k=s,I=o.get("formatter"),O=n;ve(I)&&I?O=I.replace("{name}",n??""):Ae(I)&&(O=I(n));var D=m?A.getTextColor():a.get("inactiveColor");T.add(new at({style:Mt(A,{text:O,x:P,y:g/2,fill:D,align:k,verticalAlign:"middle"},{inheritColor:D})}));var N=new Xe({shape:T.getBoundingRect(),style:{fill:"transparent"}}),B=a.getModel("tooltip");return B.get("show")&&Qs({el:N,componentModel:o,itemName:n,itemTooltipOption:B.option}),T.add(N),T.eachChild(function($){$.silent=!0}),N.silent=!f,this.getContentGroup().add(T),Zl(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Bc(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){Bc("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}(Lt);function QXe(e,t,r,n,i,a,o){function s(m,y){m.lineWidth==="auto"&&(m.lineWidth=y.lineWidth>0?2:0),LO(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:Qd(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 JXe(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=K.color.neutral00,r.style.lineWidth=2),r}function G8(e,t,r,n){IO(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),kO(e,t,r,n)}function vie(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 A={x:0,y:0};A[o]=Math.max(i[o]-v[o]-b,0),A[s]=T[s],f.setClipPath(new Xe({shape:A})),f.__rectSize=A[o]}else h.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var M=this._getPageInfo(r);return M.pageIndex!=null&<(c,{x:M.contentPosition[0],y:M.contentPosition[1]},g?r:null),this._updatePageInfoView(r,M),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;R(["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",ve(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=YM[o],l=XM[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(A){if(A){var M=A.getBoundingRect(),P=M[l]+A[l];return{s:P,e:P+M[s],i:A.__legendDataIndex}}}function T(A,M){return A.e>=M&&A.s<=M+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}(die);function iqe(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 aqe(e){Ze(pie),e.registerComponentModel(rqe),e.registerComponentView(nqe),iqe(e)}function oqe(e){Ze(pie),Ze(aqe)}var sqe=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=xu(Ny.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Ny),CR=Je();function lqe(e,t,r){CR(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function uqe(e,t){for(var r=CR(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 vqe(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=CR(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=_e());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=Qne(a);R(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,cqe(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){gie(i,a);return}var c=dqe(l,a,r);o.enable(c.controlType,c.opt),Vv(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var pqe=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(),lqe(i,r,{pan:pe(qM.pan,this),zoom:pe(qM.zoom,this),scrollMove:pe(qM.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){uqe(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(yR),qM={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=KM[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(au(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Z8(function(e,t,r,n,i,a){var o=KM[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:Z8(function(e,t,r,n,i,a){var o=KM[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function Z8(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(au(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var KM={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 mie(e){xR(e),e.registerComponentModel(sqe),e.registerComponentView(pqe),vqe(e)}var 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.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=xu(Ny.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:K.color.accent10,borderRadius:0,backgroundColor:K.color.transparent,dataBackground:{lineStyle:{color:K.color.accent30,width:.5},areaStyle:{color:K.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:K.color.accent40,width:.5},areaStyle:{color:K.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:K.color.neutral00,borderColor:K.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:K.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:K.color.tertiary},brushSelect:!0,brushStyle:{color:K.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:K.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(Ny),ng=Xe,mqe=1,QM=30,yqe=7,ig="horizontal",Y8="vertical",xqe=5,_qe=["line","bar","candlestick","scatter"],bqe={easing:"cubicOut",duration:100,delay:0},wqe=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=pe(this._onBrush,this),this._onBrushEnd=pe(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),Vv(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(){_y(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?yqe:0,o=jr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===ig?{right:o.width-s.x-s.width,top:o.height-QM-l-a,width:s.width,height:QM}:{right:l,top:s.y,width:QM,height:s.height},c=Sf(r.option);R(["right","top","width","height"],function(h){c[h]==="ph"&&(c[h]=u[h])});var f=$t(c,o);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===Y8&&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===ig&&!o?{scaleY:l?1:-1,scaleX:1}:i===ig&&o?{scaleY:l?1:-1,scaleX:-1}:i===Y8&&!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 ng({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new ng({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:pe(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=-_,A=Math.round(o.count()/n[0]),M;o.each([r.thisDim,l],function(D,N,B){if(A>0&&B%A){S||(T+=_);return}T=S?(+D-f[0])*b:T+_;var $=N==null||isNaN(N)||N==="",F=$?0:gt(N,h,v,!0);$&&!M&&B?(m.push([m[m.length-1][0],0]),y.push([y[y.length-1][0],0])):!$&&M&&(m.push([T,0]),y.push([T,0])),$||(m.push([T,F]),y.push([T,F])),M=$}),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 k(D){var N=P.getModel(D?"selectedDataBackground":"dataBackground"),B=new Me,$=new wn({shape:{points:u},segmentIgnoreThreshold:1,style:N.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),F=new on({shape:{points:c},segmentIgnoreThreshold:1,style:N.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return B.add($),B.add(F),B}for(var I=0;I<3;I++){var O=k(I===1);this._displayables.sliderGroup.add(O),this._displayables.dataShadowSegs.push(O)}},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();R(l,function(u){if(!i&&!(n!==!0&&Ge(_qe,u.get("type"))<0)){var c=a.getComponent(El(o),s).axis,f=Sqe(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 ng({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new ng({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:mqe,fill:K.color.transparent}})),R([0,1],function(b){var S=l.get("handleIcon");!gw[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:Tqe(this._orient),draggable:!0,drift:pe(this._onDragMove,this,b),ondragend:pe(this._onDragEnd,this),onmouseover:pe(this._showDataInfo,this,!0),onmouseout:pe(this._showDataInfo,this,!1),z2:5});var A=T.getBoundingRect(),M=l.get("handleSize");this._handleHeight=de(M,this._size[1]),this._handleWidth=A.width/A.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(),Zl(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[b]=T);var k=l.getModel("textStyle"),I=l.get("handleLabel")||{},O=I.show||!1;r.add(a[b]=new at({silent:!0,invisible:!O,style:Mt(k,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:k.getTextColor(),font:k.getFont()}),z2:10}))},this);var d=h;if(f){var v=de(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,K.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:pe(this._onDragMove,this,"all"),ondragstart:pe(this._showDataInfo,this,!0),ondragend:pe(this._onDragEnd,this),onmouseover:pe(this._showDataInfo,this,!0),onmouseout:pe(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];au(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=Mi([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=Mi(i.slice()),o=this._size;R([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();au(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=Mi([gt(l[0],o,s,!0),gt(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(zs(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 ng({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?bqe:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=Qne(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}(yR);function Sqe(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function Tqe(e){return e==="vertical"?"ns-resize":"ew-resize"}function yie(e){e.registerComponentModel(gqe),e.registerComponentView(wqe),xR(e)}function Aqe(e){Ze(mie),Ze(yie)}var xie={get:function(e,t,r){var n=Ce((Cqe[e]||{})[t]);return r&&ie(n)?n[n.length-1]:n}},Cqe={color:{active:["#006edd","#e0ffff"],inactive:[K.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]}},X8=Hr.mapVisual,Mqe=Hr.eachVisual,Pqe=ie,q8=R,Lqe=Mi,kqe=gt,Kw=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&&lie(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=pe(r,this),this.controllerVisuals=AO(this.option.controller,n,r),this.targetVisuals=AO(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=Iv(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){R(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||["<",">"],ie(r)&&(r=r.slice(),u=!0);var c=n?r:u?[f(r[0]),f(r[1])]:f(r);if(ve(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(Ae(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=Lqe([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){Pqe(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]={},q8(v,function(m,y){if(Hr.isValidType(y)){var _=xie.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";q8(this.stateList,function(y){var _=this.itemSize,b=f[y];b||(b=f[y]={color:s?v:[v]}),b.symbol==null&&(b.symbol=h&&Ce(h)||(s?m:[m])),b.symbolSize==null&&(b.symbolSize=d&&Ce(d)||(s?_[0]:[_[0],_[0]])),b.symbol=X8(b.symbol,function(A){return A==="none"?m:A});var S=b.symbolSize;if(S!=null){var T=-1/0;Mqe(S,function(A){A>T&&(T=A)}),b.symbolSize=X8(S,function(A){return kqe(A,[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:K.color.transparent,borderColor:K.color.borderTint,contentColor:K.color.theme[0],inactiveColor:K.color.disabled,borderWidth:0,padding:K.size.m,textGap:10,precision:0,textStyle:{color:K.color.secondary}},t}(Qe),K8=[20,140],Iqe=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]=K8[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=K8[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):ie(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),R(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=Mi((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=Q8(this,"outOfRange",this.getExtent()),i=Q8(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);Oqe([0,1],function(f){var h=o[f];h.setStyle("fill",n.handlesColor[f]),h.y=r[f];var d=fo(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=Ga(i.handleLabelPoints[f],Yl(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=fo(r,s,u,!0),m=l[0]-v/2,y={x:f.x,y:f.y};f.y=g,f.x=m;var _=Ga(c.indicatorLabelPoint,Yl(f,this.group)),b=c.indicatorLabel;b.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,A=T==="horizontal";b.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:A?S:"middle",align:A?"center":S});var M={x:m,y:g,style:{fill:d}},P={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var k={duration:100,easing:"cubicInOut",additive:!0};f.x=y.x,f.y=y.y,f.animateTo(M,k),b.animateTo(P,k)}else f.attr(M),b.attr(P);this._firstShowIndicator=!1;var I=this._shapes.handleLabels;if(I)for(var O=0;Oo[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||rU(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var v=pRe(h,d);this._dispatchHighDown("downplay",pb(v[0],i)),this._dispatchHighDown("highlight",pb(v[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(Mc(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 $qe(e,t,r,n){for(var i=t.targetVisuals[n],a=Hr.prepareVisualTypes(i),o={color:v0(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(Rqe,Bqe),R(zqe,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(Fqe))}function Sie(e){e.registerComponentModel(Iqe),e.registerComponentView(Nqe),wie(e)}var Vqe=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=[],Gqe[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=Ce(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=se(this._pieceList,function(l){return l=Ce(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=Hr.listVisualTypes(),a=this.isCategory();R(r.pieces,function(s){R(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),R(n,function(s,l){var u=!1;R(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&R(this.stateList,function(c){(r[c]||(r[c]={}))[l]=xie.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,R(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;R(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=Ce(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 R(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=xu(Kw.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}(Kw),Gqe={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 oU(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var Wqe=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=nn(n.get("showLabel",!0),!u),f=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),R(l.viewPieceList,function(h){var d=h.piece,v=new Me;v.onclick=pe(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),Bc(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:pb(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return bie(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=Ce(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,R(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}(_ie);function Tie(e){e.registerComponentModel(Vqe),e.registerComponentView(Wqe),wie(e)}function Hqe(e){Ze(Sie),Ze(Tie)}var Uqe=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:YQ(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}(),Zqe=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 Uqe(this);if(this._target=null,this.ecModel.eachSeries(function(i){IW(i,null)}),this.shouldShow()){var n=this.getTarget();IW(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:K.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:K.color.neutral30,borderColor:K.color.neutral40,opacity:.3},z:10},t}(Qe),Yqe=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 Pf),!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")||K.color.neutral00);var l=jr(r,i).refContainer,u=$t(vJ(r,!0),l),c=s.lineWidth||0,f=this._contentRect=af(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(),lU(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),lU(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=$t({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=da([],r.targetTrans),i=Fa([],this._coordSys.transform,n);this._transThisToTarget=da([],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 Mf(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",pe(this._onPan,this)).on("zoom",pe(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=ur([],[r.oldX,r.oldY],n),a=ur([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(sU(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=ur([],[r.originX,r.originY],n);this._api.dispatchAction(sU(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}(Lt);function sU(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,re(n,t),n}function lU(e,t){var r=of(e);PT(t.group,r.z,r.zlevel)}function Xqe(e){e.registerComponentModel(Zqe),e.registerComponentView(Yqe)}var qqe={label:{enabled:!0},decal:{show:!1}},uU=Je(),Kqe={};function Qqe(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=Ce(qqe);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)),uU(h).scope=d}}),e.eachRawSeries(function(h){if(e.isSeriesFiltered(h))return;if(Ae(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var _=mI(h.ecModel,h.name,Kqe,e.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",S(b,_))}else{var v=h.getRawData(),g={},m=uU(h).scope;d.each(function(T){var A=d.getRawIndex(T);g[A]=T});var y=v.count();v.each(function(T){var A=g[T],M=v.getName(T)||T+"",P=mI(h.ecModel,M,m,y),k=d.getItemVisual(A,"decal");d.setItemVisual(A,"decal",S(k,P))})}function S(T,A){var M=T?re(re({},A),T):A;return M.dirty=!0,M}})}}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,k){if(k1?f.get(["series","multiple",D]):f.get(["series","single",D]),I=o(I,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var N=P.getData();if(N.count()>d){var B=f.get(["data","partialData"]);I+=o(B,{displayCnt:d})}else I+=f.get(["data","allData"]);for(var $=f.get(["data","separator","middle"]),F=f.get(["data","separator","end"]),G=f.get(["data","excludeDimensionId"]),z=[],U=0;U":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},tKe=function(){function e(t){var r=this._condVal=ve(t)?new RegExp(t):yK(t)?t:null;if(r==null){var n="";mt(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return ve(r)?this._condVal.test(t):ot(r)?this._condVal.test(t+""):!1},e}(),rKe=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),nKe=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[N,B]}function c(N,B,$,F){Wh(N,$)&&Wh(B,F)||i.push(N,B,$,F,$,F)}function f(N,B,$,F,G,z){var U=Math.abs(B-N),H=Math.tan(U/4)*4/3,Y=BP:O2&&n.push(i),n}function EO(e,t,r,n,i,a,o,s,l,u){if(Wh(e,r)&&Wh(t,n)&&Wh(i,o)&&Wh(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 k=[],I=[];ru(e,r,i,o,.5,k),ru(t,n,a,s,.5,I),EO(k[0],I[0],k[1],I[1],k[2],I[2],k[3],I[3],l,u),EO(k[4],I[4],k[5],I[5],k[6],I[6],k[7],I[7],l,u)}function mKe(e,t){var r=OO(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),f=Cie([l,u],c?0:1,t),h=(c?s:u)/f.length,d=0;di,o=Cie([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 _Ke(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 vh(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function bKe(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),bKe(t,u,c)}function Qw(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);Qw(e,a[0],i,n),Qw(e,a[1],r-i,n)}return n}function wKe(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 tS(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:IKe(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 Lie(e){return AKe(e.path,e.count)}function DO(){return{fromIndividuals:[],toIndividuals:[],count:0}}function OKe(e,t,r){var n=[];function i(T){for(var A=0;A=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 DKe={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;yU(e)&&(u=e,c=t),yU(t)&&(u=t,c=e);function f(y,_,b,S,T){var A=y.many,M=y.one;if(A.length===1&&!T){var P=_?A[0]:M,k=_?M:A[0];if(Jw(P))f({many:[P],one:k},!0,b,S,!0);else{var I=s?Pe({delay:s(b,S)},l):l;PR(P,k,I),a(P,k,P,k,I)}}else for(var O=Pe({dividePath:DKe[r],individualDelay:s&&function(G,z,U,H){return s(G+b,S)}},l),D=_?OKe(A,M,O):EKe(M,A,O),N=D.fromIndividuals,B=D.toIndividuals,$=N.length,F=0;F<$;F++){var I=s?Pe({delay:s(F,$)},l):l;a(N[F],B[F],_?A[F]:y.one,_?y.one:A[F],I)}}for(var h=u?u===e:e.length>t.length,d=u?xU(c,u):xU(h?t:e,[h?e:t]),v=0,g=0;gkie))for(var a=n.getIndices(),o=0;o0&&A.group.traverse(function(P){P instanceof rt&&!P.animators.length&&P.animateFrom({style:{opacity:0}},M)})})}function TU(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function AU(e){return ie(e)?e.sort().join(","):e}function xl(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function FKe(e,t){var r=_e(),n=_e(),i=_e();return R(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=TU(a),c=AU(u);n.set(c,{dataGroupId:s,data:l}),ie(u)&&R(u,function(f){i.set(f,{key:c,dataGroupId:s,data:l})})}),R(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=TU(a),u=AU(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:xl(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:xl(s),data:s}]});else if(ie(l)){var f=[];R(l,function(v){var g=n.get(v);g.data&&f.push({dataGroupId:g.dataGroupId,divide:xl(g.data),data:g.data})}),f.length&&r.set(u,{oldSeries:f,newSeries:[{dataGroupId:o,data:s,divide:xl(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:xl(h.data)}],newSeries:[]},r.set(h.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:xl(s)})}}}}),r}function CU(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:xl(t.oldData[s]),groupIdDim:o.dimension})}),R(Pt(e.to),function(o){var s=CU(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:xl(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&Iie(i,a,n)}function GKe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){R(Pt(n.seriesTransition),function(i){R(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=MU,n=PU,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 HKe(){return new WKe}var MU=0,PU=0;function UKe(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()}};R(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=LR(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));R(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 ZKe(e,t,r,n,i,a){e!=="no"&&R(r,function(o){var s=LR(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}R(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:Ce(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(ve(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&&R(["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 R(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function kR(e,t){return jO(t)===jO(e)}function jO(e){return e.start+"_\0_"+e.end}function XKe(e,t,r){var n=[];R(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),R(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=gu(n,function(u){return kR(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return R(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function qKe(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=gu(r,function(f){return kR(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"?mr(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 KKe(e,t,r){var n={noNegative:!0},i=NO(e,r,n),a=NO(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 QKe={vmin:"start",vmax:"end"};function JKe(e,t){return t&&(e=e||{},e.break={type:QKe[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function eQe(){wBe({createScaleBreakContext:HKe,pruneTicksByBreak:ZKe,addBreaksToTicks:YKe,parseAxisBreakOption:NO,identifyAxisBreak:kR,serializeAxisBreakIdentifier:jO,retrieveAxisBreakPairs:XKe,getTicksLogTransformBreak:qKe,logarithmicParseBreaksFromOption:KKe,makeAxisLabelFormatterParamBreak:JKe})}var LU=Je();function tQe(e,t){var r=gu(e,function(n){return Sr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function rQe(e){R(e,function(t){return t.shouldRemove=!0})}function nQe(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function iQe(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(k){return k.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=LU(t).visualList||(LU(t).visualList=[]);rQe(T);for(var A=function(k){var I=o[k][0].break.parsedBreak,O=[];O[0]=a.toGlobalCoord(a.dataToCoord(I.vmin,!0)),O[1]=a.toGlobalCoord(a.dataToCoord(I.vmax,!0)),O[1]=z;ge&&(J=z);var We=[],xe=[];We[F]=O,xe[F]=D,!ce&&!ge&&(We[F]+=Z?-l:l,xe[F]-=Z?l:-l),We[G]=J,xe[G]=J,H.push(We),Y.push(xe);var ne=void 0;if(ae_[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),RI(r[0],m),RI(r[1],y)}function sQe(e,t){var r={breaks:[]};return R(t.breaks,function(n){if(n){var i=gu(e.get("breaks",!0),function(s){return Sr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===zT?!0:a===Qte?!1:a===Jte?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function lQe(){n6e({adjustBreakLabelPair:oQe,buildAxisBreakLine:aQe,rectCoordBuildBreakAxis:iQe,updateModelAxisBreak:sQe})}function uQe(e){u6e(e),eQe(),lQe()}function cQe(){k6e(fQe)}function fQe(e,t){R(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=hQe(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 hQe(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof Jd?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=Hv(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 LQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function kQe(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function IQe({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=>OU.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=LQe(_.latitude),S=IU[b%IU.length],T=OU.includes(_.role),A=_.node_num===r,M=f.has(_.node_num),P=r===null||A||M;return{id:String(_.node_num),name:_.short_name,value:_.node_num,symbolSize:kQe(_.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:PQe(_.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(MQe,{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(FE,{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 Die(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 OQe(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const EQe=1;function DQe(e){return Object.freeze({__version:EQe,map:e})}function Nie(e,t){return Object.freeze({...e,...t})}const jie=W.createContext(null),Rie=jie.Provider;function KT(){const e=W.useContext(jie);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function NQe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return W.useImperativeHandle(n,()=>i),r.children==null?null:Q.createElement(Rie,{value:a},r.children)}return W.forwardRef(t)}function jQe(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?tZ.createPortal(r.children,s):null}return W.forwardRef(t)}function RQe(e){function t(r,n){const{instance:i}=e(r).current;return W.useImperativeHandle(n,()=>i),null}return W.forwardRef(t)}function DR(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 QT(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function BQe(e,t){return function(n,i){const a=KT(),o=e(QT(n,a),a);return Die(a.map,n.attribution),DR(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var zO={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)})(ig,function(r){var n="1.9.4";function i(p){var w,C,E,j;for(C=1,E=arguments.length;C"u"||!L||!L.Mixin)){p=b(p)?p:[p];for(var w=0;w0?Math.floor(p):Math.ceil(p)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(p){return this.clone()._add(H(p))},_add:function(p){return this.x+=p.x,this.y+=p.y,this},subtract:function(p){return this.clone()._subtract(H(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 z(this.x*p.x,this.y*p.y)},unscaleBy:function(p){return new z(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=H(p);var w=p.x-this.x,C=p.y-this.y;return Math.sqrt(w*w+C*C)},equals:function(p){return p=H(p),p.x===this.x&&p.y===this.y},contains:function(p){return p=H(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 H(p,w,C){return p instanceof z?p:b(p)?new z(p[0],p[1]):p==null?p:typeof p=="object"&&"x"in p&&"y"in p?new z(p.x,p.y):new z(p,w,C)}function Y(p,w){if(p)for(var C=w?[p,w]:p,E=0,j=C.length;E=this.min.x&&C.x<=this.max.x&&w.y>=this.min.y&&C.y<=this.max.y},intersects:function(p){p=Z(p);var w=this.min,C=this.max,E=p.min,j=p.max,V=j.x>=w.x&&E.x<=C.x,X=j.y>=w.y&&E.y<=C.y;return V&&X},overlaps:function(p){p=Z(p);var w=this.min,C=this.max,E=p.min,j=p.max,V=j.x>w.x&&E.xw.y&&E.y=w.lat&&j.lat<=C.lat&&E.lng>=w.lng&&j.lng<=C.lng},intersects:function(p){p=ae(p);var w=this._southWest,C=this._northEast,E=p.getSouthWest(),j=p.getNorthEast(),V=j.lat>=w.lat&&E.lat<=C.lat,X=j.lng>=w.lng&&E.lng<=C.lng;return V&&X},overlaps:function(p){p=ae(p);var w=this._southWest,C=this._northEast,E=p.getSouthWest(),j=p.getNorthEast(),V=j.lat>w.lat&&E.latw.lng&&E.lng1,Qie=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}(),Jie=function(){return!!document.createElement("canvas").getContext}(),eA=!!(document.createElementNS&&Fe("svg").createSVGRect),eae=!!eA&&function(){var p=document.createElement("div");return p.innerHTML="",(p.firstChild&&p.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),tae=!eA&&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}}(),rae=navigator.platform.indexOf("Mac")===0,nae=navigator.platform.indexOf("Linux")===0;function Qa(p){return navigator.userAgent.toLowerCase().indexOf(p)>=0}var He={ie:Ft,ielt9:nr,edge:jn,webkit:qr,android:Jn,android23:Lf,androidStock:S0,opera:QT,chrome:BR,gecko:zR,safari:Gie,phantom:$R,opera12:FR,win:Wie,ie3d:VR,webkit3d:JT,gecko3d:GR,any3d:Hie,mobile:Xv,mobileWebkit:Uie,mobileWebkit3d:Zie,msPointer:WR,pointer:HR,touch:Yie,touchNative:UR,mobileOpera:Xie,mobileGecko:qie,retina:Kie,passiveEvents:Qie,canvas:Jie,svg:eA,vml:tae,inlineSvg:eae,mac:rae,linux:nae},ZR=He.msPointer?"MSPointerDown":"pointerdown",YR=He.msPointer?"MSPointerMove":"pointermove",XR=He.msPointer?"MSPointerUp":"pointerup",qR=He.msPointer?"MSPointerCancel":"pointercancel",tA={touchstart:ZR,touchmove:YR,touchend:XR,touchcancel:qR},KR={touchstart:uae,touchmove:T0,touchend:T0,touchcancel:T0},kf={},QR=!1;function iae(p,w,C){return w==="touchstart"&&lae(),KR[w]?(C=KR[w].bind(this,C),p.addEventListener(tA[w],C,!1),C):(console.warn("wrong event specified:",w),f)}function aae(p,w,C){if(!tA[w]){console.warn("wrong event specified:",w);return}p.removeEventListener(tA[w],C,!1)}function oae(p){kf[p.pointerId]=p}function sae(p){kf[p.pointerId]&&(kf[p.pointerId]=p)}function JR(p){delete kf[p.pointerId]}function lae(){QR||(document.addEventListener(ZR,oae,!0),document.addEventListener(YR,sae,!0),document.addEventListener(XR,JR,!0),document.addEventListener(qR,JR,!0),QR=!0)}function T0(p,w){if(w.pointerType!==(w.MSPOINTER_TYPE_MOUSE||"mouse")){w.touches=[];for(var C in kf)w.touches.push(kf[C]);w.changedTouches=[w],p(w)}}function uae(p,w){w.MSPOINTER_TYPE_TOUCH&&w.pointerType===w.MSPOINTER_TYPE_TOUCH&&un(w),T0(p,w)}function cae(p){var w={},C,E;for(E in p)C=p[E],w[E]=C&&C.bind?C.bind(p):C;return p=w,w.type="dblclick",w.detail=2,w.isTrusted=!1,w._simulated=!0,w}var fae=200;function hae(p,w){p.addEventListener("dblclick",w);var C=0,E;function j(V){if(V.detail!==1){E=V.detail;return}if(!(V.pointerType==="mouse"||V.sourceCapabilities&&!V.sourceCapabilities.firesTouchEvents)){var X=i5(V);if(!(X.some(function(oe){return oe instanceof HTMLLabelElement&&oe.attributes.for})&&!X.some(function(oe){return oe instanceof HTMLInputElement||oe instanceof HTMLSelectElement}))){var te=Date.now();te-C<=fae?(E++,E===2&&w(cae(V))):E=1,C=te}}}return p.addEventListener("click",j),{dblclick:w,simDblclick:j}}function dae(p,w){p.removeEventListener("dblclick",w.dblclick),p.removeEventListener("click",w.simDblclick)}var rA=M0(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),qv=M0(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),e5=qv==="webkitTransition"||qv==="OTransition"?qv+"End":"transitionend";function t5(p){return typeof p=="string"?document.getElementById(p):p}function Kv(p,w){var C=p.style[w]||p.currentStyle&&p.currentStyle[w];if((!C||C==="auto")&&document.defaultView){var E=document.defaultView.getComputedStyle(p,null);C=E?E[w]:null}return C==="auto"?null:C}function Tt(p,w,C){var E=document.createElement(p);return E.className=w||"",C&&C.appendChild(E),E}function ir(p){var w=p.parentNode;w&&w.removeChild(p)}function A0(p){for(;p.firstChild;)p.removeChild(p.firstChild)}function If(p){var w=p.parentNode;w&&w.lastChild!==p&&w.appendChild(p)}function Of(p){var w=p.parentNode;w&&w.firstChild!==p&&w.insertBefore(p,w.firstChild)}function nA(p,w){if(p.classList!==void 0)return p.classList.contains(w);var C=C0(p);return C.length>0&&new RegExp("(^|\\s)"+w+"(\\s|$)").test(C)}function ut(p,w){if(p.classList!==void 0)for(var C=v(w),E=0,j=C.length;E0?2*window.devicePixelRatio:1;function o5(p){return He.edge?p.wheelDeltaY/2:p.deltaY&&p.deltaMode===0?-p.deltaY/gae: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 pA(p,w){var C=w.relatedTarget;if(!C)return!0;try{for(;C&&C!==p;)C=C.parentNode}catch{return!1}return C!==p}var mae={__proto__:null,on:st,off:Wt,stopPropagation:Su,disableScrollPropagation:vA,disableClickPropagation:tp,preventDefault:un,stop:Tu,getPropagationPath:i5,getMousePosition:a5,getWheelDelta:o5,isExternalTarget:pA,addListener:st,removeListener:Wt},s5=G.extend({run:function(p,w,C,E){this.stop(),this._el=p,this._inProgress=!0,this._duration=C||.25,this._easeOutPower=1/Math.max(E||.5,.2),this._startPos=wu(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=O(this._animate,this),this._step()},_step:function(p){var w=+new Date-this._startTime,C=this._duration*1e3;wthis.options.maxZoom)?this.setZoom(p):this},panInsideBounds:function(p,w){this._enforcingBounds=!0;var C=this.getCenter(),E=this._limitCenter(C,this._zoom,ae(p));return C.equals(E)||this.panTo(E,w),this._enforcingBounds=!1,this},panInside:function(p,w){w=w||{};var C=H(w.paddingTopLeft||w.padding||[0,0]),E=H(w.paddingBottomRight||w.padding||[0,0]),j=this.project(this.getCenter()),V=this.project(p),X=this.getPixelBounds(),te=Z([X.min.add(C),X.max.subtract(E)]),oe=te.getSize();if(!te.contains(V)){this._enforcingBounds=!0;var he=V.subtract(te.getCenter()),Ee=te.extend(V).getSize().subtract(oe);j.x+=he.x<0?-Ee.x:Ee.x,j.y+=he.y<0?-Ee.y:Ee.y,this.panTo(this.unproject(j),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 C=this.getSize(),E=w.divideBy(2).round(),j=C.divideBy(2).round(),V=E.subtract(j);return!V.x&&!V.y?this:(p.animate&&p.pan?this.panBy(V):(p.pan&&this._rawPanBy(V),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:C}))},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),C=o(this._handleGeolocationError,this);return p.watch?this._locationWatchId=navigator.geolocation.watchPosition(w,C,p):navigator.geolocation.getCurrentPosition(w,C,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,C=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: "+C+"."})}},_handleGeolocationResponse:function(p){if(this._container._leaflet_id){var w=p.coords.latitude,C=p.coords.longitude,E=new ce(w,C),j=E.toBounds(p.coords.accuracy*2),V=this._locateOptions;if(V.setView){var X=this.getBoundsZoom(j);this.setView(E,V.maxZoom?Math.min(X,V.maxZoom):X)}var te={latlng:E,bounds:j,timestamp:p.timestamp};for(var oe in p.coords)typeof p.coords[oe]=="number"&&(te[oe]=p.coords[oe]);this.fire("locationfound",te)}},addHandler:function(p,w){if(!w)return this;var C=this[p]=new w(this);return this._handlers.push(C),this.options[p]&&C.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(),ir(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)ir(this._panes[p]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(p,w){var C="leaflet-pane"+(p?" leaflet-"+p.replace("Pane","")+"-pane":""),E=Tt("div",C,w||this._mapPane);return p&&(this._panes[p]=E),E},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()),C=this.unproject(p.getTopRight());return new J(w,C)},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,C){p=ae(p),C=H(C||[0,0]);var E=this.getZoom()||0,j=this.getMinZoom(),V=this.getMaxZoom(),X=p.getNorthWest(),te=p.getSouthEast(),oe=this.getSize().subtract(C),he=Z(this.project(te,E),this.project(X,E)).getSize(),Ee=He.any3d?this.options.zoomSnap:1,et=oe.x/he.x,pt=oe.y/he.y,Rn=w?Math.max(et,pt):Math.min(et,pt);return E=this.getScaleZoom(Rn,E),Ee&&(E=Math.round(E/(Ee/100))*(Ee/100),E=w?Math.ceil(E/Ee)*Ee:Math.floor(E/Ee)*Ee),Math.max(j,Math.min(V,E))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(p,w){var C=this._getTopLeftPoint(p,w);return new Y(C,C.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 C=this.options.crs;return w=w===void 0?this._zoom:w,C.scale(p)/C.scale(w)},getScaleZoom:function(p,w){var C=this.options.crs;w=w===void 0?this._zoom:w;var E=C.zoom(p*C.scale(w));return isNaN(E)?1/0:E},project:function(p,w){return w=w===void 0?this._zoom:w,this.options.crs.latLngToPoint(ge(p),w)},unproject:function(p,w){return w=w===void 0?this._zoom:w,this.options.crs.pointToLatLng(H(p),w)},layerPointToLatLng:function(p){var w=H(p).add(this.getPixelOrigin());return this.unproject(w)},latLngToLayerPoint:function(p){var w=this.project(ge(p))._round();return w._subtract(this.getPixelOrigin())},wrapLatLng:function(p){return this.options.crs.wrapLatLng(ge(p))},wrapLatLngBounds:function(p){return this.options.crs.wrapLatLngBounds(ae(p))},distance:function(p,w){return this.options.crs.distance(ge(p),ge(w))},containerPointToLayerPoint:function(p){return H(p).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(p){return H(p).add(this._getMapPanePos())},containerPointToLatLng:function(p){var w=this.containerPointToLayerPoint(H(p));return this.layerPointToLatLng(w)},latLngToContainerPoint:function(p){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ge(p)))},mouseEventToContainerPoint:function(p){return a5(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=t5(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&&He.any3d,ut(p,"leaflet-container"+(He.touch?" leaflet-touch":"")+(He.retina?" leaflet-retina":"")+(He.ielt9?" leaflet-oldie":"")+(He.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var w=Kv(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),Cr(this._mapPane,new z(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,C){Cr(this._mapPane,new z(0,0));var E=!this._loaded;this._loaded=!0,w=this._limitZoom(w),this.fire("viewprereset");var j=this._zoom!==w;this._moveStart(j,C)._move(p,w)._moveEnd(j),this.fire("viewreset"),E&&this.fire("load")},_moveStart:function(p,w){return p&&this.fire("zoomstart"),w||this.fire("movestart"),this},_move:function(p,w,C,E){w===void 0&&(w=this._zoom);var j=this._zoom!==w;return this._zoom=w,this._lastCenter=p,this._pixelOrigin=this._getNewPixelOrigin(p),E?C&&C.pinch&&this.fire("zoom",C):((j||C&&C.pinch)&&this.fire("zoom",C),this.fire("move",C)),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){Cr(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),He.any3d&&this.options.transform3DLimit&&(p?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){D(this._resizeRequest),this._resizeRequest=O(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 C=[],E,j=w==="mouseout"||w==="mouseover",V=p.target||p.srcElement,X=!1;V;){if(E=this._targets[l(V)],E&&(w==="click"||w==="preclick")&&this._draggableMoved(E)){X=!0;break}if(E&&E.listens(w,!0)&&(j&&!pA(V,p)||(C.push(E),j))||V===this._container)break;V=V.parentNode}return!C.length&&!X&&!j&&this.listens(w,!0)&&(C=[this]),C},_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 C=p.type;C==="mousedown"&&uA(w),this._fireDOMEvent(p,C)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(p,w,C){if(p.type==="click"){var E=i({},p);E.type="preclick",this._fireDOMEvent(E,E.type,C)}var j=this._findEventTargets(p,w);if(C){for(var V=[],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(),C=this.getMaxZoom(),E=He.any3d?this.options.zoomSnap:1;return E&&(p=Math.round(p/E)*E),Math.max(w,Math.min(C,p))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_r(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(p,w){var C=this._getCenterOffset(p)._trunc();return(w&&w.animate)!==!0&&!this.getSize().contains(C)?!1:(this.panBy(C,w),!0)},_createAnimProxy:function(){var p=this._proxy=Tt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(p),this.on("zoomanim",function(w){var C=rA,E=this._proxy.style[C];bu(this._proxy,this.project(w.center,w.zoom),this.getZoomScale(w.zoom,1)),E===this._proxy.style[C]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ir(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var p=this.getCenter(),w=this.getZoom();bu(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,C){if(this._animatingZoom)return!0;if(C=C||{},!this._zoomAnimated||C.animate===!1||this._nothingToAnimate()||Math.abs(w-this._zoom)>this.options.zoomAnimationThreshold)return!1;var E=this.getZoomScale(w),j=this._getCenterOffset(p)._divideBy(1-1/E);return C.animate!==!0&&!this.getSize().contains(j)?!1:(O(function(){this._moveStart(!0,C.noMoveStart||!1)._animateZoom(p,w,!0)},this),!0)},_animateZoom:function(p,w,C,E){this._mapPane&&(C&&(this._animatingZoom=!0,this._animateToCenter=p,this._animateToZoom=w,ut(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:p,zoom:w,noUpdate:E}),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 yae(p,w){return new bt(p,w)}var ba=B.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),C=this.getPosition(),E=p._controlCorners[C];return ut(w,"leaflet-control"),C.indexOf("bottom")!==-1?E.insertBefore(w,E.firstChild):E.appendChild(w),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ir(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()}}),rp=function(p){return new ba(p)};bt.include({addControl:function(p){return p.addTo(this),this},removeControl:function(p){return p.remove(),this},_initControlPos:function(){var p=this._controlCorners={},w="leaflet-",C=this._controlContainer=Tt("div",w+"control-container",this._container);function E(j,V){var X=w+j+" "+w+V;p[j+V]=Tt("div",X,C)}E("top","left"),E("top","right"),E("bottom","left"),E("bottom","right")},_clearControlPos:function(){for(var p in this._controlCorners)ir(this._controlCorners[p]);ir(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var l5=ba.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(p,w,C,E){return C1,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)),C=w.overlay?p.type==="add"?"overlayadd":"overlayremove":p.type==="add"?"baselayerchange":null;C&&this._map.fire(C,w)},_createRadioElement:function(p,w){var C='",E=document.createElement("div");return E.innerHTML=C,E.firstChild},_addItem:function(p){var w=document.createElement("label"),C=this._map.hasLayer(p.layer),E;p.overlay?(E=document.createElement("input"),E.type="checkbox",E.className="leaflet-control-layers-selector",E.defaultChecked=C):E=this._createRadioElement("leaflet-base-layers_"+l(this),C),this._layerControlInputs.push(E),E.layerId=l(p.layer),st(E,"click",this._onInputClick,this);var j=document.createElement("span");j.innerHTML=" "+p.name;var V=document.createElement("span");w.appendChild(V),V.appendChild(E),V.appendChild(j);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,C,E=[],j=[];this._handlingClick=!0;for(var V=p.length-1;V>=0;V--)w=p[V],C=this._getLayer(w.layerId).layer,w.checked?E.push(C):w.checked||j.push(C);for(V=0;V=0;j--)w=p[j],C=this._getLayer(w.layerId).layer,w.disabled=C.options.minZoom!==void 0&&EC.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",un),this.expand();var w=this;setTimeout(function(){Wt(p,"click",un),w._preventClick=!1})}}),xae=function(p,w,C){return new l5(p,w,C)},gA=ba.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(p){var w="leaflet-control-zoom",C=Tt("div",w+" leaflet-bar"),E=this.options;return this._zoomInButton=this._createButton(E.zoomInText,E.zoomInTitle,w+"-in",C,this._zoomIn),this._zoomOutButton=this._createButton(E.zoomOutText,E.zoomOutTitle,w+"-out",C,this._zoomOut),this._updateDisabled(),p.on("zoomend zoomlevelschange",this._updateDisabled,this),C},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,C,E,j){var V=Tt("a",C,E);return V.innerHTML=p,V.href="#",V.title=w,V.setAttribute("role","button"),V.setAttribute("aria-label",w),tp(V),st(V,"click",Tu),st(V,"click",j,this),st(V,"click",this._refocusOnMap,this),V},_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"))}});bt.mergeOptions({zoomControl:!0}),bt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new gA,this.addControl(this.zoomControl))});var _ae=function(p){return new gA(p)},u5=ba.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(p){var w="leaflet-control-scale",C=Tt("div",w),E=this.options;return this._addScales(E,w+"-line",C),p.on(E.updateWhenIdle?"moveend":"move",this._update,this),p.whenReady(this._update,this),C},onRemove:function(p){p.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(p,w,C){p.metric&&(this._mScale=Tt("div",w,C)),p.imperial&&(this._iScale=Tt("div",w,C))},_update:function(){var p=this._map,w=p.getSize().y/2,C=p.distance(p.containerPointToLatLng([0,w]),p.containerPointToLatLng([this.options.maxWidth,w]));this._updateScales(C)},_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),C=w<1e3?w+" m":w/1e3+" km";this._updateScale(this._mScale,C,w/p)},_updateImperial:function(p){var w=p*3.2808399,C,E,j;w>5280?(C=w/5280,E=this._getRoundNum(C),this._updateScale(this._iScale,E+" mi",E/C)):(j=this._getRoundNum(w),this._updateScale(this._iScale,j+" ft",j/w))},_updateScale:function(p,w,C){p.style.width=Math.round(this.options.maxWidth*C)+"px",p.innerHTML=w},_getRoundNum:function(p){var w=Math.pow(10,(Math.floor(p)+"").length-1),C=p/w;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:1,w*C}}),bae=function(p){return new u5(p)},wae='',mA=ba.extend({options:{position:"bottomright",prefix:''+(He.inlineSvg?wae+" ":"")+"Leaflet"},initialize:function(p){g(this,p),this._attributions={}},onAdd:function(p){p.attributionControl=this,this._container=Tt("div","leaflet-control-attribution"),tp(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 C=[];this.options.prefix&&C.push(this.options.prefix),p.length&&C.push(p.join(", ")),this._container.innerHTML=C.join(' ')}}});bt.mergeOptions({attributionControl:!0}),bt.addInitHook(function(){this.options.attributionControl&&new mA().addTo(this)});var Sae=function(p){return new mA(p)};ba.Layers=l5,ba.Zoom=gA,ba.Scale=u5,ba.Attribution=mA,rp.layers=xae,rp.zoom=_ae,rp.scale=bae,rp.attribution=Sae;var eo=B.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}});eo.addTo=function(p,w){return p.addHandler(w,this),this};var Tae={Events:F},c5=He.touch?"touchstart mousedown":"mousedown",Js=G.extend({options:{clickTolerance:3},initialize:function(p,w,C,E){g(this,E),this._element=p,this._dragStartTarget=w||p,this._preventOutline=C},enable:function(){this._enabled||(st(this._dragStartTarget,c5,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Js._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,!nA(this._element,"leaflet-zoom-anim"))){if(p.touches&&p.touches.length!==1){Js._dragging===this&&this.finishDrag();return}if(!(Js._dragging||p.shiftKey||p.which!==1&&p.button!==1&&!p.touches)&&(Js._dragging=this,this._preventOutline&&uA(this._element),oA(),Qv(),!this._moving)){this.fire("down");var w=p.touches?p.touches[0]:p,C=r5(this._element);this._startPoint=new z(w.clientX,w.clientY),this._startPos=wu(this._element),this._parentScale=cA(C);var E=p.type==="mousedown";st(document,E?"mousemove":"touchmove",this._onMove,this),st(document,E?"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,C=new z(w.clientX,w.clientY)._subtract(this._startPoint);!C.x&&!C.y||Math.abs(C.x)+Math.abs(C.y)V&&(X=te,V=oe);V>C&&(w[X]=1,xA(p,w,C,E,X),xA(p,w,C,X,j))}function Pae(p,w){for(var C=[p[0]],E=1,j=0,V=p.length;Ew&&(C.push(p[E]),j=E);return jw.max.x&&(C|=2),p.yw.max.y&&(C|=8),C}function Lae(p,w){var C=w.x-p.x,E=w.y-p.y;return C*C+E*E}function np(p,w,C,E){var j=w.x,V=w.y,X=C.x-j,te=C.y-V,oe=X*X+te*te,he;return oe>0&&(he=((p.x-j)*X+(p.y-V)*te)/oe,he>1?(j=C.x,V=C.y):he>0&&(j+=X*he,V+=te*he)),X=p.x-j,te=p.y-V,E?X*X+te*te:new z(j,V)}function Bi(p){return!b(p[0])||typeof p[0][0]!="object"&&typeof p[0][0]<"u"}function m5(p){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Bi(p)}function y5(p,w){var C,E,j,V,X,te,oe,he;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=ge([0,0]),et=ae(p),pt=et.getNorthWest().distanceTo(et.getSouthWest())*et.getNorthEast().distanceTo(et.getNorthWest());pt<1700&&(Ee=yA(p));var Rn=p.length,Kr=[];for(C=0;CE){oe=(V-E)/j,he=[te.x-oe*(te.x-X.x),te.y-oe*(te.y-X.y)];break}var ei=w.unproject(H(he));return ge([ei.lat+Ee.lat,ei.lng+Ee.lng])}var kae={__proto__:null,simplify:d5,pointToSegmentDistance:v5,closestPointOnSegment:Cae,clipSegment:g5,_getEdgeIntersection:k0,_getBitCode:Au,_sqClosestPointOnSegment:np,isFlat:Bi,_flat:m5,polylineCenter:y5},_A={project:function(p){return new z(p.lng,p.lat)},unproject:function(p){return new ce(p.y,p.x)},bounds:new Y([-180,-90],[180,90])},bA={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Y([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(p){var w=Math.PI/180,C=this.R,E=p.lat*w,j=this.R_MINOR/C,V=Math.sqrt(1-j*j),X=V*Math.sin(E),te=Math.tan(Math.PI/4-E/2)/Math.pow((1-X)/(1+X),V/2);return E=-C*Math.log(Math.max(te,1e-10)),new z(p.lng*w*C,E)},unproject:function(p){for(var w=180/Math.PI,C=this.R,E=this.R_MINOR/C,j=Math.sqrt(1-E*E),V=Math.exp(-p.y/C),X=Math.PI/2-2*Math.atan(V),te=0,oe=.1,he;te<15&&Math.abs(oe)>1e-7;te++)he=j*Math.sin(X),he=Math.pow((1-he)/(1+he),j/2),oe=Math.PI/2-2*Math.atan(V*he)-X,X+=oe;return new ce(X*w,p.x*w/C)}},Iae={__proto__:null,LonLat:_A,Mercator:bA,SphericalMercator:fe},Oae=i({},xe,{code:"EPSG:3395",projection:bA,transformation:function(){var p=.5/(Math.PI*bA.R);return ee(p,.5,-p,.5)}()}),x5=i({},xe,{code:"EPSG:4326",projection:_A,transformation:ee(1/180,1,-1/180,.5)}),Eae=i({},Ge,{projection:_A,transformation:ee(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 C=w.lng-p.lng,E=w.lat-p.lat;return Math.sqrt(C*C+E*E)},infinite:!0});Ge.Earth=xe,Ge.EPSG3395=Oae,Ge.EPSG3857=$e,Ge.EPSG900913=Se,Ge.EPSG4326=x5,Ge.Simple=Eae;var wa=G.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 C=this.getEvents();w.on(C,this),this.once("remove",function(){w.off(C,this)},this)}this.onAdd(w),this.fire("add"),w.fire("layeradd",{layer:this})}}});bt.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 C in this._layers)p.call(w,this._layers[C]);return this},_addLayers:function(p){p=p?b(p)?p:[p]:[];for(var w=0,C=p.length;wthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&w[0]instanceof ce&&w[0].equals(w[C-1])&&w.pop(),w},_setLatLngs:function(p){qo.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,C=new z(w,w);if(p=new Y(p.min.subtract(C),p.max.add(C)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(p))){if(this.options.noClip){this._parts=this._rings;return}for(var E=0,j=this._rings.length,V;Ep.y!=j.y>p.y&&p.x<(j.x-E.x)*(p.y-E.y)/(j.y-E.y)+E.x&&(w=!w);return w||qo.prototype._containsPoint.call(this,p,!0)}});function Fae(p,w){return new Nf(p,w)}var Ko=Xo.extend({initialize:function(p,w){g(this,w),this._layers={},p&&this.addData(p)},addData:function(p){var w=b(p)?p:p.features,C,E,j;if(w){for(C=0,E=w.length;C0&&j.push(j[0].slice()),j}function jf(p,w){return p.feature?i({},p.feature,{geometry:w}):j0(w)}function j0(p){return p.type==="Feature"||p.type==="FeatureCollection"?p:{type:"Feature",properties:{},geometry:p}}var AA={toGeoJSON:function(p){return jf(this,{type:"Point",coordinates:TA(this.getLatLng(),p)})}};I0.include(AA),wA.include(AA),O0.include(AA),qo.include({toGeoJSON:function(p){var w=!Bi(this._latlngs),C=N0(this._latlngs,w?1:0,!1,p);return jf(this,{type:(w?"Multi":"")+"LineString",coordinates:C})}}),Nf.include({toGeoJSON:function(p){var w=!Bi(this._latlngs),C=w&&!Bi(this._latlngs[0]),E=N0(this._latlngs,C?2:w?1:0,!0,p);return w||(E=[E]),jf(this,{type:(C?"Multi":"")+"Polygon",coordinates:E})}}),Ef.include({toMultiPoint:function(p){var w=[];return this.eachLayer(function(C){w.push(C.toGeoJSON(p).geometry.coordinates)}),jf(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 C=w==="GeometryCollection",E=[];return this.eachLayer(function(j){if(j.toGeoJSON){var V=j.toGeoJSON(p);if(C)E.push(V.geometry);else{var X=j0(V);X.type==="FeatureCollection"?E.push.apply(E,X.features):E.push(X)}}}),C?jf(this,{geometries:E,type:"GeometryCollection"}):{type:"FeatureCollection",features:E}}});function w5(p,w){return new Ko(p,w)}var Vae=w5,R0=wa.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(p,w,C){this._url=p,this._bounds=ae(w),g(this,C)},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(){ir(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&&If(this._image),this},bringToBack:function(){return this._map&&Of(this._image),this},setUrl:function(p){return this._url=p,this._image&&(this._image.src=p),this},setBounds:function(p){return this._bounds=ae(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:Tt("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),C=this._map._latLngBoundsToNewLayerBounds(this._bounds,p.zoom,p.center).min;bu(this._image,C,w)},_reset:function(){var p=this._image,w=new Y(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),C=w.getSize();Cr(p,w.min),p.style.width=C.x+"px",p.style.height=C.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()}}),Gae=function(p,w,C){return new R0(p,w,C)},S5=R0.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:Tt("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 C=w.getElementsByTagName("source"),E=[],j=0;j0?E:[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 V=0;Vj?(w.height=j+"px",ut(p,V)):_r(p,V),this._containerWidth=this._container.offsetWidth},_animateZoom:function(p){var w=this._map._latLngToNewLayerPoint(this._latlng,p.zoom,p.center),C=this._getAnchor();Cr(this._container,w.add(C))},_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(Kv(this._container,"marginBottom"),10)||0,C=this._container.offsetHeight+w,E=this._containerWidth,j=new z(this._containerLeft,-C-this._containerBottom);j._add(wu(this._container));var V=p.layerPointToContainerPoint(j),X=H(this.options.autoPanPadding),te=H(this.options.autoPanPaddingTopLeft||X),oe=H(this.options.autoPanPaddingBottomRight||X),he=p.getSize(),Ee=0,et=0;V.x+E+oe.x>he.x&&(Ee=V.x+E-he.x+oe.x),V.x-Ee-te.x<0&&(Ee=V.x-te.x),V.y+C+oe.y>he.y&&(et=V.y+C-he.y+oe.y),V.y-et-te.y<0&&(et=V.y-te.y),(Ee||et)&&(this.options.keepInView&&(this._autopanning=!0),p.fire("autopanstart").panBy([Ee,et]))}},_getAnchor:function(){return H(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Uae=function(p,w){return new B0(p,w)};bt.mergeOptions({closePopupOnClick:!0}),bt.include({openPopup:function(p,w,C){return this._initOverlay(B0,p,w,C).openOn(this),this},closePopup:function(p){return p=arguments.length?p:this._popup,p&&p.close(),this}}),wa.include({bindPopup:function(p,w){return this._popup=this._initOverlay(B0,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 Xo||(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)){Tu(p);var w=p.layer||p.target;if(this._popup._source===w&&!(w instanceof el)){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 z0=to.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(p){to.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){to.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=to.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=Tt("div",w),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(p){var w,C,E=this._map,j=this._container,V=E.latLngToContainerPoint(E.getCenter()),X=E.layerPointToContainerPoint(p),te=this.options.direction,oe=j.offsetWidth,he=j.offsetHeight,Ee=H(this.options.offset),et=this._getAnchor();te==="top"?(w=oe/2,C=he):te==="bottom"?(w=oe/2,C=0):te==="center"?(w=oe/2,C=he/2):te==="right"?(w=0,C=he/2):te==="left"?(w=oe,C=he/2):X.xthis.options.maxZoom||CE?this._retainParent(j,V,X,E):!1)},_retainChildren:function(p,w,C,E){for(var j=2*p;j<2*p+2;j++)for(var V=2*w;V<2*w+2;V++){var X=new z(j,V);X.z=C+1;var te=this._tileCoordsToKey(X),oe=this._tiles[te];if(oe&&oe.active){oe.retain=!0;continue}else oe&&oe.loaded&&(oe.retain=!0);C+1this.options.maxZoom||this.options.minZoom!==void 0&&j1){this._setView(p,C);return}for(var et=j.min.y;et<=j.max.y;et++)for(var pt=j.min.x;pt<=j.max.x;pt++){var Rn=new z(pt,et);if(Rn.z=this._tileZoom,!!this._isValidTile(Rn)){var Kr=this._tiles[this._tileCoordsToKey(Rn)];Kr?Kr.current=!0:X.push(Rn)}}if(X.sort(function(ei,Bf){return ei.distanceTo(V)-Bf.distanceTo(V)}),X.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var zi=document.createDocumentFragment();for(pt=0;ptC.max.x)||!w.wrapLat&&(p.yC.max.y))return!1}if(!this.options.bounds)return!0;var E=this._tileCoordsToBounds(p);return ae(this.options.bounds).overlaps(E)},_keyToBounds:function(p){return this._tileCoordsToBounds(this._keyToTileCoords(p))},_tileCoordsToNwSe:function(p){var w=this._map,C=this.getTileSize(),E=p.scaleBy(C),j=E.add(C),V=w.unproject(E,p.z),X=w.unproject(j,p.z);return[V,X]},_tileCoordsToBounds:function(p){var w=this._tileCoordsToNwSe(p),C=new J(w[0],w[1]);return this.options.noWrap||(C=this._map.wrapLatLngBounds(C)),C},_tileCoordsToKey:function(p){return p.x+":"+p.y+":"+p.z},_keyToTileCoords:function(p){var w=p.split(":"),C=new z(+w[0],+w[1]);return C.z=+w[2],C},_removeTile:function(p){var w=this._tiles[p];w&&(ir(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,He.ielt9&&this.options.opacity<1&&Ri(p,this.options.opacity)},_addTile:function(p,w){var C=this._getTilePos(p),E=this._tileCoordsToKey(p),j=this.createTile(this._wrapCoords(p),o(this._tileReady,this,p));this._initTile(j),this.createTile.length<2&&O(o(this._tileReady,this,p,null,j)),Cr(j,C),this._tiles[E]={el:j,coords:p,current:!0},w.appendChild(j),this.fire("tileloadstart",{tile:j,coords:p})},_tileReady:function(p,w,C){w&&this.fire("tileerror",{error:w,tile:C,coords:p});var E=this._tileCoordsToKey(p);C=this._tiles[E],C&&(C.loaded=+new Date,this._map._fadeAnimated?(Ri(C.el,0),D(this._fadeFrame),this._fadeFrame=O(this._updateOpacity,this)):(C.active=!0,this._pruneTiles()),w||(ut(C.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:C.el,coords:p})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),He.ielt9||!this._map._fadeAnimated?O(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 z(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 Y(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 Xae(p){return new ap(p)}var Rf=ap.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&&He.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 C=document.createElement("img");return st(C,"load",o(this._tileOnLoad,this,w,C)),st(C,"error",o(this._tileOnError,this,w,C)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(C.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(C.referrerPolicy=this.options.referrerPolicy),C.alt="",C.src=this.getTileUrl(p),C},getTileUrl:function(p){var w={r:He.retina?"@2x":"",s:this._getSubdomain(p),x:p.x,y:p.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var C=this._globalTileRange.max.y-p.y;this.options.tms&&(w.y=C),w["-y"]=C}return x(this._url,i(w,this.options))},_tileOnLoad:function(p,w){He.ielt9?setTimeout(o(p,this,null,w),0):p(null,w)},_tileOnError:function(p,w,C){var E=this.options.errorTileUrl;E&&w.getAttribute("src")!==E&&(w.src=E),p(C,w)},_onTileRemove:function(p){p.tile.onload=null},_getZoomForUrl:function(){var p=this._tileZoom,w=this.options.maxZoom,C=this.options.zoomReverse,E=this.options.zoomOffset;return C&&(p=w-p),p+E},_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 C=this._tiles[p].coords;ir(w),delete this._tiles[p],this.fire("tileabort",{tile:w,coords:C})}},_removeTile:function(p){var w=this._tiles[p];if(w)return w.el.setAttribute("src",T),ap.prototype._removeTile.call(this,p)},_tileReady:function(p,w,C){if(!(!this._map||C&&C.getAttribute("src")===T))return ap.prototype._tileReady.call(this,p,w,C)}});function C5(p,w){return new Rf(p,w)}var M5=Rf.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 C=i({},this.defaultWmsParams);for(var E in w)E in this.options||(C[E]=w[E]);w=g(this,w);var j=w.detectRetina&&He.retina?2:1,V=this.getTileSize();C.width=V.x*j,C.height=V.y*j,this.wmsParams=C},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,Rf.prototype.onAdd.call(this,p)},getTileUrl:function(p){var w=this._tileCoordsToNwSe(p),C=this._crs,E=Z(C.project(w[0]),C.project(w[1])),j=E.min,V=E.max,X=(this._wmsVersion>=1.3&&this._crs===x5?[j.y,j.x,V.y,V.x]:[j.x,j.y,V.x,V.y]).join(","),te=Rf.prototype.getTileUrl.call(this,p);return te+m(this.wmsParams,te,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+X},setParams:function(p,w){return i(this.wmsParams,p),w||this.redraw(),this}});function qae(p,w){return new M5(p,w)}Rf.WMS=M5,C5.wms=qae;var Qo=wa.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 C=this._map.getZoomScale(w,this._zoom),E=this._map.getSize().multiplyBy(.5+this.options.padding),j=this._map.project(this._center,w),V=E.multiplyBy(-C).add(j).subtract(this._map._getNewPixelOrigin(p,w));He.any3d?bu(this._container,V,C):Cr(this._container,V)},_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(),C=this._map.containerPointToLayerPoint(w.multiplyBy(-p)).round();this._bounds=new Y(C,C.add(w.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),P5=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,ir(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,C=p.getSize(),E=He.retina?2:1;Cr(w,p.min),w.width=E*C.x,w.height=E*C.y,w.style.width=C.x+"px",w.style.height=C.y+"px",He.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,C=w.next,E=w.prev;C?C.prev=E:this._drawLast=E,E?E.next=C:this._drawFirst=C,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(/[, ]+/),C=[],E,j;for(j=0;j')}}catch{}return function(p){return document.createElement("<"+p+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Kae={_initContainer:function(){this._container=Tt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Qo.prototype._update.call(this),this.fire("update"))},_initPath:function(p){var w=p._container=op("shape");ut(w,"leaflet-vml-shape "+(this.options.className||"")),w.coordsize="1 1",p._path=op("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;ir(w),p.removeInteractiveTarget(w),delete this._layers[l(p)]},_updateStyle:function(p){var w=p._stroke,C=p._fill,E=p.options,j=p._container;j.stroked=!!E.stroke,j.filled=!!E.fill,E.stroke?(w||(w=p._stroke=op("stroke")),j.appendChild(w),w.weight=E.weight+"px",w.color=E.color,w.opacity=E.opacity,E.dashArray?w.dashStyle=b(E.dashArray)?E.dashArray.join(" "):E.dashArray.replace(/( *, *)/g," "):w.dashStyle="",w.endcap=E.lineCap.replace("butt","flat"),w.joinstyle=E.lineJoin):w&&(j.removeChild(w),p._stroke=null),E.fill?(C||(C=p._fill=op("fill")),j.appendChild(C),C.color=E.fillColor||E.color,C.opacity=E.fillOpacity):C&&(j.removeChild(C),p._fill=null)},_updateCircle:function(p){var w=p._point.round(),C=Math.round(p._radius),E=Math.round(p._radiusY||C);this._setPath(p,p._empty()?"M0 0":"AL "+w.x+","+w.y+" "+C+","+E+" 0,"+65535*360)},_setPath:function(p,w){p._path.v=w},_bringToFront:function(p){If(p._container)},_bringToBack:function(p){Of(p._container)}},$0=He.vml?op:Fe,sp=Qo.extend({_initContainer:function(){this._container=$0("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=$0("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ir(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(),C=this._container;(!this._svgSize||!this._svgSize.equals(w))&&(this._svgSize=w,C.setAttribute("width",w.x),C.setAttribute("height",w.y)),Cr(C,p.min),C.setAttribute("viewBox",[p.min.x,p.min.y,w.x,w.y].join(" ")),this.fire("update")}},_initPath:function(p){var w=p._path=$0("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){ir(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,C=p.options;w&&(C.stroke?(w.setAttribute("stroke",C.color),w.setAttribute("stroke-opacity",C.opacity),w.setAttribute("stroke-width",C.weight),w.setAttribute("stroke-linecap",C.lineCap),w.setAttribute("stroke-linejoin",C.lineJoin),C.dashArray?w.setAttribute("stroke-dasharray",C.dashArray):w.removeAttribute("stroke-dasharray"),C.dashOffset?w.setAttribute("stroke-dashoffset",C.dashOffset):w.removeAttribute("stroke-dashoffset")):w.setAttribute("stroke","none"),C.fill?(w.setAttribute("fill",C.fillColor||C.color),w.setAttribute("fill-opacity",C.fillOpacity),w.setAttribute("fill-rule",C.fillRule||"evenodd")):w.setAttribute("fill","none"))},_updatePoly:function(p,w){this._setPath(p,Ye(p._parts,w))},_updateCircle:function(p){var w=p._point,C=Math.max(Math.round(p._radius),1),E=Math.max(Math.round(p._radiusY),1)||C,j="a"+C+","+E+" 0 1,0 ",V=p._empty()?"M0 0":"M"+(w.x-C)+","+w.y+j+C*2+",0 "+j+-C*2+",0 ";this._setPath(p,V)},_setPath:function(p,w){p._path.setAttribute("d",w)},_bringToFront:function(p){If(p._path)},_bringToBack:function(p){Of(p._path)}});He.vml&&sp.include(Kae);function k5(p){return He.svg||He.vml?new sp(p):null}bt.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&&L5(p)||k5(p)}});var I5=Nf.extend({initialize:function(p,w){Nf.prototype.initialize.call(this,this._boundsToLatLngs(p),w)},setBounds:function(p){return this.setLatLngs(this._boundsToLatLngs(p))},_boundsToLatLngs:function(p){return p=ae(p),[p.getSouthWest(),p.getNorthWest(),p.getNorthEast(),p.getSouthEast()]}});function Qae(p,w){return new I5(p,w)}sp.create=$0,sp.pointsToPath=Ye,Ko.geometryToLayer=E0,Ko.coordsToLatLng=SA,Ko.coordsToLatLngs=D0,Ko.latLngToCoords=TA,Ko.latLngsToCoords=N0,Ko.getFeature=jf,Ko.asFeature=j0,bt.mergeOptions({boxZoom:!0});var O5=eo.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(){ir(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(),Qv(),oA(),this._startPoint=this._map.mouseEventToContainerPoint(p),st(document,{contextmenu:Tu,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(p){this._moved||(this._moved=!0,this._box=Tt("div","leaflet-zoom-box",this._container),ut(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(p);var w=new Y(this._point,this._startPoint),C=w.getSize();Cr(this._box,w.min),this._box.style.width=C.x+"px",this._box.style.height=C.y+"px"},_finish:function(){this._moved&&(ir(this._box),_r(this._container,"leaflet-crosshair")),Jv(),sA(),Wt(document,{contextmenu:Tu,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 J(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())}});bt.addInitHook("addHandler","boxZoom",O5),bt.mergeOptions({doubleClickZoom:!0});var E5=eo.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,C=w.getZoom(),E=w.options.zoomDelta,j=p.originalEvent.shiftKey?C-E:C+E;w.options.doubleClickZoom==="center"?w.setZoom(j):w.setZoomAround(p.containerPoint,j)}});bt.addInitHook("addHandler","doubleClickZoom",E5),bt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var D5=eo.extend({addHooks:function(){if(!this._draggable){var p=this._map;this._draggable=new Js(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=ae(this._map.options.maxBounds);this._offsetLimit=Z(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,C=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(C),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),C=this._initialWorldOffset,E=this._draggable._newPos.x,j=(E-w+C)%p+w-C,V=(E+w+C)%p-w-C,X=Math.abs(j+C)0?V:-V))-w;this._delta=0,this._startTime=null,X&&(p.options.scrollWheelZoom==="center"?p.setZoom(w+X):p.setZoomAround(this._lastMousePos,w+X))}});bt.addInitHook("addHandler","scrollWheelZoom",j5);var Jae=600;bt.mergeOptions({tapHold:He.touchNative&&He.safari&&He.mobile,tapTolerance:15});var R5=eo.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 z(w.clientX,w.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(st(document,"touchend",un),st(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",w))},this),Jae),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function p(){Wt(document,"touchend",un),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 z(w.clientX,w.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(p,w){var C=new MouseEvent(p,{bubbles:!0,cancelable:!0,view:window,screenX:w.screenX,screenY:w.screenY,clientX:w.clientX,clientY:w.clientY});C._simulated=!0,w.target.dispatchEvent(C)}});bt.addInitHook("addHandler","tapHold",R5),bt.mergeOptions({touchZoom:He.touch,bounceAtZoomLimits:!0});var B5=eo.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 C=w.mouseEventToContainerPoint(p.touches[0]),E=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(C.add(E)._divideBy(2))),this._startDist=C.distanceTo(E),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),un(p)}},_onTouchMove:function(p){if(!(!p.touches||p.touches.length!==2||!this._zooming)){var w=this._map,C=w.mouseEventToContainerPoint(p.touches[0]),E=w.mouseEventToContainerPoint(p.touches[1]),j=C.distanceTo(E)/this._startDist;if(this._zoom=w.getScaleZoom(j,this._startZoom),!w.options.bounceAtZoomLimits&&(this._zoomw.getMaxZoom()&&j>1)&&(this._zoom=w._limitZoom(this._zoom)),w.options.touchZoom==="center"){if(this._center=this._startLatLng,j===1)return}else{var V=C._add(E)._divideBy(2)._subtract(this._centerPoint);if(j===1&&V.x===0&&V.y===0)return;this._center=w.unproject(w.project(this._pinchStartLatLng,this._zoom).subtract(V),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=O(X,this,!0),un(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))}});bt.addInitHook("addHandler","touchZoom",B5),bt.BoxZoom=O5,bt.DoubleClickZoom=E5,bt.Drag=D5,bt.Keyboard=N5,bt.ScrollWheelZoom=j5,bt.TapHold=R5,bt.TouchZoom=B5,r.Bounds=Y,r.Browser=He,r.CRS=Ge,r.Canvas=P5,r.Circle=wA,r.CircleMarker=O0,r.Class=B,r.Control=ba,r.DivIcon=A5,r.DivOverlay=to,r.DomEvent=mae,r.DomUtil=pae,r.Draggable=Js,r.Evented=G,r.FeatureGroup=Xo,r.GeoJSON=Ko,r.GridLayer=ap,r.Handler=eo,r.Icon=Df,r.ImageOverlay=R0,r.LatLng=ce,r.LatLngBounds=J,r.Layer=wa,r.LayerGroup=Ef,r.LineUtil=kae,r.Map=bt,r.Marker=I0,r.Mixin=Tae,r.Path=el,r.Point=z,r.PolyUtil=Aae,r.Polygon=Nf,r.Polyline=qo,r.Popup=B0,r.PosAnimation=s5,r.Projection=Iae,r.Rectangle=I5,r.Renderer=Qo,r.SVG=sp,r.SVGOverlay=T5,r.TileLayer=Rf,r.Tooltip=z0,r.Transformation=le,r.Util=N,r.VideoOverlay=S5,r.bind=o,r.bounds=Z,r.canvas=L5,r.circle=zae,r.circleMarker=Bae,r.control=rp,r.divIcon=Yae,r.extend=i,r.featureGroup=Nae,r.geoJSON=w5,r.geoJson=Vae,r.gridLayer=Xae,r.icon=jae,r.imageOverlay=Gae,r.latLng=ge,r.latLngBounds=ae,r.layerGroup=Dae,r.map=yae,r.marker=Rae,r.point=H,r.polygon=Fae,r.polyline=$ae,r.popup=Uae,r.rectangle=Qae,r.setOptions=g,r.stamp=l,r.svg=k5,r.svgOverlay=Hae,r.tileLayer=C5,r.tooltip=Zae,r.transformation=ee,r.version=n,r.videoOverlay=Wae;var eoe=window.L;r.noConflict=function(){return window.L=eoe,this},window.L=r})})(zO,zO.exports);var Pf=zO.exports;const Bie=$t(Pf);function b0(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function NR(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 zie(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 zQe(e){return function(r){const n=qT(),i=e(KT(r,n),n);return Die(n.map,r.attribution),DR(i.current,r.eventHandlers),zie(i.current,n),i}}function $Qe(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 FQe(e){return function(r){const n=qT(),i=e(KT(r,n),n);return DR(i.current,r.eventHandlers),zie(i.current,n),$Qe(i.current,r),i}}function $ie(e,t){const r=NR(e),n=BQe(r,t);return jQe(n)}function Fie(e,t){const r=NR(e,t),n=FQe(r);return NQe(n)}function VQe(e,t){const r=NR(e,t),n=zQe(r);return RQe(n)}function GQe(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 WQe(){return qT().map}const HQe=Fie(function({center:t,children:r,...n},i){const a=new Pf.CircleMarker(t,n);return b0(a,Nie(i,{overlayContainer:a}))},OQe);function $O(){return $O=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 x=new Pf.Map(y,c);r!=null&&u!=null?x.setView(r,u):e!=null&&x.fitBounds(e,t),l!=null&&x.whenReady(l),v(DQe(x))}},[]);W.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const m=d?Q.createElement(Rie,{value:d},n):o??null;return Q.createElement("div",$O({},h,{ref:g}),m)}const ZQe=W.forwardRef(UQe),YQe=Fie(function({positions:t,...r},n){const i=new Pf.Polyline(t,r);return b0(i,Nie(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),XQe=$ie(function(t,r){const n=new Pf.Popup(t,r.overlayContainer);return b0(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])}),qQe=VQe(function({url:t,...r},n){const i=new Pf.TileLayer(t,KT(r,n));return b0(i,n)},function(t,r,n){GQe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),KQe=$ie(function(t,r){const n=new Pf.Tooltip(t,r.overlayContainer);return b0(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])}),QQe="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=",JQe="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==",eJe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete Bie.Icon.Default.prototype._getIconUrl;Bie.Icon.Default.mergeOptions({iconUrl:QQe,iconRetinaUrl:JQe,shadowUrl:eJe});const EU=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],tJe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function rJe(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function nJe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function iJe(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 aJe({bounds:e}){const t=WQe();return W.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function oJe({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 _.jsxs("div",{className:"min-w-[200px]",children:[_.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),_.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),_.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[_.jsx("div",{className:"text-slate-500",children:"Role"}),_.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),_.jsx("div",{className:"text-slate-500",children:"Hardware"}),_.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),_.jsx("div",{className:"text-slate-500",children:"Battery"}),_.jsx("div",{className:"text-slate-700",children:r}),_.jsx("div",{className:"text-slate-500",children:"Last Heard"}),_.jsx("div",{className:"text-slate-700",children:iJe(e.last_heard)})]}),t&&_.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[_.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:[_.jsx(yd,{size:10}),"Google Maps"]}),_.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:[_.jsx(yd,{size:10}),"OSM"]})]})]})}function sJe({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 _.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[_.jsxs(ZQe,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[_.jsx(qQe,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© OpenStreetMap, © CARTO'}),_.jsx(aJe,{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 _.jsx(YQe,{positions:[[d.latitude,d.longitude],[v.latitude,v.longitude]],color:rJe(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=tJe.includes(f.role),m=nJe(f.latitude),y=EU[m%EU.length];return _.jsxs(HQe,{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:[_.jsx(KQe,{direction:"top",offset:[0,-8],children:_.jsx("span",{className:"font-mono text-xs",children:f.short_name})}),_.jsx(XQe,{children:_.jsx(oJe,{node:f})})]},f.node_num)})]}),_.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:[_.jsx(bZ,{size:12}),_.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&_.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const DU=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],lJe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function NU(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function uJe(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function cJe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function fJe(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function hJe(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 dJe(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 vJe({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 _.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:[_.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:_.jsx(eu,{size:24,className:"text-slate-500"})}),_.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=lJe.includes(e.role),o=cJe(e.latitude),s=DU[o%DU.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 _.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[_.jsxs("div",{className:"p-4 border-b border-border",children:[_.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}),_.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),_.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),_.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[_.jsxs("div",{children:[_.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),_.jsx("div",{className:`text-sm font-medium ${a?"text-cyan-400":"text-slate-300"}`,children:e.role})]}),_.jsxs("div",{children:[_.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),_.jsx("div",{className:"text-sm text-slate-300",children:fJe(o)})]}),_.jsxs("div",{children:[_.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),_.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&_.jsx(wm,{size:12,className:"text-amber-400"}),u]})]}),_.jsxs("div",{children:[_.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx("div",{className:`w-2 h-2 rounded-full ${dJe(e.last_heard)}`}),_.jsx("span",{className:"text-sm text-slate-300",children:hJe(e.last_heard)})]})]}),_.jsxs("div",{className:"col-span-2",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),_.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&_.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[_.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:[_.jsx(yd,{size:10}),"Google Maps"]}),_.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:[_.jsx(yd,{size:10}),"OSM"]})]}),_.jsxs("div",{className:"flex-1 overflow-y-auto",children:[_.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?_.jsx("div",{className:"divide-y divide-border",children:i.map(f=>_.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:NU(f.snr)},children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:f.node.short_name}),_.jsx("div",{className:"text-xs text-slate-500 truncate",children:f.node.long_name})]}),_.jsxs("div",{className:"text-right flex-shrink-0",children:[_.jsxs("div",{className:"text-xs font-mono",style:{color:NU(f.snr)},children:[f.snr.toFixed(1)," dB"]}),_.jsx("div",{className:"text-xs text-slate-500",children:uJe(f.snr)})]})]},f.node.node_num))}):_.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const jU=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function pJe(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 gJe(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 mJe(e){return e.battery_level===null?"—":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`}function RU(e){return e===null?"—":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function yJe({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=>jU.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)||RU(m.latitude).toLowerCase().includes(g))}return v.sort((g,m)=>{let y="",x="";switch(a){case"short_name":y=g.short_name.toLowerCase(),x=m.short_name.toLowerCase();break;case"role":y=g.role,x=m.role;break;case"battery_level":y=g.battery_level??-1,x=m.battery_level??-1;break;case"last_heard":y=g.last_heard?new Date(g.last_heard).getTime():0,x=m.last_heard?new Date(m.last_heard).getTime():0;break;case"hardware":y=g.hardware.toLowerCase(),x=m.hardware.toLowerCase();break}return yx?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"?_.jsx(Zue,{size:14,className:"inline ml-1"}):_.jsx(Wy,{size:14,className:"inline ml-1"});return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg overflow-hidden",children:[_.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[_.jsxs("div",{className:"relative flex-1 max-w-xs",children:[_.jsx(HE,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),_.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"})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(FE,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(v=>_.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))]}),_.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[f.length," of ",e.length," nodes"]})]}),_.jsxs("div",{className:"overflow-x-auto",children:[_.jsxs("table",{className:"w-full text-sm",children:[_.jsx("thead",{children:_.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[_.jsx("th",{className:"w-8 px-3 py-2"}),_.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("short_name"),children:["Name ",_.jsx(d,{field:"short_name"})]}),_.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("role"),children:["Role ",_.jsx(d,{field:"role"})]}),_.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),_.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("battery_level"),children:["Battery ",_.jsx(d,{field:"battery_level"})]}),_.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("last_heard"),children:["Last Heard ",_.jsx(d,{field:"last_heard"})]}),_.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("hardware"),children:["Hardware ",_.jsx(d,{field:"hardware"})]})]})}),_.jsx("tbody",{className:"divide-y divide-border",children:f.slice(0,100).map(v=>{const g=jU.includes(v.role),m=v.node_num===t;return _.jsxs("tr",{onClick:()=>r(v.node_num),className:`cursor-pointer transition-colors ${m?"bg-accent/10":"hover:bg-bg-hover"}`,children:[_.jsx("td",{className:"px-3 py-2",children:_.jsx("div",{className:`w-2 h-2 rounded-full ${pJe(v.last_heard)}`})}),_.jsxs("td",{className:"px-3 py-2",children:[_.jsx("div",{className:"font-mono text-slate-200",children:v.short_name}),_.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:v.long_name})]}),_.jsx("td",{className:"px-3 py-2",children:_.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})}),_.jsx("td",{className:"px-3 py-2 text-slate-400",children:RU(v.latitude)}),_.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:mJe(v)}),_.jsx("td",{className:"px-3 py-2 text-slate-400",children:gJe(v.last_heard)}),_.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&&_.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&&_.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function xJe(){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([oce(),sce(),gce()]).then(([m,y,x])=>{t(m),n(y),a(x),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?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):h?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsxs("div",{className:"text-red-400",children:["Error: ",h]})}):_.jsxs("div",{className:"space-y-6",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes • ",r.length," edges"]}),_.jsxs("div",{className:"flex items-center bg-bg-card border border-border rounded-lg p-1",children:[_.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:[_.jsx(tce,{size:14}),"Topology"]}),_.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:[_.jsx(Que,{size:14}),"Geographic"]})]})]}),_.jsxs("div",{className:"flex gap-0",children:[_.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?_.jsx(IQe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:g}):_.jsx(sJe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:g})}),_.jsx(vJe,{node:v,edges:r,nodes:e,onSelectNode:g})]}),_.jsx(yJe,{nodes:e,selectedNodeId:o,onSelectNode:g})]})}function _Je({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=i=>i?new Date(i*1e3).toLocaleTimeString():"Never";return _.jsxs("div",{className:"bg-bg-hover rounded-lg p-4",children:[_.jsxs("div",{className:"flex items-center justify-between mb-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),_.jsx("span",{className:"text-sm font-medium text-slate-200 uppercase",children:e.source})]}),_.jsx("span",{className:"text-xs text-slate-400",children:r()})]}),_.jsxs("div",{className:"text-xs text-slate-500 space-y-1",children:[_.jsxs("div",{children:["Events: ",e.event_count]}),_.jsxs("div",{children:["Last fetch: ",n(e.last_fetch)]}),e.last_error&&_.jsx("div",{className:"text-amber-500 truncate",children:e.last_error})]})]})}function bJe({event:e}){const r=(a=>{switch(a.toLowerCase()){case"extreme":case"severe":return{bg:"bg-red-500/10",border:"border-red-500",icon:Hy,iconColor:"text-red-500"};case"moderate":case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:Ds,iconColor:"text-amber-500"};case"minor":return{bg:"bg-yellow-500/10",border:"border-yellow-500",icon:bm,iconColor:"text-yellow-500"};default:return{bg:"bg-slate-500/10",border:"border-slate-500",icon:bm,iconColor:"text-slate-400"}}})(e.severity),n=r.icon,i=a=>a?new Date(a*1e3).toLocaleString():null;return _.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-2 ${r.border}`,children:_.jsxs("div",{className:"flex items-start gap-3",children:[_.jsx(n,{size:18,className:r.iconColor}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_.jsx("span",{className:"text-sm font-medium text-slate-200",children:e.event_type}),_.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${r.bg} ${r.iconColor}`,children:e.severity})]}),_.jsx("div",{className:"text-sm text-slate-300 mb-2",children:e.headline}),e.description&&_.jsx("div",{className:"text-xs text-slate-400 mb-2 line-clamp-2",children:e.description}),_.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[_.jsx("span",{className:"uppercase",children:e.source}),e.expires&&_.jsxs("span",{children:["Expires: ",i(e.expires)]})]})]})]})})}function wJe({swpc:e}){var n,i;if(!e||!e.enabled)return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(Fb,{size:14}),"Solar/Geomagnetic Indices"]}),_.jsx("div",{className:"text-slate-500",children:"Data not available"})]});const t=a=>a===void 0?"text-slate-400":a<=2?"text-green-500":a<=4?"text-amber-500":a<=6?"text-orange-500":"text-red-500",r=a=>a===void 0||a===0?"text-green-500":a<=2?"text-amber-500":a<=3?"text-orange-500":"text-red-500";return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(Fb,{size:14}),"Solar/Geomagnetic Indices"]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[_.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Solar Flux Index"}),_.jsx("div",{className:"text-2xl font-mono text-slate-100",children:((n=e.sfi)==null?void 0:n.toFixed(0))??"—"}),_.jsx("div",{className:"text-xs text-slate-500",children:"SFI (10.7 cm)"})]}),_.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Planetary K-Index"}),_.jsx("div",{className:`text-2xl font-mono ${t(e.kp_current)}`,children:((i=e.kp_current)==null?void 0:i.toFixed(1))??"—"}),_.jsx("div",{className:"text-xs text-slate-500",children:"Kp"})]})]}),_.jsxs("div",{className:"bg-bg-hover rounded-lg p-3 mb-4",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-2",children:"NOAA Space Weather Scales"}),_.jsxs("div",{className:"flex items-center gap-4",children:[_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx("span",{className:"text-xs text-slate-400",children:"R:"}),_.jsx("span",{className:`text-sm font-mono ${r(e.r_scale)}`,children:e.r_scale??0})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx("span",{className:"text-xs text-slate-400",children:"S:"}),_.jsx("span",{className:`text-sm font-mono ${r(e.s_scale)}`,children:e.s_scale??0})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx("span",{className:"text-xs text-slate-400",children:"G:"}),_.jsx("span",{className:`text-sm font-mono ${r(e.g_scale)}`,children:e.g_scale??0})]})]}),_.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Radio Blackout / Solar Radiation / Geomagnetic Storm"})]}),e.active_warnings&&e.active_warnings.length>0&&_.jsxs("div",{className:"space-y-2",children:[_.jsx("div",{className:"text-xs text-slate-500",children:"Active Warnings"}),e.active_warnings.slice(0,3).map((a,o)=>_.jsx("div",{className:"text-xs text-amber-400 bg-amber-500/10 rounded p-2",children:a},o))]})]})}function SJe({ducting:e}){if(!e||!e.enabled)return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(s3,{size:14}),"Tropospheric Ducting"]}),_.jsx("div",{className:"text-slate-500",children:"Data not available"})]});const t=n=>{switch(n){case"normal":return"text-green-500";case"super_refraction":return"text-amber-500";case"surface_duct":case"elevated_duct":return"text-blue-400";default:return"text-slate-400"}},r=n=>n?n.replace("_"," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown";return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(s3,{size:14}),"Tropospheric Ducting"]}),_.jsxs("div",{className:"bg-bg-hover rounded-lg p-4 mb-4",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Condition"}),_.jsx("div",{className:`text-xl font-medium ${t(e.condition)}`,children:r(e.condition)})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[_.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Min Gradient"}),_.jsx("div",{className:"text-lg font-mono text-slate-100",children:e.min_gradient??"—"}),_.jsx("div",{className:"text-xs text-slate-500",children:"M-units/km"})]}),e.duct_thickness_m&&_.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Duct Thickness"}),_.jsx("div",{className:"text-lg font-mono text-slate-100",children:e.duct_thickness_m}),_.jsx("div",{className:"text-xs text-slate-500",children:"meters"})]}),e.duct_base_m&&_.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Duct Base"}),_.jsx("div",{className:"text-lg font-mono text-slate-100",children:e.duct_base_m}),_.jsx("div",{className:"text-xs text-slate-500",children:"meters AGL"})]})]}),_.jsxs("div",{className:"text-xs text-slate-500 bg-bg-hover rounded p-2",children:[_.jsx("div",{children:"dM/dz reference:"}),_.jsxs("div",{className:"mt-1 space-y-0.5",children:[_.jsx("div",{children:">79: Normal propagation"}),_.jsx("div",{children:"0–79: Super-refraction"}),_.jsx("div",{children:"<0: Ducting (trapping layer)"})]})]}),e.last_update&&_.jsxs("div",{className:"text-xs text-slate-500 mt-3",children:["Last update: ",e.last_update]})]})}function TJe(){var I;const[e,t]=W.useState(null),[r,n]=W.useState([]),[i,a]=W.useState(null),[o,s]=W.useState(null),[l,u]=W.useState([]),[c,f]=W.useState(null),[h,d]=W.useState([]),[v,g]=W.useState([]),[m,y]=W.useState([]),[x,b]=W.useState([]),[S,T]=W.useState(0),[A,M]=W.useState(!0),[P,k]=W.useState(null);return W.useEffect(()=>{document.title="Environment — MeshAI",Promise.all([LZ().catch(()=>null),kZ().catch(()=>[]),IZ().catch(()=>null),OZ().catch(()=>null),cce().catch(()=>[]),fce().catch(()=>null),hce().catch(()=>[]),dce().catch(()=>[]),vce().catch(()=>[]),pce().catch(()=>({hotspots:[],new_ignitions:0}))]).then(([O,D,N,B,$,F,G,z,U,H])=>{t(O),n(D),a(N),s(B),u($),f(F),d(G||[]),g(z||[]),y(U||[]),b((H==null?void 0:H.hotspots)||[]),T((H==null?void 0:H.new_ignitions)||0),M(!1)}).catch(O=>{k(O.message),M(!1)})},[]),A?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsx("div",{className:"text-slate-400",children:"Loading environmental data..."})}):P?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsxs("div",{className:"text-red-400",children:["Error: ",P]})}):e!=null&&e.enabled?_.jsxs("div",{className:"space-y-6",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("h1",{className:"text-xl font-semibold text-slate-200",children:"Environment"}),_.jsxs("div",{className:"text-xs text-slate-500",children:[r.length," active event",r.length!==1?"s":""]})]}),_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(Gy,{size:14}),"Feed Status"]}),_.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:e.feeds.map(O=>_.jsx(_Je,{feed:O},O.source))})]}),_.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[_.jsx(wJe,{swpc:i}),_.jsx(SJe,{ducting:o})]}),_.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(VE,{size:14}),"Active Wildfires (",l.length,")"]}),l.length>0?_.jsx("div",{className:"space-y-3",children:l.map(O=>_.jsxs("div",{className:`p-3 rounded-lg ${O.severity==="warning"?"bg-red-500/10 border-l-2 border-red-500":O.severity==="watch"?"bg-amber-500/10 border-l-2 border-amber-500":"bg-slate-500/10 border-l-2 border-slate-500"}`,children:[_.jsxs("div",{className:"flex items-center justify-between mb-1",children:[_.jsx("span",{className:"text-sm font-medium text-slate-200",children:O.name}),_.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${O.severity==="warning"?"bg-red-500/20 text-red-400":O.severity==="watch"?"bg-amber-500/20 text-amber-400":"bg-slate-500/20 text-slate-400"}`,children:O.severity})]}),_.jsxs("div",{className:"text-xs text-slate-400 space-y-1",children:[_.jsxs("div",{children:[O.acres.toLocaleString()," acres, ",O.pct_contained,"% contained"]}),O.distance_km&&O.nearest_anchor&&_.jsxs("div",{children:[Math.round(O.distance_km)," km from ",O.nearest_anchor]})]})]},O.event_id))}):_.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[_.jsx(Kh,{size:16,className:"text-green-500"}),_.jsx("span",{children:"No active wildfires in the area"})]})]}),_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(GE,{size:14}),"Avalanche Advisories"]}),c!=null&&c.off_season?_.jsx("div",{className:"text-slate-500 py-4",children:_.jsx("p",{children:"Off season - check back in December"})}):c&&c.advisories.length>0?_.jsxs("div",{className:"space-y-3",children:[c.advisories.map(O=>_.jsxs("div",{className:`p-3 rounded-lg ${O.danger_level>=4?"bg-red-500/10 border-l-2 border-red-500":O.danger_level>=3?"bg-amber-500/10 border-l-2 border-amber-500":O.danger_level>=2?"bg-yellow-500/10 border-l-2 border-yellow-500":"bg-green-500/10 border-l-2 border-green-500"}`,children:[_.jsxs("div",{className:"flex items-center justify-between mb-1",children:[_.jsx("span",{className:"text-sm font-medium text-slate-200",children:O.zone_name}),_.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${O.danger_level>=4?"bg-red-500/20 text-red-400":O.danger_level>=3?"bg-amber-500/20 text-amber-400":O.danger_level>=2?"bg-yellow-500/20 text-yellow-400":"bg-green-500/20 text-green-400"}`,children:O.danger_name})]}),_.jsx("div",{className:"text-xs text-slate-400",children:O.center}),O.travel_advice&&_.jsx("div",{className:"text-xs text-slate-500 mt-2 line-clamp-2",children:O.travel_advice})]},O.event_id)),((I=c.advisories[0])==null?void 0:I.center_link)&&_.jsx("a",{href:c.advisories[0].center_link,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-400 hover:underline",children:"View full forecast"})]}):_.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[_.jsx(Kh,{size:16,className:"text-green-500"}),_.jsx("span",{children:"No avalanche advisories"})]})]})]}),h.length>0&&_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(zE,{size:14}),"Stream Gauges (",h.length,")"]}),_.jsx("div",{className:"space-y-2",children:h.map(O=>{var D,N,B,$,F;return _.jsxs("div",{className:`p-3 rounded-lg ${O.severity==="warning"?"bg-amber-500/10 border-l-2 border-amber-500":"bg-blue-500/10 border-l-2 border-blue-500"}`,children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("span",{className:"text-sm text-slate-200",children:((D=O.properties)==null?void 0:D.site_name)||"Unknown Site"}),_.jsxs("span",{className:"text-sm font-mono text-slate-300",children:[(B=(N=O.properties)==null?void 0:N.value)==null?void 0:B.toLocaleString()," ",($=O.properties)==null?void 0:$.unit]})]}),_.jsx("div",{className:"text-xs text-slate-500 mt-1",children:(F=O.properties)==null?void 0:F.parameter})]},O.event_id)})})]}),(v.length>0||m.length>0)&&_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(BE,{size:14}),"Road Conditions"]}),v.length>0&&_.jsxs("div",{className:"mb-4",children:[_.jsx("div",{className:"text-xs text-slate-500 mb-2 uppercase",children:"Traffic Flow"}),_.jsx("div",{className:"space-y-2",children:v.map(O=>{var D,N,B,$,F,G,z,U,H;return _.jsxs("div",{className:`p-3 rounded-lg ${(D=O.properties)!=null&&D.roadClosure?"bg-red-500/10 border-l-2 border-red-500":((N=O.properties)==null?void 0:N.speedRatio)<.5?"bg-amber-500/10 border-l-2 border-amber-500":((B=O.properties)==null?void 0:B.speedRatio)<.8?"bg-yellow-500/10 border-l-2 border-yellow-500":"bg-green-500/10 border-l-2 border-green-500"}`,children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("span",{className:"text-sm text-slate-200",children:(($=O.properties)==null?void 0:$.corridor)||"Unknown"}),_.jsx("span",{className:"text-sm font-mono text-slate-300",children:(F=O.properties)!=null&&F.roadClosure?"CLOSED":`${Math.round(((G=O.properties)==null?void 0:G.currentSpeed)||0)}mph`})]}),!((z=O.properties)!=null&&z.roadClosure)&&_.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[Math.round((((U=O.properties)==null?void 0:U.speedRatio)||1)*100),"% of free flow (",Math.round(((H=O.properties)==null?void 0:H.freeFlowSpeed)||0),"mph)"]})]},O.event_id)})})]}),m.length>0&&_.jsxs("div",{children:[_.jsx("div",{className:"text-xs text-slate-500 mb-2 uppercase",children:"Road Events"}),_.jsx("div",{className:"space-y-2",children:m.map(O=>{var D,N;return _.jsxs("div",{className:`p-3 rounded-lg ${(D=O.properties)!=null&&D.is_closure?"bg-red-500/10 border-l-2 border-red-500":"bg-amber-500/10 border-l-2 border-amber-500"}`,children:[_.jsxs("div",{className:"flex items-center gap-2",children:[((N=O.properties)==null?void 0:N.is_closure)&&_.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-red-500/20 text-red-400",children:"CLOSURE"}),_.jsx("span",{className:"text-sm text-slate-200 line-clamp-1",children:O.headline})]}),_.jsx("div",{className:"text-xs text-slate-500 mt-1 uppercase",children:O.event_type})]},O.event_id)})})]})]}),x.length>0&&_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(WE,{size:14}),"Satellite Hotspots (",x.length,")",S>0&&_.jsxs("span",{className:"ml-2 px-2 py-0.5 text-xs rounded-full bg-red-500/20 text-red-400 animate-pulse",children:[S," NEW"]})]}),_.jsx("div",{className:"space-y-2",children:x.map(O=>{var D,N,B,$,F,G;return _.jsxs("div",{className:`p-3 rounded-lg ${(D=O.properties)!=null&&D.new_ignition?"bg-red-500/10 border-l-2 border-red-500":O.severity==="watch"?"bg-amber-500/10 border-l-2 border-amber-500":"bg-orange-500/10 border-l-2 border-orange-500"}`,children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[((N=O.properties)==null?void 0:N.new_ignition)&&_.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-red-500/20 text-red-400",children:"NEW"}),_.jsx("span",{className:"text-sm text-slate-200",children:O.headline})]}),((B=O.properties)==null?void 0:B.frp)&&_.jsxs("span",{className:"text-sm font-mono text-orange-400",children:[Math.round(O.properties.frp)," MW"]})]}),_.jsxs("div",{className:"text-xs text-slate-500 mt-1 flex items-center gap-3",children:[_.jsxs("span",{children:["Conf: ",(($=O.properties)==null?void 0:$.confidence)||"N/A"]}),((F=O.properties)==null?void 0:F.acq_time)&&_.jsxs("span",{children:["@",O.properties.acq_time,"Z"]}),((G=O.properties)==null?void 0:G.near_fire)&&_.jsxs("span",{children:["Near: ",O.properties.near_fire]})]})]},O.event_id)})})]}),_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(Ds,{size:14}),"Active Events (",r.length,")"]}),r.length>0?_.jsx("div",{className:"space-y-3",children:r.map(O=>_.jsx(bJe,{event:O},O.event_id))}):_.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[_.jsx(Kh,{size:16,className:"text-green-500"}),_.jsx("span",{children:"No active environmental events"})]})]})]}):_.jsxs("div",{className:"flex flex-col items-center justify-center h-[60vh] text-center",children:[_.jsx("div",{className:"w-16 h-16 rounded-full bg-bg-card border border-border flex items-center justify-center mb-6",children:_.jsx(Zc,{size:32,className:"text-slate-500"})}),_.jsx("h2",{className:"text-xl font-semibold text-slate-300 mb-2",children:"Environmental Feeds Disabled"}),_.jsx("p",{className:"text-slate-500 max-w-md",children:"Enable environmental feeds in config.yaml to see weather alerts, space weather indices, and tropospheric ducting data."})]})}function jR({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(A=>{var M,P,k,I;return((M=A.short_name)==null?void 0:M.toLowerCase().includes(T))||((P=A.long_name)==null?void 0:P.toLowerCase().includes(T))||((k=A.role)==null?void 0:k.toLowerCase().includes(T))||((I=A.node_id_hex)==null?void 0:I.toLowerCase().includes(T))})}return S.sort((T,A)=>(T.short_name||"").localeCompare(A.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)},x=S=>{const T=m(S);t.includes(T)?r(t.filter(A=>A!==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?_.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),_.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&&_.jsx("p",{className:"text-xs text-slate-600",children:n})]}):_.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&_.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(A=>m(A)===S);return _.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,_.jsx("button",{type:"button",onClick:()=>r(t.filter(A=>A!==S)),className:"hover:text-white",children:_.jsx(fv,{size:14})})]},S)})}),_.jsxs("div",{className:"relative",children:[_.jsxs("div",{className:"relative",children:[_.jsx(HE,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),_.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&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>v(!1)}),_.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?_.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):g.map(S=>_.jsxs("button",{type:"button",onClick:()=>x(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:[_.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)&&_.jsx(gd,{size:12,className:"text-white"})}),_.jsx("span",{className:"text-slate-200",children:b(S)})]},S.node_num))})]})]}),n&&_.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function RR(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"?_.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),_.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&&_.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):_.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),_.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&&_.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(x=>x.enabled);return _.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:v}),_.jsxs("select",{value:h,onChange:x=>d(Number(x.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&&_.jsx("option",{value:-1,children:"Disabled"}),y.map(x=>_.jsx("option",{value:x.index,children:a(x)},x.index))]}),g&&_.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 _.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:[c.map(h=>_.jsxs("label",{onClick:()=>f(h.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[_.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)&&_.jsx(gd,{size:12,className:"text-white"})}),_.jsx("span",{className:"text-sm text-slate-200",children:a(h)})]},h.index)),c.length===0&&_.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&_.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const BU=[{key:"bot",label:"Bot",icon:Gue},{key:"connection",label:"Connection",icon:MZ},{key:"response",label:"Response",icon:Jue},{key:"history",label:"History",icon:Kue},{key:"memory",label:"Memory",icon:Wue},{key:"context",label:"Context",icon:$E},{key:"commands",label:"Commands",icon:CZ},{key:"llm",label:"LLM",icon:mZ},{key:"weather",label:"Weather",icon:Zc},{key:"meshmonitor",label:"MeshMonitor",icon:eu},{key:"knowledge",label:"Knowledge",icon:pZ},{key:"mesh_sources",label:"Mesh Sources",icon:xZ},{key:"mesh_intelligence",label:"Intelligence",icon:Gy},{key:"environmental",label:"Environmental",icon:rce},{key:"dashboard",label:"Dashboard",icon:_Z}],Kn={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.",environmental:"Live environmental data feeds for situational awareness. Each feed polls a public or authenticated API for real-time conditions affecting your area.",dashboard:"Web dashboard settings. You're looking at it right now."},AJe=[{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"}],CJe=[{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 Wo({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]),_.jsxs("div",{className:"relative inline-block",ref:a,children:[_.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&&_.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:[_.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:_.jsx(fv,{size:12})}),_.jsx("div",{className:"pr-4",children:e}),t&&_.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," ",_.jsx(yd,{size:10})]})]})]})}function Qn({text:e}){return _.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function At({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 _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&_.jsx(Wo,{info:o,link:s})]}),_.jsxs("div",{className:"relative",children:[_.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&&_.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?_.jsx(yZ,{size:16}):_.jsx($E,{size:16})})]}),a&&_.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function qe({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&_.jsx(Wo,{info:s,link:l})]}),_.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&&_.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function Et({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return _.jsxs("div",{className:"flex items-center justify-between py-2",children:[_.jsxs("div",{children:[_.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&_.jsx(Wo,{info:i,link:a})]}),n&&_.jsx("p",{className:"text-xs text-slate-600",children:n})]}),_.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:_.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Co({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&_.jsx(Wo,{info:a,link:o})]}),_.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=>_.jsx("option",{value:s.value,children:s.label},s.value))}),i&&_.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function MJe({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&_.jsx(Wo,{info:a,link:o})]}),_.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&&_.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function Wh({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 _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&_.jsx(Wo,{info:i,link:a})]}),_.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&&_.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function PJe({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 _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&_.jsx(Wo,{info:i,link:a})]}),_.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&&_.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 _.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3 space-y-2",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{className:"flex-1",children:[_.jsx("span",{className:"text-sm text-slate-300",children:e}),_.jsx("p",{className:"text-xs text-slate-600",children:t})]}),_.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:_.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&&_.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[_.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),_.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&&_.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function LJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.bot}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{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."}),_.jsx(At,{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."})]}),_.jsx(Et,{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."}),_.jsx(Et,{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 kJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.connection}),_.jsx(Co,{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"?_.jsx(At,{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."}):_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{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"}),_.jsx(qe,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function IJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.response}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{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."}),_.jsx(qe,{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."})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{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."}),_.jsx(qe,{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 OJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.history}),_.jsx(At,{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."}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{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."}),_.jsx(qe,{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."})]}),_.jsx(Et,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),_.jsx(qe,{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 EJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.memory}),_.jsx(Et,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{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."}),_.jsx(qe,{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 DJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.context}),_.jsx(Et,{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&&_.jsxs(_.Fragment,{children:[_.jsx(RR,{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"}),_.jsx(jR,{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."}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),_.jsx(qe,{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 NJe({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 _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.commands}),_.jsx(Et,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&_.jsxs(_.Fragment,{children:[_.jsx(At,{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."}),_.jsxs("div",{className:"space-y-2",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",_.jsx(Wo,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),_.jsx("div",{className:"grid gap-1",children:AJe.map(i=>{const a=!r.has(i.name.toLowerCase());return _.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),_.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),_.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:_.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 jJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.llm}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(Co,{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."}),_.jsx(At,{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)."})]}),_.jsx(At,{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."}),_.jsx(At,{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."}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),_.jsx(qe,{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"})]}),_.jsx(Et,{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&&_.jsx(MJe,{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."}),_.jsx(Et,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),_.jsx(Et,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function RJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.weather}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(Co,{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"}),_.jsx(Co,{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"})]}),_.jsx(At,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function BJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.meshmonitor}),_.jsx(Et,{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&&_.jsxs(_.Fragment,{children:[_.jsx(At,{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."}),_.jsx(Et,{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."}),_.jsx(qe,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),_.jsx(Et,{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 zJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.knowledge}),_.jsx(Et,{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&&_.jsxs(_.Fragment,{children:[_.jsx(Co,{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")&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{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."}),_.jsx(qe,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),_.jsx(At,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{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."}),_.jsx(qe,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),_.jsx(Et,{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."})]}),_.jsx(At,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),_.jsx(qe,{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 $Je({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 _.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[_.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[_.jsxs("div",{className:"flex items-center gap-3",children:[n?_.jsx(Wy,{size:16}):_.jsx(_m,{size:16}),_.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),_.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),_.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),_.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:_.jsx(UE,{size:14})})]}),n&&_.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),_.jsx(Co,{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"&&_.jsx(At,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&_.jsx(At,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),_.jsx(qe,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),_.jsx(At,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),_.jsx(At,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),_.jsx(Et,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),_.jsx(qe,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),_.jsx(Et,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),_.jsx(Et,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function FJe({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 _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.mesh_sources}),e.map((n,i)=>_.jsx($Je,{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)),_.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:[_.jsx(_S,{size:16})," Add Source"]})]})}function VJe({data:e,onChange:t}){const[r,n]=W.useState(null);return _.jsxs("div",{className:"space-y-6",children:[_.jsx(Qn,{text:Kn.mesh_intelligence}),_.jsx(Et,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{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."}),_.jsx(qe,{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."})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{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."}),_.jsx(qe,{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"})]}),_.jsx(jR,{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"}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(RR,{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}),_.jsx(qe,{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)."})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",_.jsx(Wo,{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)=>_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[_.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[_.jsxs("div",{className:"flex items-center gap-3",children:[r===a?_.jsx(Wy,{size:16}):_.jsx(_m,{size:16}),_.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),_.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),_.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:_.jsx(UE,{size:14})})]}),r===a&&_.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),_.jsx(At,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),_.jsx(qe,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),_.jsx(At,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),_.jsx(Wh,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),_.jsx(Wh,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),_.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:[_.jsx(_S,{size:16})," Add Region"]})]}),_.jsxs("div",{className:"space-y-3",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",_.jsx(Wo,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),_.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}})}),_.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}})}),_.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}})}),_.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}})}),_.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}})}),_.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}})})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),_.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:"%"}),_.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:"%"}),_.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:"%"}),_.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}})}),_.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}})}),_.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}})})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),_.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`}),_.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"})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),_.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"}),_.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 GJe({data:e,onChange:t}){var r,n,i,a,o,s,l,u,c,f,h,d,v,g,m,y;return _.jsxs("div",{className:"space-y-6",children:[_.jsx(Qn,{text:Kn.environmental}),_.jsx(Et,{label:"Enable Environmental Feeds",checked:e.enabled,onChange:x=>t({...e,enabled:x}),helper:"Activate live data polling"}),e.enabled&&_.jsxs(_.Fragment,{children:[_.jsx(Wh,{label:"NWS Zones",value:e.nws_zones,onChange:x=>t({...e,nws_zones:x}),helper:"Zone IDs like IDZ016, IDZ030",info:"NWS forecast zones covering your mesh area. Find yours at https://www.weather.gov/pimar/PubZone",infoLink:"https://www.weather.gov/pimar/PubZone"}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"NWS Weather Alerts"}),_.jsx(Et,{label:"",checked:e.nws.enabled,onChange:x=>t({...e,nws:{...e.nws,enabled:x}})})]}),e.nws.enabled&&_.jsxs(_.Fragment,{children:[_.jsx(At,{label:"User Agent",value:e.nws.user_agent,onChange:x=>t({...e,nws:{...e.nws,user_agent:x}}),placeholder:"(MeshAI, your@email.com)",helper:"Required format: (app_name, contact_email)",info:"Required by NWS. You make it up - just use the format (app_name, your_email). No signup needed."}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:x=>t({...e,nws:{...e.nws,tick_seconds:x}}),min:30,helper:"Polling interval"}),_.jsx(Co,{label:"Min Severity",value:e.nws.severity_min,onChange:x=>t({...e,nws:{...e.nws,severity_min:x}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}],helper:"Filter out lower severity alerts",info:"Minimum severity level to display. 'Moderate' filters out minor advisories. 'Severe' shows only serious warnings."})]})]})]}),_.jsx("div",{className:"border border-[#1e2a3a] rounded-lg p-4",children:_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"NOAA Space Weather (SWPC)"}),_.jsx("p",{className:"text-xs text-slate-600",children:"Solar indices, geomagnetic storms, HF propagation"})]}),_.jsx(Et,{label:"",checked:e.swpc.enabled,onChange:x=>t({...e,swpc:{...e.swpc,enabled:x}})})]})}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Tropospheric Ducting"}),_.jsx("p",{className:"text-xs text-slate-600",children:"VHF/UHF extended range conditions"})]}),_.jsx(Et,{label:"",checked:e.ducting.enabled,onChange:x=>t({...e,ducting:{...e.ducting,enabled:x}})})]}),e.ducting.enabled&&_.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[_.jsx(qe,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:x=>t({...e,ducting:{...e.ducting,tick_seconds:x}}),min:60}),_.jsx(qe,{label:"Latitude",value:e.ducting.latitude,onChange:x=>t({...e,ducting:{...e.ducting,latitude:x}}),step:.01,info:"Center point of your mesh coverage area. The ducting adapter checks atmospheric conditions at this location."}),_.jsx(qe,{label:"Longitude",value:e.ducting.longitude,onChange:x=>t({...e,ducting:{...e.ducting,longitude:x}}),step:.01})]})]}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"NIFC Fire Perimeters"}),_.jsx("p",{className:"text-xs text-slate-600",children:"Active wildfires from National Interagency Fire Center"})]}),_.jsx(Et,{label:"",checked:e.fires.enabled,onChange:x=>t({...e,fires:{...e.fires,enabled:x}})})]}),e.fires.enabled&&_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(qe,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:x=>t({...e,fires:{...e.fires,tick_seconds:x}}),min:60}),_.jsx(Co,{label:"State",value:e.fires.state,onChange:x=>t({...e,fires:{...e.fires,state:x}}),options:CJe,helper:"Filter fires by state",info:"Two-letter state code for NIFC wildfire filtering."})]})]}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Avalanche Advisories"}),_.jsx("p",{className:"text-xs text-slate-600",children:"Backcountry avalanche danger ratings"})]}),_.jsx(Et,{label:"",checked:e.avalanche.enabled,onChange:x=>t({...e,avalanche:{...e.avalanche,enabled:x}})})]}),e.avalanche.enabled&&_.jsxs(_.Fragment,{children:[_.jsx(qe,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:x=>t({...e,avalanche:{...e.avalanche,tick_seconds:x}}),min:60}),_.jsx(Wh,{label:"Center IDs",value:e.avalanche.center_ids,onChange:x=>t({...e,avalanche:{...e.avalanche,center_ids:x}}),helper:"e.g., SNFAC, IPAC, FAC",info:"Find your local center at https://avalanche.org/avalanche-centers/",infoLink:"https://avalanche.org/avalanche-centers/"}),_.jsx(PJe,{label:"Season Months",value:e.avalanche.season_months,onChange:x=>t({...e,avalanche:{...e.avalanche,season_months:x}}),helper:"e.g., 12, 1, 2, 3, 4",info:"Months when avalanche forecasts are active. Default Dec-Apr. Adjust for your region's season."})]})]}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"USGS Stream Gauges"}),_.jsx("p",{className:"text-xs text-slate-600",children:"River and stream water levels"})]}),_.jsx(Et,{label:"",checked:((r=e.usgs)==null?void 0:r.enabled)||!1,onChange:x=>{var b,S;return t({...e,usgs:{...e.usgs,enabled:x,tick_seconds:((b=e.usgs)==null?void 0:b.tick_seconds)||900,sites:((S=e.usgs)==null?void 0:S.sites)||[]}})}})]}),((n=e.usgs)==null?void 0:n.enabled)&&_.jsxs(_.Fragment,{children:[_.jsx(qe,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:x=>t({...e,usgs:{...e.usgs,tick_seconds:x}}),min:900,helper:"Minimum 15 min (900s)"}),_.jsx(Wh,{label:"Site IDs",value:e.usgs.sites,onChange:x=>t({...e,usgs:{...e.usgs,sites:x}}),helper:"USGS gauge site numbers",info:"Find site IDs at waterdata.usgs.gov/nwis",infoLink:"https://waterdata.usgs.gov/nwis"})]})]}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"TomTom Traffic"}),_.jsx("p",{className:"text-xs text-slate-600",children:"Traffic flow on monitored corridors"})]}),_.jsx(Et,{label:"",checked:((i=e.traffic)==null?void 0:i.enabled)||!1,onChange:x=>{var b,S,T;return t({...e,traffic:{...e.traffic,enabled:x,tick_seconds:((b=e.traffic)==null?void 0:b.tick_seconds)||300,api_key:((S=e.traffic)==null?void 0:S.api_key)||"",corridors:((T=e.traffic)==null?void 0:T.corridors)||[]}})}})]}),((a=e.traffic)==null?void 0:a.enabled)&&_.jsxs(_.Fragment,{children:[_.jsx(At,{label:"API Key",value:e.traffic.api_key,onChange:x=>t({...e,traffic:{...e.traffic,api_key:x}}),type:"password",helper:"Get key at developer.tomtom.com",infoLink:"https://developer.tomtom.com"}),_.jsx(qe,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:x=>t({...e,traffic:{...e.traffic,tick_seconds:x}}),min:60}),_.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Corridors (each with name, lat, lon):"}),(e.traffic.corridors||[]).map((x,b)=>_.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[_.jsx(At,{label:"Name",value:x.name,onChange:S=>{const T=[...e.traffic.corridors];T[b]={...x,name:S},t({...e,traffic:{...e.traffic,corridors:T}})}}),_.jsx(qe,{label:"Lat",value:x.lat,onChange:S=>{const T=[...e.traffic.corridors];T[b]={...x,lat:S},t({...e,traffic:{...e.traffic,corridors:T}})},step:.01}),_.jsx(qe,{label:"Lon",value:x.lon,onChange:S=>{const T=[...e.traffic.corridors];T[b]={...x,lon:S},t({...e,traffic:{...e.traffic,corridors:T}})},step:.01}),_.jsx("button",{onClick:()=>t({...e,traffic:{...e.traffic,corridors:e.traffic.corridors.filter((S,T)=>T!==b)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30 rounded",children:"Remove"})]},b)),_.jsx("button",{onClick:()=>t({...e,traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"})]})]}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"511 Road Conditions"}),_.jsx("p",{className:"text-xs text-slate-600",children:"State DOT road events and closures"})]}),_.jsx(Et,{label:"",checked:((o=e.roads511)==null?void 0:o.enabled)||!1,onChange:x=>{var b,S,T,A,M;return t({...e,roads511:{...e.roads511,enabled:x,tick_seconds:((b=e.roads511)==null?void 0:b.tick_seconds)||300,api_key:((S=e.roads511)==null?void 0:S.api_key)||"",base_url:((T=e.roads511)==null?void 0:T.base_url)||"",endpoints:((A=e.roads511)==null?void 0:A.endpoints)||["/get/event"],bbox:((M=e.roads511)==null?void 0:M.bbox)||[]}})}})]}),((s=e.roads511)==null?void 0:s.enabled)&&_.jsxs(_.Fragment,{children:[_.jsx(At,{label:"Base URL",value:e.roads511.base_url,onChange:x=>t({...e,roads511:{...e.roads511,base_url:x}}),placeholder:"https://511.yourstate.gov/api/v2",helper:"State 511 API endpoint"}),_.jsx(At,{label:"API Key",value:e.roads511.api_key,onChange:x=>t({...e,roads511:{...e.roads511,api_key:x}}),type:"password",helper:"Leave empty if not required"}),_.jsx(qe,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:x=>t({...e,roads511:{...e.roads511,tick_seconds:x}}),min:60}),_.jsx(Wh,{label:"Endpoints",value:e.roads511.endpoints,onChange:x=>t({...e,roads511:{...e.roads511,endpoints:x}}),helper:"e.g., /get/event, /get/mountainpasses"}),_.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[_.jsx(qe,{label:"West",value:((l=e.roads511.bbox)==null?void 0:l[0])||0,onChange:x=>{const b=[...e.roads511.bbox||[0,0,0,0]];b[0]=x,t({...e,roads511:{...e.roads511,bbox:b}})},step:.01}),_.jsx(qe,{label:"South",value:((u=e.roads511.bbox)==null?void 0:u[1])||0,onChange:x=>{const b=[...e.roads511.bbox||[0,0,0,0]];b[1]=x,t({...e,roads511:{...e.roads511,bbox:b}})},step:.01}),_.jsx(qe,{label:"East",value:((c=e.roads511.bbox)==null?void 0:c[2])||0,onChange:x=>{const b=[...e.roads511.bbox||[0,0,0,0]];b[2]=x,t({...e,roads511:{...e.roads511,bbox:b}})},step:.01}),_.jsx(qe,{label:"North",value:((f=e.roads511.bbox)==null?void 0:f[3])||0,onChange:x=>{const b=[...e.roads511.bbox||[0,0,0,0]];b[3]=x,t({...e,roads511:{...e.roads511,bbox:b}})},step:.01})]}),_.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box filter (leave all 0 to disable)"})]})]}),_.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("span",{className:"text-sm font-medium text-slate-300",children:"NASA FIRMS Satellite Fire Detection"}),_.jsx("p",{className:"text-xs text-slate-600",children:"Near real-time thermal anomalies from satellites"})]}),_.jsx(Et,{label:"",checked:((h=e.firms)==null?void 0:h.enabled)||!1,onChange:x=>{var b,S,T,A,M,P,k;return t({...e,firms:{...e.firms,enabled:x,tick_seconds:((b=e.firms)==null?void 0:b.tick_seconds)||1800,map_key:((S=e.firms)==null?void 0:S.map_key)||"",source:((T=e.firms)==null?void 0:T.source)||"VIIRS_SNPP_NRT",bbox:((A=e.firms)==null?void 0:A.bbox)||[],day_range:((M=e.firms)==null?void 0:M.day_range)||1,confidence_min:((P=e.firms)==null?void 0:P.confidence_min)||"nominal",proximity_km:((k=e.firms)==null?void 0:k.proximity_km)||10}})}})]}),((d=e.firms)==null?void 0:d.enabled)&&_.jsxs(_.Fragment,{children:[_.jsx(At,{label:"MAP Key",value:e.firms.map_key,onChange:x=>t({...e,firms:{...e.firms,map_key:x}}),type:"password",helper:"Get key at firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),_.jsx(qe,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:x=>t({...e,firms:{...e.firms,tick_seconds:x}}),min:300,helper:"Minimum 5 min (300s)"}),_.jsx(Co,{label:"Satellite Source",value:e.firms.source,onChange:x=>t({...e,firms:{...e.firms,source:x}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (Near Real-Time)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (Near Real-Time)"},{value:"MODIS_NRT",label:"MODIS (Near Real-Time)"}]}),_.jsx(qe,{label:"Day Range",value:e.firms.day_range,onChange:x=>t({...e,firms:{...e.firms,day_range:x}}),min:1,max:10,helper:"1-10 days of data"}),_.jsx(Co,{label:"Minimum Confidence",value:e.firms.confidence_min,onChange:x=>t({...e,firms:{...e.firms,confidence_min:x}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),_.jsx(qe,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:x=>t({...e,firms:{...e.firms,proximity_km:x}}),step:.5,helper:"Distance to match known fires"}),_.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[_.jsx(qe,{label:"West",value:((v=e.firms.bbox)==null?void 0:v[0])||0,onChange:x=>{const b=[...e.firms.bbox||[0,0,0,0]];b[0]=x,t({...e,firms:{...e.firms,bbox:b}})},step:.01}),_.jsx(qe,{label:"South",value:((g=e.firms.bbox)==null?void 0:g[1])||0,onChange:x=>{const b=[...e.firms.bbox||[0,0,0,0]];b[1]=x,t({...e,firms:{...e.firms,bbox:b}})},step:.01}),_.jsx(qe,{label:"East",value:((m=e.firms.bbox)==null?void 0:m[2])||0,onChange:x=>{const b=[...e.firms.bbox||[0,0,0,0]];b[2]=x,t({...e,firms:{...e.firms,bbox:b}})},step:.01}),_.jsx(qe,{label:"North",value:((y=e.firms.bbox)==null?void 0:y[3])||0,onChange:x=>{const b=[...e.firms.bbox||[0,0,0,0]];b[3]=x,t({...e,firms:{...e.firms,bbox:b}})},step:.01})]}),_.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box for monitoring area (required)"})]})]})]})]})}function WJe({data:e,onChange:t}){return _.jsxs("div",{className:"space-y-4",children:[_.jsx(Qn,{text:Kn.dashboard}),_.jsx(Et,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(At,{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."}),_.jsx(qe,{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 HJe(){var k;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),x=W.useCallback(async()=>{try{const I=await fetch("/api/config");if(!I.ok)throw new Error("Failed to fetch config");const O=await I.json();t(O),n(JSON.parse(JSON.stringify(O))),y(!1),f(null)}catch(I){f(I instanceof Error?I.message:"Unknown error")}finally{s(!1)}},[]);W.useEffect(()=>{document.title="Config — MeshAI",x()},[x]),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 I=e[i],O=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)}),D=await O.json();if(!O.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(I){f(I instanceof Error?I.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")}},A=(I,O)=>{e&&t({...e,[I]:O})};if(o)return _.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return _.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const M=()=>{switch(i){case"bot":return _.jsx(LJe,{data:e.bot,onChange:I=>A("bot",I)});case"connection":return _.jsx(kJe,{data:e.connection,onChange:I=>A("connection",I)});case"response":return _.jsx(IJe,{data:e.response,onChange:I=>A("response",I)});case"history":return _.jsx(OJe,{data:e.history,onChange:I=>A("history",I)});case"memory":return _.jsx(EJe,{data:e.memory,onChange:I=>A("memory",I)});case"context":return _.jsx(DJe,{data:e.context,onChange:I=>A("context",I)});case"commands":return _.jsx(NJe,{data:e.commands,onChange:I=>A("commands",I)});case"llm":return _.jsx(jJe,{data:e.llm,onChange:I=>A("llm",I)});case"weather":return _.jsx(RJe,{data:e.weather,onChange:I=>A("weather",I)});case"meshmonitor":return _.jsx(BJe,{data:e.meshmonitor,onChange:I=>A("meshmonitor",I)});case"knowledge":return _.jsx(zJe,{data:e.knowledge,onChange:I=>A("knowledge",I)});case"mesh_sources":return _.jsx(FJe,{data:e.mesh_sources,onChange:I=>A("mesh_sources",I)});case"mesh_intelligence":return _.jsx(VJe,{data:e.mesh_intelligence,onChange:I=>A("mesh_intelligence",I)});case"environmental":return _.jsx(GJe,{data:e.environmental,onChange:I=>A("environmental",I)});case"dashboard":return _.jsx(WJe,{data:e.dashboard,onChange:I=>A("dashboard",I)});default:return null}},P=((k=BU.find(I=>I.key===i))==null?void 0:k.label)||i;return _.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[_.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:BU.map(({key:I,label:O,icon:D})=>_.jsxs("button",{onClick:()=>a(I),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===I?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[_.jsx(D,{size:16}),_.jsx("span",{children:O}),m&&i===I&&_.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},I))}),_.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[_.jsxs("div",{className:"flex items-center justify-between mb-6",children:[_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx(AZ,{size:20,className:"text-slate-500"}),_.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:P})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[m&&_.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:[_.jsx(SZ,{size:14}),"Discard"]}),_.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?_.jsx(wZ,{size:14,className:"animate-spin"}):_.jsx(TZ,{size:14}),"Save"]})]})]}),v&&_.jsxs("div",{className:"flex items-center justify-between p-3 mb-4 bg-amber-500/10 border border-amber-500/30 rounded-lg",children:[_.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[_.jsx(Ds,{size:16}),_.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),_.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&&_.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:[_.jsx(fv,{size:16}),_.jsx("span",{className:"text-sm",children:c})]}),h&&_.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:[_.jsx(gd,{size:16}),_.jsx("span",{className:"text-sm",children:h})]}),_.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:_.jsx("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:M()})})]})]})}const zU={infra_offline:ice,infra_recovery:MZ,battery_warning:eC,battery_critical:eC,battery_emergency:eC,hf_blackout:wm,uhf_ducting:eu,weather_warning:Zc,weather_watch:Zc,new_router:eu,packet_flood:Ds,sustained_high_util:Ds,region_blackout:Hy,default:xm};function UJe(e){return zU[e]||zU.default}function Vie(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",badge:"bg-red-500/20 text-red-400",iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",badge:"bg-amber-500/20 text-amber-400",iconColor:"text-amber-500"};case"watch":return{bg:"bg-yellow-500/10",border:"border-yellow-500",badge:"bg-yellow-500/20 text-yellow-400",iconColor:"text-yellow-500"};case"advisory":case"info":default:return{bg:"bg-blue-500/10",border:"border-blue-500",badge:"bg-blue-500/20 text-blue-400",iconColor:"text-blue-500"}}}function ZJe(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 YJe(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 XJe(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 qJe({alert:e,onAcknowledge:t}){var i;const r=Vie(e.severity),n=UJe(e.type);return _.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-4 ${r.border}`,children:_.jsxs("div",{className:"flex items-start gap-3",children:[_.jsx(n,{size:20,className:r.iconColor}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),_.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),_.jsx("div",{className:"text-sm text-slate-200",children:e.message}),_.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[_.jsxs("span",{className:"flex items-center gap-1",children:[_.jsx(md,{size:12}),e.timestamp?ZJe(e.timestamp):"Just now"]}),e.scope_value&&_.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),_.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 KJe({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","critical","warning","watch","info"];return _.jsxs("div",{className:"bg-bg-card border border-border rounded-lg",children:[_.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(FE,{size:14,className:"text-slate-400"}),_.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),_.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=>_.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),_.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=>_.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),_.jsx("div",{className:"overflow-x-auto",children:_.jsxs("table",{className:"w-full",children:[_.jsx("thead",{children:_.jsxs("tr",{className:"border-b border-border",children:[_.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),_.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),_.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),_.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),_.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),_.jsx("tbody",{children:e.length>0?e.map((c,f)=>{const h=Vie(c.severity);return _.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[_.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:YJe(c.timestamp)}),_.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),_.jsx("td",{className:"p-4",children:_.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${h.badge}`,children:c.severity})}),_.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),_.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?XJe(c.duration):"-"})]},c.id||f)}):_.jsx("tr",{children:_.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&_.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[_.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.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:_.jsx(Uue,{size:16})}),_.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:_.jsx(_m,{size:16})})]})]})]})}function QJe({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 xm;case"daily":return md;case"weekly":return md;default:return xm}})();return _.jsx("div",{className:"p-4 rounded-lg bg-bg-hover border border-border",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:_.jsx(a,{size:18,className:"text-blue-400"})}),_.jsxs("div",{className:"flex-1",children:[_.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&&_.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),_.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," • ",r(e.user_id)]})]}),_.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function JJe(){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),[x,b]=W.useState(1),S=20,[T,A]=W.useState(new Set),{lastAlert:M}=ZE();W.useEffect(()=>{document.title="Alerts — MeshAI"},[]),W.useEffect(()=>{Promise.all([PZ().catch(()=>[]),u3(S,0).catch(()=>({items:[],total:0})),uce().catch(()=>[]),fetch("/api/nodes").then(I=>I.json()).catch(()=>[])]).then(([I,O,D,N])=>{t(I),Array.isArray(O)?(n(O),b(1)):(n(O.items||[]),b(Math.ceil((O.total||0)/S))),a(D),s(N),u(!1)}).catch(I=>{f(I.message),u(!1)})},[]),W.useEffect(()=>{M&&t(I=>I.some(D=>D.type===M.type&&D.message===M.message)?I:[M,...I])},[M]),W.useEffect(()=>{const I=(m-1)*S;u3(S,I,h,v).then(O=>{Array.isArray(O)?(n(O),b(1)):(n(O.items||[]),b(Math.ceil((O.total||0)/S)))}).catch(()=>{})},[m,h,v]);const P=W.useCallback(I=>{const O=`${I.type}-${I.message}-${I.timestamp}`;A(D=>new Set([...D,O]))},[]),k=e.filter(I=>{const O=`${I.type}-${I.message}-${I.timestamp}`;return!T.has(O)});return l?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):_.jsxs("div",{className:"space-y-6",children:[_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(Ds,{size:14}),"Active Alerts (",k.length,")"]}),k.length>0?_.jsx("div",{className:"space-y-3",children:k.map((I,O)=>_.jsx(qJe,{alert:I,onAcknowledge:P},`${I.type}-${I.timestamp}-${O}`))}):_.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[_.jsx(Kh,{size:20,className:"text-green-500"}),_.jsx("span",{children:"No active alerts — all systems nominal"})]})]}),_.jsxs("div",{children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(md,{size:14}),"Alert History"]}),_.jsx(KJe,{history:r,typeFilter:h,severityFilter:v,onTypeFilterChange:I=>{d(I),y(1)},onSeverityFilterChange:I=>{g(I),y(1)},page:m,totalPages:x,onPageChange:y})]}),_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[_.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[_.jsx(nce,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?_.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(I=>_.jsx(QJe,{subscription:I,nodes:o},I.id))}):_.jsxs("div",{className:"text-slate-500 py-4",children:[_.jsx("p",{children:"No active subscriptions."}),_.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",_.jsx("code",{className:"text-blue-400",children:"!subscribe"})," on mesh"]})]})]})]})}const pb=[{value:"info",label:"Info",description:"Routine updates (ducting detected, new router appeared)"},{value:"advisory",label:"Advisory",description:"Worth knowing (weather advisory, traffic slow, battery declining)"},{value:"watch",label:"Watch",description:"Pay attention (fire within 50km, weather watch, stream rising)"},{value:"warning",label:"Warning",description:"Act now (fire within 25km, severe weather, critical battery)"},{value:"critical",label:"Critical",description:"Serious issue (critical node down, battery emergency)"},{value:"emergency",label:"Emergency",description:"Life safety (extreme weather, fire at infrastructure, total blackout)"}],$U=[{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:"advisory",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:"warning",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:"info",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:"warning",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:"emergency",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:"info",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 No({info:e}){const[t,r]=W.useState(!1);return _.jsxs("div",{className:"relative inline-block",children:[_.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&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),_.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 gh({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 _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&_.jsx(No,{info:o})]}),_.jsxs("div",{className:"relative",children:[_.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&&_.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?_.jsx(yZ,{size:16}):_.jsx($E,{size:16})})]}),a&&_.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function FU({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&_.jsx(No,{info:s})]}),_.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&&_.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function tS({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return _.jsxs("div",{className:"flex items-center justify-between py-2",children:[_.jsxs("div",{children:[_.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&_.jsx(No,{info:i})]}),n&&_.jsx("p",{className:"text-xs text-slate-600",children:n})]}),_.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:_.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function rS({label:e,value:t,onChange:r,helper:n="",info:i=""}){return _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&_.jsx(No,{info:i})]}),_.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&&_.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function eet({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 _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&_.jsx(No,{info:a})]}),_.jsxs("div",{className:"flex gap-2",children:[_.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}),_.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:_.jsx(_S,{size:16})})]}),t.length>0&&_.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,f)=>_.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,_.jsx("button",{type:"button",onClick:()=>u(f),className:"text-slate-500 hover:text-red-400",children:_.jsx(fv,{size:14})})]},f))}),i&&_.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function tet({value:e,onChange:t}){const[r,n]=W.useState(!1),i=pb.find(a=>a.value===e)||pb[3];return _.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",_.jsx(No,{info:"Only alerts at or above this severity trigger this rule. Lower threshold = more notifications. 'Warning' is recommended for most rules."})]}),_.jsxs("div",{className:"relative",children:[_.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:[_.jsxs("div",{children:[_.jsx("span",{className:"text-slate-200",children:i.label}),_.jsxs("span",{className:"text-slate-500 ml-2",children:["— ",i.description]})]}),_.jsx(Wy,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),_.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:pb.map(a=>_.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:[_.jsx("div",{className:"font-medium text-slate-200",children:a.label}),_.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),_.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function ret({rule:e,categories:t,quietHoursEnabled:r,onChange:n,onDelete:i,onDuplicate:a,onTest:o}){var S,T,A,M;const[s,l]=W.useState(!e.name),[u,c]=W.useState(!1),f=[{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"}],h=[{value:"daily",label:"Daily"},{value:"twice_daily",label:"Twice Daily"},{value:"weekly",label:"Weekly"}],d=[{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"}],v=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],g=P=>{const k=e.categories||[];k.includes(P)?n({...e,categories:k.filter(I=>I!==P)}):n({...e,categories:[...k,P]})},m=P=>{const k=e.schedule_days||[];k.includes(P)?n({...e,schedule_days:k.filter(I=>I!==P)}):n({...e,schedule_days:[...k,P]})},y=async()=>{c(!0),await o(),c(!1)},x=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const P=e.categories||[];if(P.length===0&&t.length>0)return t[0].example_message||"Alert notification";const k=t.find(I=>P.includes(I.id));return(k==null?void 0:k.example_message)||"Alert notification"},b=()=>{var k,I,O,D,N,B,$,F;const P=[];if(e.trigger_type==="schedule"){const G=((k=h.find(U=>U.value===e.schedule_frequency))==null?void 0:k.label)||e.schedule_frequency,z=((I=d.find(U=>U.value===e.message_type))==null?void 0:I.label)||e.message_type;P.push(`${G} at ${e.schedule_time||"??:??"}`),P.push(z)}else{const G=((O=e.categories)==null?void 0:O.length)||0,z=G===0?"All":t.filter(H=>{var Y;return(Y=e.categories)==null?void 0:Y.includes(H.id)}).map(H=>H.name).slice(0,2).join(", ")+(G>2?` +${G-2}`:""),U=((D=pb.find(H=>H.value===e.min_severity))==null?void 0:D.label)||e.min_severity;P.push(`${z} at ${U}+`)}if(!e.delivery_type)P.push("⚠️ No delivery");else{const G=((N=f.find(U=>U.value===e.delivery_type))==null?void 0:N.label)||e.delivery_type;let z="";if(e.delivery_type==="mesh_broadcast")z=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")z=`${((B=e.node_ids)==null?void 0:B.length)||0} nodes`;else if(e.delivery_type==="email")z=($=e.recipients)!=null&&$.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{z=new URL(e.webhook_url).hostname}catch{z=((F=e.webhook_url)==null?void 0:F.slice(0,20))||"no URL"}P.push(`${G}${z?` (${z})`:""}`)}return P.join(" → ")};return _.jsxs("div",{className:`border rounded-lg overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[_.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>l(!s),children:[_.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[s?_.jsx(Wy,{size:16,className:"text-slate-500 flex-shrink-0"}):_.jsx(_m,{size:16,className:"text-slate-500 flex-shrink-0"}),_.jsx("button",{onClick:P=>{P.stopPropagation(),n({...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"?_.jsx(md,{size:14,className:"text-blue-400 flex-shrink-0"}):_.jsx(wm,{size:14,className:"text-yellow-400 flex-shrink-0"}),_.jsx("span",{className:"font-medium text-slate-200 truncate",children:e.name||"New Rule"}),!s&&_.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:b()})]}),_.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[_.jsx("button",{onClick:P=>{P.stopPropagation(),y()},disabled:u||!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:_.jsx(o3,{size:14})}),_.jsx("button",{onClick:P=>{P.stopPropagation(),a()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:_.jsx(que,{size:14})}),_.jsx("button",{onClick:P=>{P.stopPropagation(),i()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:_.jsx(UE,{size:14})})]})]}),s&&_.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[_.jsx(gh,{label:"Rule Name",value:e.name,onChange:P=>n({...e,name:P}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),_.jsxs("div",{className:"flex gap-2",children:[_.jsxs("button",{type:"button",onClick:()=>n({...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:[_.jsx(wm,{size:16}),_.jsx("span",{children:"Condition"})]}),_.jsxs("button",{type:"button",onClick:()=>n({...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:[_.jsx(md,{size:16}),_.jsx("span",{children:"Schedule"})]})]}),_.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"&&_.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[_.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[_.jsx(Ds,{size:14}),"WHEN (Condition)"]}),_.jsx(tet,{value:e.min_severity,onChange:P=>n({...e,min_severity:P})}),_.jsxs("div",{className:"space-y-2",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",_.jsx(No,{info:"Select which types of alerts trigger this rule. Leave all unchecked to match ALL categories."})]}),_.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((S=e.categories)==null?void 0:S.length)||0)===0?"All categories (none selected)":`${(T=e.categories)==null?void 0:T.length} selected`}),_.jsx("div",{className:"max-h-48 overflow-y-auto border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:t.map(P=>{var k,I;return _.jsxs("label",{onClick:()=>g(P.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[_.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${(k=e.categories)!=null&&k.includes(P.id)?"bg-accent border-accent":"border-slate-600"}`,children:((I=e.categories)==null?void 0:I.includes(P.id))&&_.jsx(gd,{size:12,className:"text-white"})}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("div",{className:"text-sm text-slate-200",children:P.name}),_.jsx("div",{className:"text-xs text-slate-500",children:P.description})]})]},P.id)})})]})]}),e.trigger_type==="schedule"&&_.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[_.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[_.jsx(Hue,{size:14}),"WHEN (Schedule)"]}),_.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),_.jsx("select",{value:e.schedule_frequency||"daily",onChange:P=>n({...e,schedule_frequency:P.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:h.map(P=>_.jsx("option",{value:P.value,children:P.label},P.value))})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(rS,{label:"Time",value:e.schedule_time||"07:00",onChange:P=>n({...e,schedule_time:P})}),e.schedule_frequency==="twice_daily"&&_.jsx(rS,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:P=>n({...e,schedule_time_2:P})})]}),e.schedule_frequency==="weekly"&&_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),_.jsx("div",{className:"flex flex-wrap gap-2",children:v.map(P=>{var k;return _.jsx("button",{type:"button",onClick:()=>m(P),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(k=e.schedule_days)!=null&&k.includes(P)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:P.slice(0,3)},P)})})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),_.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:P=>n({...e,message_type:P.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:d.map(P=>_.jsx("option",{value:P.value,children:P.label},P.value))}),_.jsx("p",{className:"text-xs text-slate-600",children:(A=d.find(P=>P.value===e.message_type))==null?void 0:A.description})]}),e.message_type==="custom"&&_.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",_.jsx(No,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),_.jsx("textarea",{value:e.custom_message||"",onChange:P=>n({...e,custom_message:P.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"})]})]}),_.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[_.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[_.jsx(o3,{size:14}),"SEND VIA"]}),_.jsxs("div",{className:"space-y-1",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",_.jsx(No,{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."})]}),_.jsx("select",{value:e.delivery_type||"",onChange:P=>n({...e,delivery_type:P.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:f.map(P=>_.jsx("option",{value:P.value,children:P.label},P.value))}),_.jsx("p",{className:"text-xs text-slate-600",children:(M=f.find(P=>P.value===(e.delivery_type||"")))==null?void 0:M.description})]}),!e.delivery_type&&_.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[_.jsx(Hy,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),_.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"&&_.jsx(RR,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:P=>n({...e,broadcast_channel:P}),helper:"Select the mesh radio channel",mode:"single"}),e.delivery_type==="mesh_dm"&&_.jsx(jR,{label:"Recipient Nodes",value:e.node_ids||[],onChange:P=>n({...e,node_ids:P}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),e.delivery_type==="email"&&_.jsxs("div",{className:"space-y-4",children:[_.jsx(eet,{label:"Recipients",value:e.recipients||[],onChange:P=>n({...e,recipients:P}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),_.jsxs("details",{className:"group",children:[_.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[_.jsx(_m,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),_.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(gh,{label:"SMTP Host",value:e.smtp_host||"",onChange:P=>n({...e,smtp_host:P}),placeholder:"smtp.gmail.com"}),_.jsx(FU,{label:"SMTP Port",value:e.smtp_port??587,onChange:P=>n({...e,smtp_port:P}),min:1,max:65535})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(gh,{label:"Username",value:e.smtp_user||"",onChange:P=>n({...e,smtp_user:P})}),_.jsx(gh,{label:"Password",value:e.smtp_password||"",onChange:P=>n({...e,smtp_password:P}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),_.jsx(tS,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:P=>n({...e,smtp_tls:P})}),_.jsx(gh,{label:"From Address",value:e.from_address||"",onChange:P=>n({...e,from_address:P}),placeholder:"alerts@yourdomain.com"})]})]})]}),e.delivery_type==="webhook"&&_.jsx(gh,{label:"Webhook URL",value:e.webhook_url||"",onChange:P=>n({...e,webhook_url:P}),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."})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(FU,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:P=>n({...e,cooldown_minutes:P}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."}),r&&_.jsx("div",{className:"flex items-end pb-1",children:_.jsx(tS,{label:"Override Quiet Hours",checked:e.override_quiet??!1,onChange:P=>n({...e,override_quiet:P}),helper:"Deliver during quiet hours"})})]}),e.trigger_type!=="schedule"&&_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),_.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 rounded-lg border border-[#1e2a3a]",children:_.jsx("p",{className:"text-sm text-slate-300 font-mono",children:x()})}),_.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}function net(){var D,N;const[e,t]=W.useState(null),[r,n]=W.useState(null),[i,a]=W.useState([]),[o,s]=W.useState(!0),[l,u]=W.useState(!1),[c,f]=W.useState(null),[h,d]=W.useState(null),[v,g]=W.useState(null),[m,y]=W.useState(!1),[x,b]=W.useState(!1),S=W.useCallback(async()=>{try{const[B,$]=await Promise.all([fetch("/api/config/notifications"),fetch("/api/notifications/categories")]);if(!B.ok)throw new Error("Failed to fetch notifications config");const F=await B.json(),G=await $.json();t(F),n(JSON.parse(JSON.stringify(F))),a(G),b(!1),f(null)}catch(B){f(B instanceof Error?B.message:"Unknown error")}finally{s(!1)}},[]);W.useEffect(()=>{document.title="Notifications — MeshAI",S()},[S]),W.useEffect(()=>{e&&r&&b(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const T=async()=>{if(e){u(!0),f(null),d(null);try{const B=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),$=await B.json();if(!B.ok)throw new Error($.detail||"Save failed");d("Notifications config saved successfully"),n(JSON.parse(JSON.stringify(e))),b(!1),setTimeout(()=>d(null),3e3)}catch(B){f(B instanceof Error?B.message:"Save failed")}finally{u(!1)}}},A=()=>{r&&(t(JSON.parse(JSON.stringify(r))),b(!1))},M=()=>({name:"",enabled:!0,trigger_type:"condition",categories:[],min_severity:"warning",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}),P=()=>{e&&t({...e,rules:[...e.rules||[],M()]})},k=B=>{if(!e)return;const $=$U.find(F=>F.id===B);$&&(t({...e,rules:[...e.rules||[],{...$.rule}]}),y(!1))},I=B=>{if(!e)return;const $=e.rules[B],F={...JSON.parse(JSON.stringify($)),name:`${$.name} (copy)`},G=[...e.rules];G.splice(B+1,0,F),t({...e,rules:G})},O=async B=>{try{const F=await(await fetch(`/api/notifications/rules/${B}/test`,{method:"POST"})).json();g(F),setTimeout(()=>g(null),5e3)}catch{g({success:!1,message:"Test failed"}),setTimeout(()=>g(null),5e3)}};return o?_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?_.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("div",{children:_.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."})}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("button",{onClick:S,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:_.jsx(wZ,{size:18})}),_.jsxs("button",{onClick:A,disabled:!x,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:[_.jsx(SZ,{size:16}),"Discard"]}),_.jsxs("button",{onClick:T,disabled:l||!x,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:[_.jsx(TZ,{size:16}),l?"Saving...":"Save"]})]})]}),c&&_.jsx("div",{className:"p-3 rounded-lg text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:c}),h&&_.jsxs("div",{className:"p-3 rounded-lg text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[_.jsx(gd,{size:14,className:"inline mr-2"}),h]}),v&&_.jsxs("div",{className:`p-3 rounded-lg text-sm ${v.success?"bg-green-500/10 text-green-400 border border-green-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[v.success?_.jsx(gd,{size:14,className:"inline mr-2"}):_.jsx(fv,{size:14,className:"inline mr-2"}),v.message]}),_.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6 space-y-6",children:[_.jsx(tS,{label:"Enable Notifications",checked:e.enabled,onChange:B=>t({...e,enabled:B}),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&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ece,{size:14,className:"text-slate-400"}),_.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Quiet Hours"})]}),_.jsx(tS,{label:"Enable Quiet Hours",checked:e.quiet_hours_enabled??!0,onChange:B=>t({...e,quiet_hours_enabled:B}),helper:"Suppress non-emergency alerts during sleeping hours",info:"When enabled, alerts below emergency severity are held during quiet hours. When disabled, all alerts deliver anytime."}),e.quiet_hours_enabled&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsx(rS,{label:"Start Time",value:e.quiet_hours_start||"22:00",onChange:B=>t({...e,quiet_hours_start:B}),helper:"When quiet hours begin"}),_.jsx(rS,{label:"End Time",value:e.quiet_hours_end||"06:00",onChange:B=>t({...e,quiet_hours_end:B}),helper:"When quiet hours end"})]}),_.jsx("p",{className:"text-xs text-slate-600",children:'Emergency alerts and rules with "Override Quiet Hours" enabled always deliver.'})]})]}),_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",_.jsx(No,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),_.jsxs("span",{className:"text-xs text-slate-500",children:[((D=e.rules)==null?void 0:D.length)||0," rule",(((N=e.rules)==null?void 0:N.length)||0)!==1?"s":""]})]}),(e.rules||[]).map((B,$)=>_.jsx(ret,{rule:B,categories:i,quietHoursEnabled:e.quiet_hours_enabled??!0,onChange:F=>{const G=[...e.rules||[]];G[$]=F,t({...e,rules:G})},onDelete:()=>{confirm(`Delete rule "${B.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((F,G)=>G!==$)})},onDuplicate:()=>I($),onTest:()=>O($)},$)),_.jsxs("div",{className:"flex gap-2",children:[_.jsxs("button",{onClick:P,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:[_.jsx(_S,{size:16})," Add Rule"]}),_.jsxs("div",{className:"relative",children:[_.jsxs("button",{onClick:()=>y(!m),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:[_.jsx(xZ,{size:16})," Add from Template"]}),m&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>y(!1)}),_.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:[_.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),$U.map(B=>_.jsxs("button",{onClick:()=>k(B.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[_.jsx("div",{className:"font-medium text-slate-200",children:B.name}),_.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:B.description})]},B.id))]})]})]})]})]})]})]})]}):_.jsx("div",{className:"flex items-center justify-center h-64",children:_.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const VU=[{id:"stream-gauges",label:"Stream Gauges",icon:zE},{id:"wildfire",label:"Wildfire",icon:VE},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:WE},{id:"weather-alerts",label:"Weather Alerts",icon:Yue},{id:"solar",label:"Solar & Geomagnetic",icon:Fb},{id:"ducting",label:"Tropospheric Ducting",icon:eu},{id:"avalanche",label:"Avalanche Danger",icon:GE},{id:"traffic",label:"Traffic Flow",icon:BE},{id:"roads-511",label:"Road Conditions (511)",icon:gZ},{id:"mesh-health",label:"Mesh Health",icon:Gy},{id:"notifications",label:"Notifications",icon:xm},{id:"commands",label:"Commands",icon:CZ},{id:"api",label:"API Reference",icon:Xue}];function ar({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 _.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function Xt({headers:e,rows:t}){return _.jsx("div",{className:"overflow-x-auto my-4",children:_.jsxs("table",{className:"w-full text-sm",children:[_.jsx("thead",{children:_.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>_.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),_.jsx("tbody",{children:t.map((r,n)=>_.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>_.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function Rt({href:e,children:t}){return _.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",_.jsx(yd,{size:12})]})}function Te({children:e}){return _.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function iP({children:e}){return _.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function Ue({children:e}){return _.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function pi({id:e,title:t,children:r}){return _.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[_.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),_.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function iet(){const e=cv(),[t,r]=W.useState(""),[n,i]=W.useState("stream-gauges"),a=W.useRef(null);W.useEffect(()=>{const l=e.hash.replace("#","");if(l&&VU.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=VU.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 _.jsxs("div",{className:"flex h-full -m-6",children:[_.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[_.jsx("div",{className:"p-4 border-b border-border",children:_.jsxs("div",{className:"relative",children:[_.jsx(HE,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),_.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"})]})}),_.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return _.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:[_.jsx(u,{size:16}),l.label]},l.id)})})]}),_.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:_.jsxs("div",{className:"max-w-4xl",children:[_.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),_.jsxs(pi,{id:"stream-gauges",title:"Stream Gauges",children:[_.jsx(Te,{children:"What You're Looking At"}),_.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),_.jsxs("p",{children:[_.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.`]}),_.jsxs("p",{children:[_.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:`]}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsx("li",{children:"A small creek: 50-200 CFS"}),_.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),_.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),_.jsx(Te,{children:"When Does It Flood?"}),_.jsxs("p",{children:["Flood levels are set by the ",_.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.']}),_.jsxs("p",{children:[_.jsx("strong",{children:"Action Stage"})," — water is rising, time to start paying attention. Usually still inside the riverbanks."]}),_.jsxs("p",{children:[_.jsx("strong",{children:"Minor Flood"})," — low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),_.jsxs("p",{children:[_.jsx("strong",{children:"Moderate Flood"})," — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),_.jsxs("p",{children:[_.jsx("strong",{children:"Major Flood"})," — widespread flooding. Many people evacuating. Serious property damage."]}),_.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."}),_.jsx(Te,{children:"Low Water / Drought"}),_.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.`}),_.jsx(Te,{children:"Setting It Up"}),_.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:["Find your gauge at ",_.jsx(Rt,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),_.jsxs("li",{children:["Copy the site number (like ",_.jsx(Ue,{children:"13090500"}),")"]}),_.jsx("li",{children:"Add it in Config → Environmental → USGS"}),_.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),_.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."}),_.jsx(Te,{children:"Learn More"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Rt,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," — find gauges near you"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," — flood forecasts and thresholds"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," — USGS explainer"]})]})]}),_.jsxs(pi,{id:"wildfire",title:"Wildfire",children:[_.jsx(Te,{children:"What You're Looking At"}),_.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."}),_.jsx(Te,{children:"Fire Size — How Big Is It?"}),_.jsx(Xt,{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."]]}),_.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),_.jsx(Te,{children:"Containment — Is It Under Control?"}),_.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."}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx("strong",{children:"0-30%"})," — Essentially uncontrolled. The fire goes where it wants."]}),_.jsxs("li",{children:[_.jsx("strong",{children:"50%"})," — Good progress, but half the edge can still grow."]}),_.jsxs("li",{children:[_.jsx("strong",{children:"80%+"})," — Well controlled. Major growth unlikely."]}),_.jsxs("li",{children:[_.jsx("strong",{children:"100%"}),' — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),_.jsx(Te,{children:"How Far Away Should I Worry?"}),_.jsx(Xt,{headers:["Distance","What To Do"],rows:[[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"red"})," Under 5 km (3 miles)"]}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"orange"})," 5-15 km (3-10 miles)"]}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"yellow"})," 15-30 km (10-20 miles)"]}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"green"})," Over 30 km (20 miles)"]}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),_.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."}),_.jsx(Te,{children:"Which Matters More — Size or Distance?"}),_.jsxs("p",{children:[_.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."]}),_.jsx(Te,{children:"Setting It Up"}),_.jsxs("p",{children:["Just configure your state code (like ",_.jsx(Ue,{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."]}),_.jsx(Te,{children:"Learn More"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Rt,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," — detailed incident information"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," — raw perimeter data"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," — preparedness guide"]})]})]}),_.jsxs(pi,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[_.jsx(Te,{children:"What You're Looking At"}),_.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.`}),_.jsxs("p",{children:[_.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",_.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."]}),_.jsx(Te,{children:"Confidence — Is It Really a Fire?"}),_.jsx("p",{children:"Each detection gets a confidence rating:"}),_.jsx(Xt,{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."]]}),_.jsxs("p",{children:[_.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.`]}),_.jsx(Te,{children:"FRP — How Intense Is It?"}),_.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),_.jsx(Xt,{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"]]}),_.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),_.jsx(Te,{children:"New Ignition Detection"}),_.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 ",_.jsx("strong",{children:"potential new ignition"})," — maybe a new fire just started. These get elevated priority regardless of confidence level."]}),_.jsx(Te,{children:"Timing"}),_.jsxs("p",{children:["Satellite data arrives ",_.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",_.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."`]}),_.jsx(Te,{children:"Getting an API Key"}),_.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:["Go to ",_.jsx(Rt,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),_.jsx("li",{children:'Click "Get MAP_KEY"'}),_.jsx("li",{children:"Register for a free Earthdata account"}),_.jsx("li",{children:"Your key arrives by email"}),_.jsx("li",{children:"Enter it in Config → Environmental → FIRMS"})]}),_.jsx(Te,{children:"Learn More"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Rt,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," — see hotspots on a map"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," — how it works"]})]})]}),_.jsxs(pi,{id:"weather-alerts",title:"Weather Alerts",children:[_.jsx(Te,{children:"What You're Looking At"}),_.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories."}),_.jsx(Te,{children:"Alert Severity — How Serious Is It?"}),_.jsx(Xt,{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"]]}),_.jsx(Te,{children:"When Should I Act? (Urgency)"}),_.jsx(Xt,{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"]]}),_.jsx(Te,{children:"How Sure Are They? (Certainty)"}),_.jsx(Xt,{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"]]}),_.jsx(Te,{children:"These Are Separate Scales"}),_.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."'}),_.jsx(Te,{children:"What Minimum Severity Should I Set?"}),_.jsx(Xt,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything — high volume","Nothing"],[_.jsxs(_.Fragment,{children:[_.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"]]}),_.jsxs("p",{children:[_.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."]}),_.jsx(Te,{children:"Finding Your NWS Zone"}),_.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:["Go to ",_.jsx(Rt,{href:"https://www.weather.gov",children:"weather.gov"})]}),_.jsx("li",{children:"Enter your location"}),_.jsxs("li",{children:["Find your zone code at ",_.jsx(Rt,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),_.jsxs("li",{children:["Zone codes look like: ",_.jsx(Ue,{children:"IDZ016"}),", ",_.jsx(Ue,{children:"UTZ040"}),", etc."]})]}),_.jsx(Te,{children:"The User-Agent Field"}),_.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:"}),_.jsx("p",{children:_.jsx(Ue,{children:"(meshai, you@email.com)"})}),_.jsx("p",{children:"No registration. No waiting. Just type it in."}),_.jsx(Te,{children:"Learn More"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Rt,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," — see current alerts"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," — technical details"]})]})]}),_.jsxs(pi,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[_.jsx(Te,{children:"What You're Looking At"}),_.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."}),_.jsx(Te,{children:"Solar Flux Index (SFI)"}),_.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.'}),_.jsx(Xt,{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."]]}),_.jsxs("p",{children:[_.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),_.jsx(Te,{children:"Kp Index"}),_.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."}),_.jsx(Xt,{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."],[_.jsx("strong",{children:"5"}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60°N)."]})],[_.jsx("strong",{children:"6"}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55°N)."]})],[_.jsx("strong",{children:"7"}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[_.jsx("strong",{children:"8-9"}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),_.jsx(Te,{children:"R / S / G Scales"}),_.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),_.jsx(iP,{children:"R (Radio Blackouts) — from solar flares:"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),_.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),_.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),_.jsx(iP,{children:"S (Solar Radiation Storms) — from energetic particles:"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsx("li",{children:"Mostly affects polar regions and satellites"}),_.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),_.jsx(iP,{children:"G (Geomagnetic Storms) — from solar wind disturbances:"}),_.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:_.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),_.jsx(Te,{children:"Bz — The Storm Predictor"}),_.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."}),_.jsx(Xt,{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."]]}),_.jsx("p",{children:"Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips."}),_.jsx(Te,{children:"Learn More"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Rt,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," — live data"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," — what R/S/G mean"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," — ham-friendly display"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," — live Kp"]})]})]}),_.jsxs(pi,{id:"ducting",title:"Tropospheric Ducting",children:[_.jsx(Te,{children:"What You're Looking At"}),_.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.'}),_.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),_.jsx(Te,{children:"How Do I Know If Ducting Is Happening?"}),_.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),_.jsx(Xt,{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.']]}),_.jsx(Te,{children:"What You'll Actually Notice"}),_.jsx("p",{children:"When ducting happens on your mesh:"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),_.jsx("li",{children:"Nodes appear from far outside your normal range"}),_.jsx("li",{children:"You hear FM radio stations from other cities"}),_.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),_.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),_.jsx(Te,{children:"The dM/dz Number"}),_.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:`}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Below -50"})," = strong ducting — classic VHF/UHF DX event"]})]}),_.jsx(Te,{children:"When Does Ducting Happen?"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),_.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),_.jsx("li",{children:"Most common in late summer and early fall"}),_.jsx("li",{children:"Strongest along coastlines and over water"}),_.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),_.jsx(Te,{children:"Setting It Up"}),_.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."}),_.jsx(Te,{children:"Learn More"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Rt,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," — 6-day tropo prediction"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://dxmaps.com",children:"DX Maps"})," — real-time VHF/UHF propagation reports"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," — background"]})]})]}),_.jsxs(pi,{id:"avalanche",title:"Avalanche Danger",children:[_.jsx(Te,{children:"What You're Looking At"}),_.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."}),_.jsx(Te,{children:"The Danger Scale"}),_.jsx(Xt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",_.jsx(ar,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",_.jsx(ar,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",_.jsx(ar,{color:"orange"}),_.jsxs(_.Fragment,{children:[_.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",_.jsx(ar,{color:"red"}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",_.jsx(ar,{color:"black"}),_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),_.jsx(Te,{children:"The Most Important Thing to Know"}),_.jsxs("p",{children:[_.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.']}),_.jsx(Te,{children:"Seasonal"}),_.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.'}),_.jsx(Te,{children:"Finding Your Avalanche Center"}),_.jsxs("p",{children:["Go to ",_.jsx(Rt,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Ue,{children:"SNFAC"})," — Sawtooth (central Idaho)"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"UAC"})," — Utah"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"NWAC"})," — Cascades/Olympics (WA/OR)"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"CAIC"})," — Colorado"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"SAC"})," — Sierra Nevada (CA)"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GNFAC"})," — Gallatin (SW Montana)"]})]}),_.jsx(Te,{children:"Learn More"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Rt,{href:"https://avalanche.org",children:"Avalanche.org"})," — US forecasts"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," — full scale explanation"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://kbyg.org",children:"Know Before You Go"})," — avalanche awareness"]})]})]}),_.jsxs(pi,{id:"traffic",title:"Traffic Flow",children:[_.jsx(Te,{children:"What You're Looking At"}),_.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),_.jsx(Te,{children:"Speed Ratio — The Key Number"}),_.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:'}),_.jsx(Xt,{headers:["Ratio","What It Means"],rows:[[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),_.jsxs("p",{children:[_.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.`]}),_.jsx(Te,{children:"Confidence — Can You Trust the Data?"}),_.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),_.jsx(Xt,{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",_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Unreliable"})," — mostly guessing from historical patterns. Don't alert on this."]})]]}),_.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."}),_.jsx(Te,{children:"Setting Up Corridors"}),_.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),_.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[_.jsx("li",{children:"Go to Google Maps, find the road"}),_.jsx("li",{children:`Right-click the road → "What's here?" → copy the coordinates`}),_.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),_.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),_.jsx(Te,{children:"Getting an API Key"}),_.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:["Sign up at ",_.jsx(Rt,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),_.jsx("li",{children:"Create an app → get your API key"}),_.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),_.jsx(Te,{children:"Learn More"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Rt,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," — API docs and key signup"]}),_.jsxs("li",{children:[_.jsx(Rt,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," — city congestion rankings"]})]})]}),_.jsxs(pi,{id:"roads-511",title:"Road Conditions (511)",children:[_.jsx(Te,{children:"What You're Looking At"}),_.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."}),_.jsx(Te,{children:"Setting It Up"}),_.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."}),_.jsx("p",{children:"Configure in Config → Environmental → 511:"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx("strong",{children:"Base URL"})," — your state's API endpoint"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"API Key"})," — if required by your state"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Endpoints"})," — which data feeds to poll (varies by state)"]})]}),_.jsx(Te,{children:"Learn More"}),_.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),_.jsxs(pi,{id:"mesh-health",title:"Mesh Health",children:[_.jsx(Te,{children:"Health Score"}),_.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas:"}),_.jsx(Xt,{headers:["Area","Weight","What It Checks"],rows:[["Infrastructure","30%","Are your routers and repeaters online and healthy?"],["Utilization","25%","Is the radio channel getting congested?"],["Coverage","20%","Do nodes have backup paths, or single points of failure?"],["Behavior","15%","Are nodes behaving normally (packet patterns, responsiveness)?"],["Power","10%","Battery levels, solar charging, power stability"]]}),_.jsx(Te,{children:"Health Tiers"}),_.jsx(Xt,{headers:["Score","Tier","What It Means"],rows:[["90-100",_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),_.jsx(Te,{children:"Channel Utilization — Is the Radio Channel Full?"}),_.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."}),_.jsx(Xt,{headers:["Utilization","What's Happening"],rows:[[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target."],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[_.jsxs(_.Fragment,{children:[_.jsx(ar,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),_.jsx(Te,{children:"Packet Flooding"}),_.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:_.jsx("strong",{children:'⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),_.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."}),_.jsx(Xt,{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."]]}),_.jsx(Te,{children:"Battery Levels"}),_.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:"}),_.jsx(Xt,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[_.jsx("strong",{children:"3.60V"}),_.jsx("strong",{children:"~30%"}),_.jsx(_.Fragment,{children:_.jsx("strong",{children:"⚠️ Warning — charge it soon"})})],[_.jsx("strong",{children:"3.50V"}),_.jsx("strong",{children:"~15%"}),_.jsx(_.Fragment,{children:_.jsx("strong",{children:"🔴 Low — charge it now"})})],[_.jsx("strong",{children:"3.40V"}),_.jsx("strong",{children:"~7%"}),_.jsx(_.Fragment,{children:_.jsx("strong",{children:"⚫ About to die"})})],["3.30V","~3%","Device shutting down"]]}),_.jsxs("p",{children:[_.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."]}),_.jsx(Te,{children:"Node Offline Detection"}),_.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:`}),_.jsx(Xt,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",_.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."]]}),_.jsxs("p",{children:[_.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.`]})]}),_.jsxs(pi,{id:"notifications",title:"Notifications",children:[_.jsx(Te,{children:"How It Works"}),_.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx("strong",{children:"Something happens"})," — a fire is detected, weather warning issued, node goes offline, etc."]}),_.jsxs("li",{children:[_.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?"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"If a rule matches"})," — MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),_.jsx(Te,{children:"Building Rules"}),_.jsx("p",{children:"Each rule answers three questions:"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),_.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),_.jsx(Te,{children:"Severity Levels — What Should I Set?"}),_.jsx(Xt,{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"],[_.jsxs(_.Fragment,{children:[_.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"]]}),_.jsxs("p",{children:[_.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."]}),_.jsx(Te,{children:"Quiet Hours"}),_.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.'}),_.jsx("p",{children:"You can turn quiet hours off entirely if you don't want them."}),_.jsx(Te,{children:"Webhook — The Swiss Army Knife"}),_.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx("strong",{children:"Discord"})," — use a Discord webhook URL"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Slack"})," — use a Slack incoming webhook URL"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"ntfy.sh"})," — POST to ",_.jsx(Ue,{children:"https://ntfy.sh/your-topic"})]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Pushover"})," — POST to the Pushover API"]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Home Assistant"})," — POST to an automation webhook URL"]}),_.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),_.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),_.jsxs(pi,{id:"commands",title:"Commands",children:[_.jsxs("p",{children:["All commands use the ",_.jsx(Ue,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),_.jsx(Te,{children:"Basic Commands"}),_.jsx(Xt,{headers:["Command","What It Does"],rows:[[_.jsx(Ue,{children:"!help"}),"Shows all available commands"],[_.jsx(Ue,{children:"!ping"}),"Tests if the bot is alive"],[_.jsx(Ue,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[_.jsx(Ue,{children:"!health"}),"Detailed health report with pillar scores"],[_.jsx(Ue,{children:"!weather"}),"Current weather for your area"]]}),_.jsx(Te,{children:"Environmental Commands"}),_.jsx(Xt,{headers:["Command","What It Does"],rows:[[_.jsx(Ue,{children:"!alerts"}),"Active NWS weather alerts for your area"],[_.jsxs(_.Fragment,{children:[_.jsx(Ue,{children:"!solar"})," (or ",_.jsx(Ue,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[_.jsx(Ue,{children:"!fire"}),"Active wildfires near your mesh"],[_.jsx(Ue,{children:"!avy"}),'Avalanche advisory (seasonal — shows "off season" in summer)'],[_.jsxs(_.Fragment,{children:[_.jsx(Ue,{children:"!streams"})," (or ",_.jsx(Ue,{children:"!gauges"}),")"]}),"Stream gauge readings"],[_.jsxs(_.Fragment,{children:[_.jsx(Ue,{children:"!roads"})," (or ",_.jsx(Ue,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[_.jsx(Ue,{children:"!hotspots"}),"Satellite fire detections"]]}),_.jsx(Te,{children:"Subscription Commands"}),_.jsx(Xt,{headers:["Command","What It Does"],rows:[[_.jsx(Ue,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[_.jsx(Ue,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[_.jsx(Ue,{children:"!subscribe all"}),"Subscribe to everything"],[_.jsx(Ue,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[_.jsx(Ue,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),_.jsx(Te,{children:"Conversational"}),_.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.`})]}),_.jsxs(pi,{id:"api",title:"API Reference",children:[_.jsxs("p",{children:["MeshAI's REST API is available at ",_.jsx(Ue,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),_.jsx(Te,{children:"System"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/status"})," — version, uptime, node count"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/channels"})," — radio channel list"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"POST /api/restart"})," — restart the bot"]})]}),_.jsx(Te,{children:"Mesh Data"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/health"})," — health score and pillars"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/nodes"})," — all nodes with positions and telemetry"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/edges"})," — neighbor links with signal quality"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/regions"})," — region summaries"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/sources"})," — data source health"]})]}),_.jsx(Te,{children:"Configuration"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/config"})," — full config"]}),_.jsxs("li",{children:[_.jsxs(Ue,{children:["GET /api/config/","{section}"]})," — one section"]}),_.jsxs("li",{children:[_.jsxs(Ue,{children:["PUT /api/config/","{section}"]})," — update a section"]})]}),_.jsx(Te,{children:"Environmental"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/env/status"})," — per-feed health"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/env/active"})," — all active events"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/env/swpc"})," — solar/geomagnetic data"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/env/ducting"})," — atmospheric profile"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/env/fires"})," — wildfire perimeters"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/env/hotspots"})," — satellite fire detections"]})]}),_.jsx(Te,{children:"Alerts"}),_.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/alerts/active"})," — current alerts"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/alerts/history"})," — past alerts"]}),_.jsxs("li",{children:[_.jsx(Ue,{children:"GET /api/notifications/categories"})," — available alert categories"]})]}),_.jsx(Te,{children:"Real-time"}),_.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:_.jsxs("li",{children:[_.jsx(Ue,{children:"ws://your-host:8080/ws/live"})," — WebSocket for live updates"]})})]})]})})]})}function aet(){return _.jsx(_ce,{children:_.jsx(Sce,{children:_.jsxs(Mue,{children:[_.jsx(cl,{path:"/",element:_.jsx(rNe,{})}),_.jsx(cl,{path:"/mesh",element:_.jsx(xJe,{})}),_.jsx(cl,{path:"/environment",element:_.jsx(TJe,{})}),_.jsx(cl,{path:"/config",element:_.jsx(HJe,{})}),_.jsx(cl,{path:"/alerts",element:_.jsx(JJe,{})}),_.jsx(cl,{path:"/notifications",element:_.jsx(net,{})}),_.jsx(cl,{path:"/reference",element:_.jsx(iet,{})})]})})})}aP.createRoot(document.getElementById("root")).render(_.jsx(Q.StrictMode,{children:_.jsx(Due,{children:_.jsx(aet,{})})})); + */(function(e,t){(function(r,n){n(t)})(ag,function(r){var n="1.9.4";function i(p){var w,C,E,j;for(C=1,E=arguments.length;C"u"||!L||!L.Mixin)){p=b(p)?p:[p];for(var w=0;w0?Math.floor(p):Math.ceil(p)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(p){return this.clone()._add(H(p))},_add:function(p){return this.x+=p.x,this.y+=p.y,this},subtract:function(p){return this.clone()._subtract(H(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 z(this.x*p.x,this.y*p.y)},unscaleBy:function(p){return new z(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=H(p);var w=p.x-this.x,C=p.y-this.y;return Math.sqrt(w*w+C*C)},equals:function(p){return p=H(p),p.x===this.x&&p.y===this.y},contains:function(p){return p=H(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 H(p,w,C){return p instanceof z?p:b(p)?new z(p[0],p[1]):p==null?p:typeof p=="object"&&"x"in p&&"y"in p?new z(p.x,p.y):new z(p,w,C)}function Y(p,w){if(p)for(var C=w?[p,w]:p,E=0,j=C.length;E=this.min.x&&C.x<=this.max.x&&w.y>=this.min.y&&C.y<=this.max.y},intersects:function(p){p=Z(p);var w=this.min,C=this.max,E=p.min,j=p.max,V=j.x>=w.x&&E.x<=C.x,X=j.y>=w.y&&E.y<=C.y;return V&&X},overlaps:function(p){p=Z(p);var w=this.min,C=this.max,E=p.min,j=p.max,V=j.x>w.x&&E.xw.y&&E.y=w.lat&&j.lat<=C.lat&&E.lng>=w.lng&&j.lng<=C.lng},intersects:function(p){p=ae(p);var w=this._southWest,C=this._northEast,E=p.getSouthWest(),j=p.getNorthEast(),V=j.lat>=w.lat&&E.lat<=C.lat,X=j.lng>=w.lng&&E.lng<=C.lng;return V&&X},overlaps:function(p){p=ae(p);var w=this._southWest,C=this._northEast,E=p.getSouthWest(),j=p.getNorthEast(),V=j.lat>w.lat&&E.latw.lng&&E.lng1,Qie=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}(),Jie=function(){return!!document.createElement("canvas").getContext}(),tA=!!(document.createElementNS&&Fe("svg").createSVGRect),eae=!!tA&&function(){var p=document.createElement("div");return p.innerHTML="",(p.firstChild&&p.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),tae=!tA&&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}}(),rae=navigator.platform.indexOf("Mac")===0,nae=navigator.platform.indexOf("Linux")===0;function Qa(p){return navigator.userAgent.toLowerCase().indexOf(p)>=0}var Ue={ie:Vt,ielt9:nr,edge:jn,webkit:qr,android:Jn,android23:kf,androidStock:T0,opera:JT,chrome:BR,gecko:zR,safari:Gie,phantom:$R,opera12:FR,win:Wie,ie3d:VR,webkit3d:eA,gecko3d:GR,any3d:Hie,mobile:qv,mobileWebkit:Uie,mobileWebkit3d:Zie,msPointer:WR,pointer:HR,touch:Yie,touchNative:UR,mobileOpera:Xie,mobileGecko:qie,retina:Kie,passiveEvents:Qie,canvas:Jie,svg:tA,vml:tae,inlineSvg:eae,mac:rae,linux:nae},ZR=Ue.msPointer?"MSPointerDown":"pointerdown",YR=Ue.msPointer?"MSPointerMove":"pointermove",XR=Ue.msPointer?"MSPointerUp":"pointerup",qR=Ue.msPointer?"MSPointerCancel":"pointercancel",rA={touchstart:ZR,touchmove:YR,touchend:XR,touchcancel:qR},KR={touchstart:uae,touchmove:A0,touchend:A0,touchcancel:A0},If={},QR=!1;function iae(p,w,C){return w==="touchstart"&&lae(),KR[w]?(C=KR[w].bind(this,C),p.addEventListener(rA[w],C,!1),C):(console.warn("wrong event specified:",w),f)}function aae(p,w,C){if(!rA[w]){console.warn("wrong event specified:",w);return}p.removeEventListener(rA[w],C,!1)}function oae(p){If[p.pointerId]=p}function sae(p){If[p.pointerId]&&(If[p.pointerId]=p)}function JR(p){delete If[p.pointerId]}function lae(){QR||(document.addEventListener(ZR,oae,!0),document.addEventListener(YR,sae,!0),document.addEventListener(XR,JR,!0),document.addEventListener(qR,JR,!0),QR=!0)}function A0(p,w){if(w.pointerType!==(w.MSPOINTER_TYPE_MOUSE||"mouse")){w.touches=[];for(var C in If)w.touches.push(If[C]);w.changedTouches=[w],p(w)}}function uae(p,w){w.MSPOINTER_TYPE_TOUCH&&w.pointerType===w.MSPOINTER_TYPE_TOUCH&&un(w),A0(p,w)}function cae(p){var w={},C,E;for(E in p)C=p[E],w[E]=C&&C.bind?C.bind(p):C;return p=w,w.type="dblclick",w.detail=2,w.isTrusted=!1,w._simulated=!0,w}var fae=200;function hae(p,w){p.addEventListener("dblclick",w);var C=0,E;function j(V){if(V.detail!==1){E=V.detail;return}if(!(V.pointerType==="mouse"||V.sourceCapabilities&&!V.sourceCapabilities.firesTouchEvents)){var X=i5(V);if(!(X.some(function(oe){return oe instanceof HTMLLabelElement&&oe.attributes.for})&&!X.some(function(oe){return oe instanceof HTMLInputElement||oe instanceof HTMLSelectElement}))){var te=Date.now();te-C<=fae?(E++,E===2&&w(cae(V))):E=1,C=te}}}return p.addEventListener("click",j),{dblclick:w,simDblclick:j}}function dae(p,w){p.removeEventListener("dblclick",w.dblclick),p.removeEventListener("click",w.simDblclick)}var nA=P0(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Kv=P0(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),e5=Kv==="webkitTransition"||Kv==="OTransition"?Kv+"End":"transitionend";function t5(p){return typeof p=="string"?document.getElementById(p):p}function Qv(p,w){var C=p.style[w]||p.currentStyle&&p.currentStyle[w];if((!C||C==="auto")&&document.defaultView){var E=document.defaultView.getComputedStyle(p,null);C=E?E[w]:null}return C==="auto"?null:C}function Tt(p,w,C){var E=document.createElement(p);return E.className=w||"",C&&C.appendChild(E),E}function ir(p){var w=p.parentNode;w&&w.removeChild(p)}function C0(p){for(;p.firstChild;)p.removeChild(p.firstChild)}function Of(p){var w=p.parentNode;w&&w.lastChild!==p&&w.appendChild(p)}function Ef(p){var w=p.parentNode;w&&w.firstChild!==p&&w.insertBefore(p,w.firstChild)}function iA(p,w){if(p.classList!==void 0)return p.classList.contains(w);var C=M0(p);return C.length>0&&new RegExp("(^|\\s)"+w+"(\\s|$)").test(C)}function ut(p,w){if(p.classList!==void 0)for(var C=v(w),E=0,j=C.length;E0?2*window.devicePixelRatio:1;function o5(p){return Ue.edge?p.wheelDeltaY/2:p.deltaY&&p.deltaMode===0?-p.deltaY/gae: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 gA(p,w){var C=w.relatedTarget;if(!C)return!0;try{for(;C&&C!==p;)C=C.parentNode}catch{return!1}return C!==p}var mae={__proto__:null,on:st,off:Ht,stopPropagation:Tu,disableScrollPropagation:pA,disableClickPropagation:rp,preventDefault:un,stop:Au,getPropagationPath:i5,getMousePosition:a5,getWheelDelta:o5,isExternalTarget:gA,addListener:st,removeListener:Ht},s5=G.extend({run:function(p,w,C,E){this.stop(),this._el=p,this._inProgress=!0,this._duration=C||.25,this._easeOutPower=1/Math.max(E||.5,.2),this._startPos=Su(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=O(this._animate,this),this._step()},_step:function(p){var w=+new Date-this._startTime,C=this._duration*1e3;wthis.options.maxZoom)?this.setZoom(p):this},panInsideBounds:function(p,w){this._enforcingBounds=!0;var C=this.getCenter(),E=this._limitCenter(C,this._zoom,ae(p));return C.equals(E)||this.panTo(E,w),this._enforcingBounds=!1,this},panInside:function(p,w){w=w||{};var C=H(w.paddingTopLeft||w.padding||[0,0]),E=H(w.paddingBottomRight||w.padding||[0,0]),j=this.project(this.getCenter()),V=this.project(p),X=this.getPixelBounds(),te=Z([X.min.add(C),X.max.subtract(E)]),oe=te.getSize();if(!te.contains(V)){this._enforcingBounds=!0;var he=V.subtract(te.getCenter()),Ee=te.extend(V).getSize().subtract(oe);j.x+=he.x<0?-Ee.x:Ee.x,j.y+=he.y<0?-Ee.y:Ee.y,this.panTo(this.unproject(j),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 C=this.getSize(),E=w.divideBy(2).round(),j=C.divideBy(2).round(),V=E.subtract(j);return!V.x&&!V.y?this:(p.animate&&p.pan?this.panBy(V):(p.pan&&this._rawPanBy(V),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:C}))},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),C=o(this._handleGeolocationError,this);return p.watch?this._locationWatchId=navigator.geolocation.watchPosition(w,C,p):navigator.geolocation.getCurrentPosition(w,C,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,C=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: "+C+"."})}},_handleGeolocationResponse:function(p){if(this._container._leaflet_id){var w=p.coords.latitude,C=p.coords.longitude,E=new ce(w,C),j=E.toBounds(p.coords.accuracy*2),V=this._locateOptions;if(V.setView){var X=this.getBoundsZoom(j);this.setView(E,V.maxZoom?Math.min(X,V.maxZoom):X)}var te={latlng:E,bounds:j,timestamp:p.timestamp};for(var oe in p.coords)typeof p.coords[oe]=="number"&&(te[oe]=p.coords[oe]);this.fire("locationfound",te)}},addHandler:function(p,w){if(!w)return this;var C=this[p]=new w(this);return this._handlers.push(C),this.options[p]&&C.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(),ir(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)ir(this._panes[p]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(p,w){var C="leaflet-pane"+(p?" leaflet-"+p.replace("Pane","")+"-pane":""),E=Tt("div",C,w||this._mapPane);return p&&(this._panes[p]=E),E},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()),C=this.unproject(p.getTopRight());return new J(w,C)},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,C){p=ae(p),C=H(C||[0,0]);var E=this.getZoom()||0,j=this.getMinZoom(),V=this.getMaxZoom(),X=p.getNorthWest(),te=p.getSouthEast(),oe=this.getSize().subtract(C),he=Z(this.project(te,E),this.project(X,E)).getSize(),Ee=Ue.any3d?this.options.zoomSnap:1,et=oe.x/he.x,pt=oe.y/he.y,Rn=w?Math.max(et,pt):Math.min(et,pt);return E=this.getScaleZoom(Rn,E),Ee&&(E=Math.round(E/(Ee/100))*(Ee/100),E=w?Math.ceil(E/Ee)*Ee:Math.floor(E/Ee)*Ee),Math.max(j,Math.min(V,E))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(p,w){var C=this._getTopLeftPoint(p,w);return new Y(C,C.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 C=this.options.crs;return w=w===void 0?this._zoom:w,C.scale(p)/C.scale(w)},getScaleZoom:function(p,w){var C=this.options.crs;w=w===void 0?this._zoom:w;var E=C.zoom(p*C.scale(w));return isNaN(E)?1/0:E},project:function(p,w){return w=w===void 0?this._zoom:w,this.options.crs.latLngToPoint(ge(p),w)},unproject:function(p,w){return w=w===void 0?this._zoom:w,this.options.crs.pointToLatLng(H(p),w)},layerPointToLatLng:function(p){var w=H(p).add(this.getPixelOrigin());return this.unproject(w)},latLngToLayerPoint:function(p){var w=this.project(ge(p))._round();return w._subtract(this.getPixelOrigin())},wrapLatLng:function(p){return this.options.crs.wrapLatLng(ge(p))},wrapLatLngBounds:function(p){return this.options.crs.wrapLatLngBounds(ae(p))},distance:function(p,w){return this.options.crs.distance(ge(p),ge(w))},containerPointToLayerPoint:function(p){return H(p).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(p){return H(p).add(this._getMapPanePos())},containerPointToLatLng:function(p){var w=this.containerPointToLayerPoint(H(p));return this.layerPointToLatLng(w)},latLngToContainerPoint:function(p){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ge(p)))},mouseEventToContainerPoint:function(p){return a5(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=t5(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=Qv(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),Cr(this._mapPane,new z(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,C){Cr(this._mapPane,new z(0,0));var E=!this._loaded;this._loaded=!0,w=this._limitZoom(w),this.fire("viewprereset");var j=this._zoom!==w;this._moveStart(j,C)._move(p,w)._moveEnd(j),this.fire("viewreset"),E&&this.fire("load")},_moveStart:function(p,w){return p&&this.fire("zoomstart"),w||this.fire("movestart"),this},_move:function(p,w,C,E){w===void 0&&(w=this._zoom);var j=this._zoom!==w;return this._zoom=w,this._lastCenter=p,this._pixelOrigin=this._getNewPixelOrigin(p),E?C&&C.pinch&&this.fire("zoom",C):((j||C&&C.pinch)&&this.fire("zoom",C),this.fire("move",C)),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){Cr(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?Ht: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=O(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 C=[],E,j=w==="mouseout"||w==="mouseover",V=p.target||p.srcElement,X=!1;V;){if(E=this._targets[l(V)],E&&(w==="click"||w==="preclick")&&this._draggableMoved(E)){X=!0;break}if(E&&E.listens(w,!0)&&(j&&!gA(V,p)||(C.push(E),j))||V===this._container)break;V=V.parentNode}return!C.length&&!X&&!j&&this.listens(w,!0)&&(C=[this]),C},_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 C=p.type;C==="mousedown"&&cA(w),this._fireDOMEvent(p,C)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(p,w,C){if(p.type==="click"){var E=i({},p);E.type="preclick",this._fireDOMEvent(E,E.type,C)}var j=this._findEventTargets(p,w);if(C){for(var V=[],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(),C=this.getMaxZoom(),E=Ue.any3d?this.options.zoomSnap:1;return E&&(p=Math.round(p/E)*E),Math.max(w,Math.min(C,p))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_r(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(p,w){var C=this._getCenterOffset(p)._trunc();return(w&&w.animate)!==!0&&!this.getSize().contains(C)?!1:(this.panBy(C,w),!0)},_createAnimProxy:function(){var p=this._proxy=Tt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(p),this.on("zoomanim",function(w){var C=nA,E=this._proxy.style[C];wu(this._proxy,this.project(w.center,w.zoom),this.getZoomScale(w.zoom,1)),E===this._proxy.style[C]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ir(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var p=this.getCenter(),w=this.getZoom();wu(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,C){if(this._animatingZoom)return!0;if(C=C||{},!this._zoomAnimated||C.animate===!1||this._nothingToAnimate()||Math.abs(w-this._zoom)>this.options.zoomAnimationThreshold)return!1;var E=this.getZoomScale(w),j=this._getCenterOffset(p)._divideBy(1-1/E);return C.animate!==!0&&!this.getSize().contains(j)?!1:(O(function(){this._moveStart(!0,C.noMoveStart||!1)._animateZoom(p,w,!0)},this),!0)},_animateZoom:function(p,w,C,E){this._mapPane&&(C&&(this._animatingZoom=!0,this._animateToCenter=p,this._animateToZoom=w,ut(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:p,zoom:w,noUpdate:E}),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 yae(p,w){return new bt(p,w)}var ba=B.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),C=this.getPosition(),E=p._controlCorners[C];return ut(w,"leaflet-control"),C.indexOf("bottom")!==-1?E.insertBefore(w,E.firstChild):E.appendChild(w),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ir(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()}}),np=function(p){return new ba(p)};bt.include({addControl:function(p){return p.addTo(this),this},removeControl:function(p){return p.remove(),this},_initControlPos:function(){var p=this._controlCorners={},w="leaflet-",C=this._controlContainer=Tt("div",w+"control-container",this._container);function E(j,V){var X=w+j+" "+w+V;p[j+V]=Tt("div",X,C)}E("top","left"),E("top","right"),E("bottom","left"),E("bottom","right")},_clearControlPos:function(){for(var p in this._controlCorners)ir(this._controlCorners[p]);ir(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var l5=ba.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(p,w,C,E){return C1,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)),C=w.overlay?p.type==="add"?"overlayadd":"overlayremove":p.type==="add"?"baselayerchange":null;C&&this._map.fire(C,w)},_createRadioElement:function(p,w){var C='",E=document.createElement("div");return E.innerHTML=C,E.firstChild},_addItem:function(p){var w=document.createElement("label"),C=this._map.hasLayer(p.layer),E;p.overlay?(E=document.createElement("input"),E.type="checkbox",E.className="leaflet-control-layers-selector",E.defaultChecked=C):E=this._createRadioElement("leaflet-base-layers_"+l(this),C),this._layerControlInputs.push(E),E.layerId=l(p.layer),st(E,"click",this._onInputClick,this);var j=document.createElement("span");j.innerHTML=" "+p.name;var V=document.createElement("span");w.appendChild(V),V.appendChild(E),V.appendChild(j);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,C,E=[],j=[];this._handlingClick=!0;for(var V=p.length-1;V>=0;V--)w=p[V],C=this._getLayer(w.layerId).layer,w.checked?E.push(C):w.checked||j.push(C);for(V=0;V=0;j--)w=p[j],C=this._getLayer(w.layerId).layer,w.disabled=C.options.minZoom!==void 0&&EC.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",un),this.expand();var w=this;setTimeout(function(){Ht(p,"click",un),w._preventClick=!1})}}),xae=function(p,w,C){return new l5(p,w,C)},mA=ba.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(p){var w="leaflet-control-zoom",C=Tt("div",w+" leaflet-bar"),E=this.options;return this._zoomInButton=this._createButton(E.zoomInText,E.zoomInTitle,w+"-in",C,this._zoomIn),this._zoomOutButton=this._createButton(E.zoomOutText,E.zoomOutTitle,w+"-out",C,this._zoomOut),this._updateDisabled(),p.on("zoomend zoomlevelschange",this._updateDisabled,this),C},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,C,E,j){var V=Tt("a",C,E);return V.innerHTML=p,V.href="#",V.title=w,V.setAttribute("role","button"),V.setAttribute("aria-label",w),rp(V),st(V,"click",Au),st(V,"click",j,this),st(V,"click",this._refocusOnMap,this),V},_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"))}});bt.mergeOptions({zoomControl:!0}),bt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new mA,this.addControl(this.zoomControl))});var _ae=function(p){return new mA(p)},u5=ba.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(p){var w="leaflet-control-scale",C=Tt("div",w),E=this.options;return this._addScales(E,w+"-line",C),p.on(E.updateWhenIdle?"moveend":"move",this._update,this),p.whenReady(this._update,this),C},onRemove:function(p){p.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(p,w,C){p.metric&&(this._mScale=Tt("div",w,C)),p.imperial&&(this._iScale=Tt("div",w,C))},_update:function(){var p=this._map,w=p.getSize().y/2,C=p.distance(p.containerPointToLatLng([0,w]),p.containerPointToLatLng([this.options.maxWidth,w]));this._updateScales(C)},_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),C=w<1e3?w+" m":w/1e3+" km";this._updateScale(this._mScale,C,w/p)},_updateImperial:function(p){var w=p*3.2808399,C,E,j;w>5280?(C=w/5280,E=this._getRoundNum(C),this._updateScale(this._iScale,E+" mi",E/C)):(j=this._getRoundNum(w),this._updateScale(this._iScale,j+" ft",j/w))},_updateScale:function(p,w,C){p.style.width=Math.round(this.options.maxWidth*C)+"px",p.innerHTML=w},_getRoundNum:function(p){var w=Math.pow(10,(Math.floor(p)+"").length-1),C=p/w;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:1,w*C}}),bae=function(p){return new u5(p)},wae='',yA=ba.extend({options:{position:"bottomright",prefix:''+(Ue.inlineSvg?wae+" ":"")+"Leaflet"},initialize:function(p){g(this,p),this._attributions={}},onAdd:function(p){p.attributionControl=this,this._container=Tt("div","leaflet-control-attribution"),rp(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 C=[];this.options.prefix&&C.push(this.options.prefix),p.length&&C.push(p.join(", ")),this._container.innerHTML=C.join(' ')}}});bt.mergeOptions({attributionControl:!0}),bt.addInitHook(function(){this.options.attributionControl&&new yA().addTo(this)});var Sae=function(p){return new yA(p)};ba.Layers=l5,ba.Zoom=mA,ba.Scale=u5,ba.Attribution=yA,np.layers=xae,np.zoom=_ae,np.scale=bae,np.attribution=Sae;var eo=B.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}});eo.addTo=function(p,w){return p.addHandler(w,this),this};var Tae={Events:F},c5=Ue.touch?"touchstart mousedown":"mousedown",Js=G.extend({options:{clickTolerance:3},initialize:function(p,w,C,E){g(this,E),this._element=p,this._dragStartTarget=w||p,this._preventOutline=C},enable:function(){this._enabled||(st(this._dragStartTarget,c5,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Js._dragging===this&&this.finishDrag(!0),Ht(this._dragStartTarget,c5,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(p){if(this._enabled&&(this._moved=!1,!iA(this._element,"leaflet-zoom-anim"))){if(p.touches&&p.touches.length!==1){Js._dragging===this&&this.finishDrag();return}if(!(Js._dragging||p.shiftKey||p.which!==1&&p.button!==1&&!p.touches)&&(Js._dragging=this,this._preventOutline&&cA(this._element),sA(),Jv(),!this._moving)){this.fire("down");var w=p.touches?p.touches[0]:p,C=r5(this._element);this._startPoint=new z(w.clientX,w.clientY),this._startPos=Su(this._element),this._parentScale=fA(C);var E=p.type==="mousedown";st(document,E?"mousemove":"touchmove",this._onMove,this),st(document,E?"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,C=new z(w.clientX,w.clientY)._subtract(this._startPoint);!C.x&&!C.y||Math.abs(C.x)+Math.abs(C.y)V&&(X=te,V=oe);V>C&&(w[X]=1,_A(p,w,C,E,X),_A(p,w,C,X,j))}function Pae(p,w){for(var C=[p[0]],E=1,j=0,V=p.length;Ew&&(C.push(p[E]),j=E);return jw.max.x&&(C|=2),p.yw.max.y&&(C|=8),C}function Lae(p,w){var C=w.x-p.x,E=w.y-p.y;return C*C+E*E}function ip(p,w,C,E){var j=w.x,V=w.y,X=C.x-j,te=C.y-V,oe=X*X+te*te,he;return oe>0&&(he=((p.x-j)*X+(p.y-V)*te)/oe,he>1?(j=C.x,V=C.y):he>0&&(j+=X*he,V+=te*he)),X=p.x-j,te=p.y-V,E?X*X+te*te:new z(j,V)}function Bi(p){return!b(p[0])||typeof p[0][0]!="object"&&typeof p[0][0]<"u"}function m5(p){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Bi(p)}function y5(p,w){var C,E,j,V,X,te,oe,he;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=ge([0,0]),et=ae(p),pt=et.getNorthWest().distanceTo(et.getSouthWest())*et.getNorthEast().distanceTo(et.getNorthWest());pt<1700&&(Ee=xA(p));var Rn=p.length,Kr=[];for(C=0;CE){oe=(V-E)/j,he=[te.x-oe*(te.x-X.x),te.y-oe*(te.y-X.y)];break}var ei=w.unproject(H(he));return ge([ei.lat+Ee.lat,ei.lng+Ee.lng])}var kae={__proto__:null,simplify:d5,pointToSegmentDistance:v5,closestPointOnSegment:Cae,clipSegment:g5,_getEdgeIntersection:I0,_getBitCode:Cu,_sqClosestPointOnSegment:ip,isFlat:Bi,_flat:m5,polylineCenter:y5},bA={project:function(p){return new z(p.lng,p.lat)},unproject:function(p){return new ce(p.y,p.x)},bounds:new Y([-180,-90],[180,90])},wA={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Y([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(p){var w=Math.PI/180,C=this.R,E=p.lat*w,j=this.R_MINOR/C,V=Math.sqrt(1-j*j),X=V*Math.sin(E),te=Math.tan(Math.PI/4-E/2)/Math.pow((1-X)/(1+X),V/2);return E=-C*Math.log(Math.max(te,1e-10)),new z(p.lng*w*C,E)},unproject:function(p){for(var w=180/Math.PI,C=this.R,E=this.R_MINOR/C,j=Math.sqrt(1-E*E),V=Math.exp(-p.y/C),X=Math.PI/2-2*Math.atan(V),te=0,oe=.1,he;te<15&&Math.abs(oe)>1e-7;te++)he=j*Math.sin(X),he=Math.pow((1-he)/(1+he),j/2),oe=Math.PI/2-2*Math.atan(V*he)-X,X+=oe;return new ce(X*w,p.x*w/C)}},Iae={__proto__:null,LonLat:bA,Mercator:wA,SphericalMercator:fe},Oae=i({},xe,{code:"EPSG:3395",projection:wA,transformation:function(){var p=.5/(Math.PI*wA.R);return ee(p,.5,-p,.5)}()}),x5=i({},xe,{code:"EPSG:4326",projection:bA,transformation:ee(1/180,1,-1/180,.5)}),Eae=i({},We,{projection:bA,transformation:ee(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 C=w.lng-p.lng,E=w.lat-p.lat;return Math.sqrt(C*C+E*E)},infinite:!0});We.Earth=xe,We.EPSG3395=Oae,We.EPSG3857=$e,We.EPSG900913=Se,We.EPSG4326=x5,We.Simple=Eae;var wa=G.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 C=this.getEvents();w.on(C,this),this.once("remove",function(){w.off(C,this)},this)}this.onAdd(w),this.fire("add"),w.fire("layeradd",{layer:this})}}});bt.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 C in this._layers)p.call(w,this._layers[C]);return this},_addLayers:function(p){p=p?b(p)?p:[p]:[];for(var w=0,C=p.length;wthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&w[0]instanceof ce&&w[0].equals(w[C-1])&&w.pop(),w},_setLatLngs:function(p){qo.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,C=new z(w,w);if(p=new Y(p.min.subtract(C),p.max.add(C)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(p))){if(this.options.noClip){this._parts=this._rings;return}for(var E=0,j=this._rings.length,V;Ep.y!=j.y>p.y&&p.x<(j.x-E.x)*(p.y-E.y)/(j.y-E.y)+E.x&&(w=!w);return w||qo.prototype._containsPoint.call(this,p,!0)}});function Fae(p,w){return new jf(p,w)}var Ko=Xo.extend({initialize:function(p,w){g(this,w),this._layers={},p&&this.addData(p)},addData:function(p){var w=b(p)?p:p.features,C,E,j;if(w){for(C=0,E=w.length;C0&&j.push(j[0].slice()),j}function Rf(p,w){return p.feature?i({},p.feature,{geometry:w}):R0(w)}function R0(p){return p.type==="Feature"||p.type==="FeatureCollection"?p:{type:"Feature",properties:{},geometry:p}}var CA={toGeoJSON:function(p){return Rf(this,{type:"Point",coordinates:AA(this.getLatLng(),p)})}};O0.include(CA),SA.include(CA),E0.include(CA),qo.include({toGeoJSON:function(p){var w=!Bi(this._latlngs),C=j0(this._latlngs,w?1:0,!1,p);return Rf(this,{type:(w?"Multi":"")+"LineString",coordinates:C})}}),jf.include({toGeoJSON:function(p){var w=!Bi(this._latlngs),C=w&&!Bi(this._latlngs[0]),E=j0(this._latlngs,C?2:w?1:0,!0,p);return w||(E=[E]),Rf(this,{type:(C?"Multi":"")+"Polygon",coordinates:E})}}),Df.include({toMultiPoint:function(p){var w=[];return this.eachLayer(function(C){w.push(C.toGeoJSON(p).geometry.coordinates)}),Rf(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 C=w==="GeometryCollection",E=[];return this.eachLayer(function(j){if(j.toGeoJSON){var V=j.toGeoJSON(p);if(C)E.push(V.geometry);else{var X=R0(V);X.type==="FeatureCollection"?E.push.apply(E,X.features):E.push(X)}}}),C?Rf(this,{geometries:E,type:"GeometryCollection"}):{type:"FeatureCollection",features:E}}});function w5(p,w){return new Ko(p,w)}var Vae=w5,B0=wa.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(p,w,C){this._url=p,this._bounds=ae(w),g(this,C)},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(){ir(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&&Of(this._image),this},bringToBack:function(){return this._map&&Ef(this._image),this},setUrl:function(p){return this._url=p,this._image&&(this._image.src=p),this},setBounds:function(p){return this._bounds=ae(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:Tt("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),C=this._map._latLngBoundsToNewLayerBounds(this._bounds,p.zoom,p.center).min;wu(this._image,C,w)},_reset:function(){var p=this._image,w=new Y(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),C=w.getSize();Cr(p,w.min),p.style.width=C.x+"px",p.style.height=C.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()}}),Gae=function(p,w,C){return new B0(p,w,C)},S5=B0.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:Tt("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 C=w.getElementsByTagName("source"),E=[],j=0;j0?E:[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 V=0;Vj?(w.height=j+"px",ut(p,V)):_r(p,V),this._containerWidth=this._container.offsetWidth},_animateZoom:function(p){var w=this._map._latLngToNewLayerPoint(this._latlng,p.zoom,p.center),C=this._getAnchor();Cr(this._container,w.add(C))},_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(Qv(this._container,"marginBottom"),10)||0,C=this._container.offsetHeight+w,E=this._containerWidth,j=new z(this._containerLeft,-C-this._containerBottom);j._add(Su(this._container));var V=p.layerPointToContainerPoint(j),X=H(this.options.autoPanPadding),te=H(this.options.autoPanPaddingTopLeft||X),oe=H(this.options.autoPanPaddingBottomRight||X),he=p.getSize(),Ee=0,et=0;V.x+E+oe.x>he.x&&(Ee=V.x+E-he.x+oe.x),V.x-Ee-te.x<0&&(Ee=V.x-te.x),V.y+C+oe.y>he.y&&(et=V.y+C-he.y+oe.y),V.y-et-te.y<0&&(et=V.y-te.y),(Ee||et)&&(this.options.keepInView&&(this._autopanning=!0),p.fire("autopanstart").panBy([Ee,et]))}},_getAnchor:function(){return H(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Uae=function(p,w){return new z0(p,w)};bt.mergeOptions({closePopupOnClick:!0}),bt.include({openPopup:function(p,w,C){return this._initOverlay(z0,p,w,C).openOn(this),this},closePopup:function(p){return p=arguments.length?p:this._popup,p&&p.close(),this}}),wa.include({bindPopup:function(p,w){return this._popup=this._initOverlay(z0,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 Xo||(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)){Au(p);var w=p.layer||p.target;if(this._popup._source===w&&!(w instanceof el)){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 $0=to.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(p){to.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){to.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=to.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=Tt("div",w),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(p){var w,C,E=this._map,j=this._container,V=E.latLngToContainerPoint(E.getCenter()),X=E.layerPointToContainerPoint(p),te=this.options.direction,oe=j.offsetWidth,he=j.offsetHeight,Ee=H(this.options.offset),et=this._getAnchor();te==="top"?(w=oe/2,C=he):te==="bottom"?(w=oe/2,C=0):te==="center"?(w=oe/2,C=he/2):te==="right"?(w=0,C=he/2):te==="left"?(w=oe,C=he/2):X.xthis.options.maxZoom||CE?this._retainParent(j,V,X,E):!1)},_retainChildren:function(p,w,C,E){for(var j=2*p;j<2*p+2;j++)for(var V=2*w;V<2*w+2;V++){var X=new z(j,V);X.z=C+1;var te=this._tileCoordsToKey(X),oe=this._tiles[te];if(oe&&oe.active){oe.retain=!0;continue}else oe&&oe.loaded&&(oe.retain=!0);C+1this.options.maxZoom||this.options.minZoom!==void 0&&j1){this._setView(p,C);return}for(var et=j.min.y;et<=j.max.y;et++)for(var pt=j.min.x;pt<=j.max.x;pt++){var Rn=new z(pt,et);if(Rn.z=this._tileZoom,!!this._isValidTile(Rn)){var Kr=this._tiles[this._tileCoordsToKey(Rn)];Kr?Kr.current=!0:X.push(Rn)}}if(X.sort(function(ei,zf){return ei.distanceTo(V)-zf.distanceTo(V)}),X.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var zi=document.createDocumentFragment();for(pt=0;ptC.max.x)||!w.wrapLat&&(p.yC.max.y))return!1}if(!this.options.bounds)return!0;var E=this._tileCoordsToBounds(p);return ae(this.options.bounds).overlaps(E)},_keyToBounds:function(p){return this._tileCoordsToBounds(this._keyToTileCoords(p))},_tileCoordsToNwSe:function(p){var w=this._map,C=this.getTileSize(),E=p.scaleBy(C),j=E.add(C),V=w.unproject(E,p.z),X=w.unproject(j,p.z);return[V,X]},_tileCoordsToBounds:function(p){var w=this._tileCoordsToNwSe(p),C=new J(w[0],w[1]);return this.options.noWrap||(C=this._map.wrapLatLngBounds(C)),C},_tileCoordsToKey:function(p){return p.x+":"+p.y+":"+p.z},_keyToTileCoords:function(p){var w=p.split(":"),C=new z(+w[0],+w[1]);return C.z=+w[2],C},_removeTile:function(p){var w=this._tiles[p];w&&(ir(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 C=this._getTilePos(p),E=this._tileCoordsToKey(p),j=this.createTile(this._wrapCoords(p),o(this._tileReady,this,p));this._initTile(j),this.createTile.length<2&&O(o(this._tileReady,this,p,null,j)),Cr(j,C),this._tiles[E]={el:j,coords:p,current:!0},w.appendChild(j),this.fire("tileloadstart",{tile:j,coords:p})},_tileReady:function(p,w,C){w&&this.fire("tileerror",{error:w,tile:C,coords:p});var E=this._tileCoordsToKey(p);C=this._tiles[E],C&&(C.loaded=+new Date,this._map._fadeAnimated?(Ri(C.el,0),D(this._fadeFrame),this._fadeFrame=O(this._updateOpacity,this)):(C.active=!0,this._pruneTiles()),w||(ut(C.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:C.el,coords:p})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ue.ielt9||!this._map._fadeAnimated?O(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 z(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 Y(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 Xae(p){return new op(p)}var Bf=op.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 C=document.createElement("img");return st(C,"load",o(this._tileOnLoad,this,w,C)),st(C,"error",o(this._tileOnError,this,w,C)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(C.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(C.referrerPolicy=this.options.referrerPolicy),C.alt="",C.src=this.getTileUrl(p),C},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 C=this._globalTileRange.max.y-p.y;this.options.tms&&(w.y=C),w["-y"]=C}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,C){var E=this.options.errorTileUrl;E&&w.getAttribute("src")!==E&&(w.src=E),p(C,w)},_onTileRemove:function(p){p.tile.onload=null},_getZoomForUrl:function(){var p=this._tileZoom,w=this.options.maxZoom,C=this.options.zoomReverse,E=this.options.zoomOffset;return C&&(p=w-p),p+E},_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 C=this._tiles[p].coords;ir(w),delete this._tiles[p],this.fire("tileabort",{tile:w,coords:C})}},_removeTile:function(p){var w=this._tiles[p];if(w)return w.el.setAttribute("src",T),op.prototype._removeTile.call(this,p)},_tileReady:function(p,w,C){if(!(!this._map||C&&C.getAttribute("src")===T))return op.prototype._tileReady.call(this,p,w,C)}});function C5(p,w){return new Bf(p,w)}var M5=Bf.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 C=i({},this.defaultWmsParams);for(var E in w)E in this.options||(C[E]=w[E]);w=g(this,w);var j=w.detectRetina&&Ue.retina?2:1,V=this.getTileSize();C.width=V.x*j,C.height=V.y*j,this.wmsParams=C},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,Bf.prototype.onAdd.call(this,p)},getTileUrl:function(p){var w=this._tileCoordsToNwSe(p),C=this._crs,E=Z(C.project(w[0]),C.project(w[1])),j=E.min,V=E.max,X=(this._wmsVersion>=1.3&&this._crs===x5?[j.y,j.x,V.y,V.x]:[j.x,j.y,V.x,V.y]).join(","),te=Bf.prototype.getTileUrl.call(this,p);return te+m(this.wmsParams,te,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+X},setParams:function(p,w){return i(this.wmsParams,p),w||this.redraw(),this}});function qae(p,w){return new M5(p,w)}Bf.WMS=M5,C5.wms=qae;var Qo=wa.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 C=this._map.getZoomScale(w,this._zoom),E=this._map.getSize().multiplyBy(.5+this.options.padding),j=this._map.project(this._center,w),V=E.multiplyBy(-C).add(j).subtract(this._map._getNewPixelOrigin(p,w));Ue.any3d?wu(this._container,V,C):Cr(this._container,V)},_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(),C=this._map.containerPointToLayerPoint(w.multiplyBy(-p)).round();this._bounds=new Y(C,C.add(w.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),P5=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,ir(this._container),Ht(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,C=p.getSize(),E=Ue.retina?2:1;Cr(w,p.min),w.width=E*C.x,w.height=E*C.y,w.style.width=C.x+"px",w.style.height=C.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,C=w.next,E=w.prev;C?C.prev=E:this._drawLast=E,E?E.next=C:this._drawFirst=C,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(/[, ]+/),C=[],E,j;for(j=0;j')}}catch{}return function(p){return document.createElement("<"+p+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Kae={_initContainer:function(){this._container=Tt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Qo.prototype._update.call(this),this.fire("update"))},_initPath:function(p){var w=p._container=sp("shape");ut(w,"leaflet-vml-shape "+(this.options.className||"")),w.coordsize="1 1",p._path=sp("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;ir(w),p.removeInteractiveTarget(w),delete this._layers[l(p)]},_updateStyle:function(p){var w=p._stroke,C=p._fill,E=p.options,j=p._container;j.stroked=!!E.stroke,j.filled=!!E.fill,E.stroke?(w||(w=p._stroke=sp("stroke")),j.appendChild(w),w.weight=E.weight+"px",w.color=E.color,w.opacity=E.opacity,E.dashArray?w.dashStyle=b(E.dashArray)?E.dashArray.join(" "):E.dashArray.replace(/( *, *)/g," "):w.dashStyle="",w.endcap=E.lineCap.replace("butt","flat"),w.joinstyle=E.lineJoin):w&&(j.removeChild(w),p._stroke=null),E.fill?(C||(C=p._fill=sp("fill")),j.appendChild(C),C.color=E.fillColor||E.color,C.opacity=E.fillOpacity):C&&(j.removeChild(C),p._fill=null)},_updateCircle:function(p){var w=p._point.round(),C=Math.round(p._radius),E=Math.round(p._radiusY||C);this._setPath(p,p._empty()?"M0 0":"AL "+w.x+","+w.y+" "+C+","+E+" 0,"+65535*360)},_setPath:function(p,w){p._path.v=w},_bringToFront:function(p){Of(p._container)},_bringToBack:function(p){Ef(p._container)}},F0=Ue.vml?sp:Fe,lp=Qo.extend({_initContainer:function(){this._container=F0("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=F0("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ir(this._container),Ht(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(),C=this._container;(!this._svgSize||!this._svgSize.equals(w))&&(this._svgSize=w,C.setAttribute("width",w.x),C.setAttribute("height",w.y)),Cr(C,p.min),C.setAttribute("viewBox",[p.min.x,p.min.y,w.x,w.y].join(" ")),this.fire("update")}},_initPath:function(p){var w=p._path=F0("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){ir(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,C=p.options;w&&(C.stroke?(w.setAttribute("stroke",C.color),w.setAttribute("stroke-opacity",C.opacity),w.setAttribute("stroke-width",C.weight),w.setAttribute("stroke-linecap",C.lineCap),w.setAttribute("stroke-linejoin",C.lineJoin),C.dashArray?w.setAttribute("stroke-dasharray",C.dashArray):w.removeAttribute("stroke-dasharray"),C.dashOffset?w.setAttribute("stroke-dashoffset",C.dashOffset):w.removeAttribute("stroke-dashoffset")):w.setAttribute("stroke","none"),C.fill?(w.setAttribute("fill",C.fillColor||C.color),w.setAttribute("fill-opacity",C.fillOpacity),w.setAttribute("fill-rule",C.fillRule||"evenodd")):w.setAttribute("fill","none"))},_updatePoly:function(p,w){this._setPath(p,Ye(p._parts,w))},_updateCircle:function(p){var w=p._point,C=Math.max(Math.round(p._radius),1),E=Math.max(Math.round(p._radiusY),1)||C,j="a"+C+","+E+" 0 1,0 ",V=p._empty()?"M0 0":"M"+(w.x-C)+","+w.y+j+C*2+",0 "+j+-C*2+",0 ";this._setPath(p,V)},_setPath:function(p,w){p._path.setAttribute("d",w)},_bringToFront:function(p){Of(p._path)},_bringToBack:function(p){Ef(p._path)}});Ue.vml&&lp.include(Kae);function k5(p){return Ue.svg||Ue.vml?new lp(p):null}bt.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&&L5(p)||k5(p)}});var I5=jf.extend({initialize:function(p,w){jf.prototype.initialize.call(this,this._boundsToLatLngs(p),w)},setBounds:function(p){return this.setLatLngs(this._boundsToLatLngs(p))},_boundsToLatLngs:function(p){return p=ae(p),[p.getSouthWest(),p.getNorthWest(),p.getNorthEast(),p.getSouthEast()]}});function Qae(p,w){return new I5(p,w)}lp.create=F0,lp.pointsToPath=Ye,Ko.geometryToLayer=D0,Ko.coordsToLatLng=TA,Ko.coordsToLatLngs=N0,Ko.latLngToCoords=AA,Ko.latLngsToCoords=j0,Ko.getFeature=Rf,Ko.asFeature=R0,bt.mergeOptions({boxZoom:!0});var O5=eo.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(){Ht(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ir(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(),Jv(),sA(),this._startPoint=this._map.mouseEventToContainerPoint(p),st(document,{contextmenu:Au,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(p){this._moved||(this._moved=!0,this._box=Tt("div","leaflet-zoom-box",this._container),ut(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(p);var w=new Y(this._point,this._startPoint),C=w.getSize();Cr(this._box,w.min),this._box.style.width=C.x+"px",this._box.style.height=C.y+"px"},_finish:function(){this._moved&&(ir(this._box),_r(this._container,"leaflet-crosshair")),ep(),lA(),Ht(document,{contextmenu:Au,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 J(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())}});bt.addInitHook("addHandler","boxZoom",O5),bt.mergeOptions({doubleClickZoom:!0});var E5=eo.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,C=w.getZoom(),E=w.options.zoomDelta,j=p.originalEvent.shiftKey?C-E:C+E;w.options.doubleClickZoom==="center"?w.setZoom(j):w.setZoomAround(p.containerPoint,j)}});bt.addInitHook("addHandler","doubleClickZoom",E5),bt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var D5=eo.extend({addHooks:function(){if(!this._draggable){var p=this._map;this._draggable=new Js(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=ae(this._map.options.maxBounds);this._offsetLimit=Z(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,C=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(C),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),C=this._initialWorldOffset,E=this._draggable._newPos.x,j=(E-w+C)%p+w-C,V=(E+w+C)%p-w-C,X=Math.abs(j+C)0?V:-V))-w;this._delta=0,this._startTime=null,X&&(p.options.scrollWheelZoom==="center"?p.setZoom(w+X):p.setZoomAround(this._lastMousePos,w+X))}});bt.addInitHook("addHandler","scrollWheelZoom",j5);var Jae=600;bt.mergeOptions({tapHold:Ue.touchNative&&Ue.safari&&Ue.mobile,tapTolerance:15});var R5=eo.extend({addHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ht(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 z(w.clientX,w.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(st(document,"touchend",un),st(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",w))},this),Jae),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function p(){Ht(document,"touchend",un),Ht(document,"touchend touchcancel",p)},_cancel:function(){clearTimeout(this._holdTimeout),Ht(document,"touchend touchcancel contextmenu",this._cancel,this),Ht(document,"touchmove",this._onMove,this)},_onMove:function(p){var w=p.touches[0];this._newPos=new z(w.clientX,w.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(p,w){var C=new MouseEvent(p,{bubbles:!0,cancelable:!0,view:window,screenX:w.screenX,screenY:w.screenY,clientX:w.clientX,clientY:w.clientY});C._simulated=!0,w.target.dispatchEvent(C)}});bt.addInitHook("addHandler","tapHold",R5),bt.mergeOptions({touchZoom:Ue.touch,bounceAtZoomLimits:!0});var B5=eo.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"),Ht(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 C=w.mouseEventToContainerPoint(p.touches[0]),E=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(C.add(E)._divideBy(2))),this._startDist=C.distanceTo(E),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),un(p)}},_onTouchMove:function(p){if(!(!p.touches||p.touches.length!==2||!this._zooming)){var w=this._map,C=w.mouseEventToContainerPoint(p.touches[0]),E=w.mouseEventToContainerPoint(p.touches[1]),j=C.distanceTo(E)/this._startDist;if(this._zoom=w.getScaleZoom(j,this._startZoom),!w.options.bounceAtZoomLimits&&(this._zoomw.getMaxZoom()&&j>1)&&(this._zoom=w._limitZoom(this._zoom)),w.options.touchZoom==="center"){if(this._center=this._startLatLng,j===1)return}else{var V=C._add(E)._divideBy(2)._subtract(this._centerPoint);if(j===1&&V.x===0&&V.y===0)return;this._center=w.unproject(w.project(this._pinchStartLatLng,this._zoom).subtract(V),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=O(X,this,!0),un(p)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,D(this._animRequest),Ht(document,"touchmove",this._onTouchMove,this),Ht(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))}});bt.addInitHook("addHandler","touchZoom",B5),bt.BoxZoom=O5,bt.DoubleClickZoom=E5,bt.Drag=D5,bt.Keyboard=N5,bt.ScrollWheelZoom=j5,bt.TapHold=R5,bt.TouchZoom=B5,r.Bounds=Y,r.Browser=Ue,r.CRS=We,r.Canvas=P5,r.Circle=SA,r.CircleMarker=E0,r.Class=B,r.Control=ba,r.DivIcon=A5,r.DivOverlay=to,r.DomEvent=mae,r.DomUtil=pae,r.Draggable=Js,r.Evented=G,r.FeatureGroup=Xo,r.GeoJSON=Ko,r.GridLayer=op,r.Handler=eo,r.Icon=Nf,r.ImageOverlay=B0,r.LatLng=ce,r.LatLngBounds=J,r.Layer=wa,r.LayerGroup=Df,r.LineUtil=kae,r.Map=bt,r.Marker=O0,r.Mixin=Tae,r.Path=el,r.Point=z,r.PolyUtil=Aae,r.Polygon=jf,r.Polyline=qo,r.Popup=z0,r.PosAnimation=s5,r.Projection=Iae,r.Rectangle=I5,r.Renderer=Qo,r.SVG=lp,r.SVGOverlay=T5,r.TileLayer=Bf,r.Tooltip=$0,r.Transformation=le,r.Util=N,r.VideoOverlay=S5,r.bind=o,r.bounds=Z,r.canvas=L5,r.circle=zae,r.circleMarker=Bae,r.control=np,r.divIcon=Yae,r.extend=i,r.featureGroup=Nae,r.geoJSON=w5,r.geoJson=Vae,r.gridLayer=Xae,r.icon=jae,r.imageOverlay=Gae,r.latLng=ge,r.latLngBounds=ae,r.layerGroup=Dae,r.map=yae,r.marker=Rae,r.point=H,r.polygon=Fae,r.polyline=$ae,r.popup=Uae,r.rectangle=Qae,r.setOptions=g,r.stamp=l,r.svg=k5,r.svgOverlay=Hae,r.tileLayer=C5,r.tooltip=Zae,r.transformation=ee,r.version=n,r.videoOverlay=Wae;var eoe=window.L;r.noConflict=function(){return window.L=eoe,this},window.L=r})})(zO,zO.exports);var Lf=zO.exports;const Bie=Ft(Lf);function w0(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function NR(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 zie(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 zQe(e){return function(r){const n=KT(),i=e(QT(r,n),n);return Die(n.map,r.attribution),DR(i.current,r.eventHandlers),zie(i.current,n),i}}function $Qe(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 FQe(e){return function(r){const n=KT(),i=e(QT(r,n),n);return DR(i.current,r.eventHandlers),zie(i.current,n),$Qe(i.current,r),i}}function $ie(e,t){const r=NR(e),n=BQe(r,t);return jQe(n)}function Fie(e,t){const r=NR(e,t),n=FQe(r);return NQe(n)}function VQe(e,t){const r=NR(e,t),n=zQe(r);return RQe(n)}function GQe(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 WQe(){return KT().map}const HQe=Fie(function({center:t,children:r,...n},i){const a=new Lf.CircleMarker(t,n);return w0(a,Nie(i,{overlayContainer:a}))},OQe);function $O(){return $O=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 Lf.Map(y,c);r!=null&&u!=null?_.setView(r,u):e!=null&&_.fitBounds(e,t),l!=null&&_.whenReady(l),v(DQe(_))}},[]);W.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const m=d?Q.createElement(Rie,{value:d},n):o??null;return Q.createElement("div",$O({},h,{ref:g}),m)}const ZQe=W.forwardRef(UQe),YQe=Fie(function({positions:t,...r},n){const i=new Lf.Polyline(t,r);return w0(i,Nie(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),XQe=$ie(function(t,r){const n=new Lf.Popup(t,r.overlayContainer);return w0(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])}),qQe=VQe(function({url:t,...r},n){const i=new Lf.TileLayer(t,QT(r,n));return w0(i,n)},function(t,r,n){GQe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),KQe=$ie(function(t,r){const n=new Lf.Tooltip(t,r.overlayContainer);return w0(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])}),QQe="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=",JQe="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==",eJe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete Bie.Icon.Default.prototype._getIconUrl;Bie.Icon.Default.mergeOptions({iconUrl:QQe,iconRetinaUrl:JQe,shadowUrl:eJe});const EU=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],tJe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function rJe(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function nJe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function iJe(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 aJe({bounds:e}){const t=WQe();return W.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function oJe({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:iJe(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(xd,{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(xd,{size:10}),"OSM"]})]})]})}function sJe({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(ZQe,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[x.jsx(qQe,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© OpenStreetMap, © CARTO'}),x.jsx(aJe,{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(YQe,{positions:[[d.latitude,d.longitude],[v.latitude,v.longitude]],color:rJe(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=tJe.includes(f.role),m=nJe(f.latitude),y=EU[m%EU.length];return x.jsxs(HQe,{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(KQe,{direction:"top",offset:[0,-8],children:x.jsx("span",{className:"font-mono text-xs",children:f.short_name})}),x.jsx(XQe,{children:x.jsx(oJe,{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(bZ,{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 DU=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],lJe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function NU(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function uJe(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function cJe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function fJe(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function hJe(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 dJe(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 vJe({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(tu,{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=lJe.includes(e.role),o=cJe(e.latitude),s=DU[o%DU.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:fJe(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(Sm,{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 ${dJe(e.last_heard)}`}),x.jsx("span",{className:"text-sm text-slate-300",children:hJe(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(xd,{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(xd,{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:NU(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:NU(f.snr)},children:[f.snr.toFixed(1)," dB"]}),x.jsx("div",{className:"text-xs text-slate-500",children:uJe(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 jU=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function pJe(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 gJe(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 mJe(e){return e.battery_level===null?"—":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`}function RU(e){return e===null?"—":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function yJe({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=>jU.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)||RU(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(Zue,{size:14,className:"inline ml-1"}):x.jsx(Hy,{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(HE,{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(FE,{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=jU.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 ${pJe(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:RU(v.latitude)}),x.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:mJe(v)}),x.jsx("td",{className:"px-3 py-2 text-slate-400",children:gJe(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 xJe(){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([oce(),sce(),gce()]).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(tce,{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(Que,{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(IQe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:g}):x.jsx(sJe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:g})}),x.jsx(vJe,{node:v,edges:r,nodes:e,onSelectNode:g})]}),x.jsx(yJe,{nodes:e,selectedNodeId:o,onSelectNode:g})]})}function _Je({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=i=>i?new Date(i*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_fetch)]}),e.last_error&&x.jsx("div",{className:"text-amber-500 truncate",children:e.last_error})]})]})}function bJe({event:e}){const r=(a=>{switch(a.toLowerCase()){case"extreme":case"severe":return{bg:"bg-red-500/10",border:"border-red-500",icon:Uy,iconColor:"text-red-500"};case"moderate":case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:Ds,iconColor:"text-amber-500"};case"minor":return{bg:"bg-yellow-500/10",border:"border-yellow-500",icon:wm,iconColor:"text-yellow-500"};default:return{bg:"bg-slate-500/10",border:"border-slate-500",icon:wm,iconColor:"text-slate-400"}}})(e.severity),n=r.icon,i=a=>a?new Date(a*1e3).toLocaleString():null;return x.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-2 ${r.border}`,children:x.jsxs("div",{className:"flex items-start gap-3",children:[x.jsx(n,{size:18,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-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.iconColor}`,children:e.severity})]}),x.jsx("div",{className:"text-sm text-slate-300 mb-2",children:e.headline}),e.description&&x.jsx("div",{className:"text-xs text-slate-400 mb-2 line-clamp-2",children:e.description}),x.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[x.jsx("span",{className:"uppercase",children:e.source}),e.expires&&x.jsxs("span",{children:["Expires: ",i(e.expires)]})]})]})]})})}function wJe({swpc:e}){var n,i;if(!e||!e.enabled)return 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(Vb,{size:14}),"Solar/Geomagnetic Indices"]}),x.jsx("div",{className:"text-slate-500",children:"Data not available"})]});const t=a=>a===void 0?"text-slate-400":a<=2?"text-green-500":a<=4?"text-amber-500":a<=6?"text-orange-500":"text-red-500",r=a=>a===void 0||a===0?"text-green-500":a<=2?"text-amber-500":a<=3?"text-orange-500":"text-red-500";return 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(Vb,{size:14}),"Solar/Geomagnetic Indices"]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[x.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Solar Flux Index"}),x.jsx("div",{className:"text-2xl font-mono text-slate-100",children:((n=e.sfi)==null?void 0:n.toFixed(0))??"—"}),x.jsx("div",{className:"text-xs text-slate-500",children:"SFI (10.7 cm)"})]}),x.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Planetary K-Index"}),x.jsx("div",{className:`text-2xl font-mono ${t(e.kp_current)}`,children:((i=e.kp_current)==null?void 0:i.toFixed(1))??"—"}),x.jsx("div",{className:"text-xs text-slate-500",children:"Kp"})]})]}),x.jsxs("div",{className:"bg-bg-hover rounded-lg p-3 mb-4",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-2",children:"NOAA Space Weather Scales"}),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-xs text-slate-400",children:"R:"}),x.jsx("span",{className:`text-sm font-mono ${r(e.r_scale)}`,children:e.r_scale??0})]}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("span",{className:"text-xs text-slate-400",children:"S:"}),x.jsx("span",{className:`text-sm font-mono ${r(e.s_scale)}`,children:e.s_scale??0})]}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("span",{className:"text-xs text-slate-400",children:"G:"}),x.jsx("span",{className:`text-sm font-mono ${r(e.g_scale)}`,children:e.g_scale??0})]})]}),x.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Radio Blackout / Solar Radiation / Geomagnetic Storm"})]}),e.active_warnings&&e.active_warnings.length>0&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("div",{className:"text-xs text-slate-500",children:"Active Warnings"}),e.active_warnings.slice(0,3).map((a,o)=>x.jsx("div",{className:"text-xs text-amber-400 bg-amber-500/10 rounded p-2",children:a},o))]})]})}function SJe({ducting:e}){if(!e||!e.enabled)return 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(s3,{size:14}),"Tropospheric Ducting"]}),x.jsx("div",{className:"text-slate-500",children:"Data not available"})]});const t=n=>{switch(n){case"normal":return"text-green-500";case"super_refraction":return"text-amber-500";case"surface_duct":case"elevated_duct":return"text-blue-400";default:return"text-slate-400"}},r=n=>n?n.replace("_"," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown";return 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(s3,{size:14}),"Tropospheric Ducting"]}),x.jsxs("div",{className:"bg-bg-hover rounded-lg p-4 mb-4",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Condition"}),x.jsx("div",{className:`text-xl font-medium ${t(e.condition)}`,children:r(e.condition)})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[x.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Min Gradient"}),x.jsx("div",{className:"text-lg font-mono text-slate-100",children:e.min_gradient??"—"}),x.jsx("div",{className:"text-xs text-slate-500",children:"M-units/km"})]}),e.duct_thickness_m&&x.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Duct Thickness"}),x.jsx("div",{className:"text-lg font-mono text-slate-100",children:e.duct_thickness_m}),x.jsx("div",{className:"text-xs text-slate-500",children:"meters"})]}),e.duct_base_m&&x.jsxs("div",{className:"bg-bg-hover rounded-lg p-3",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Duct Base"}),x.jsx("div",{className:"text-lg font-mono text-slate-100",children:e.duct_base_m}),x.jsx("div",{className:"text-xs text-slate-500",children:"meters AGL"})]})]}),x.jsxs("div",{className:"text-xs text-slate-500 bg-bg-hover rounded p-2",children:[x.jsx("div",{children:"dM/dz reference:"}),x.jsxs("div",{className:"mt-1 space-y-0.5",children:[x.jsx("div",{children:">79: Normal propagation"}),x.jsx("div",{children:"0–79: Super-refraction"}),x.jsx("div",{children:"<0: Ducting (trapping layer)"})]})]}),e.last_update&&x.jsxs("div",{className:"text-xs text-slate-500 mt-3",children:["Last update: ",e.last_update]})]})}function TJe(){var I;const[e,t]=W.useState(null),[r,n]=W.useState([]),[i,a]=W.useState(null),[o,s]=W.useState(null),[l,u]=W.useState([]),[c,f]=W.useState(null),[h,d]=W.useState([]),[v,g]=W.useState([]),[m,y]=W.useState([]),[_,b]=W.useState([]),[S,T]=W.useState(0),[A,M]=W.useState(!0),[P,k]=W.useState(null);return W.useEffect(()=>{document.title="Environment — MeshAI",Promise.all([LZ().catch(()=>null),kZ().catch(()=>[]),IZ().catch(()=>null),OZ().catch(()=>null),cce().catch(()=>[]),fce().catch(()=>null),hce().catch(()=>[]),dce().catch(()=>[]),vce().catch(()=>[]),pce().catch(()=>({hotspots:[],new_ignitions:0}))]).then(([O,D,N,B,$,F,G,z,U,H])=>{t(O),n(D),a(N),s(B),u($),f(F),d(G||[]),g(z||[]),y(U||[]),b((H==null?void 0:H.hotspots)||[]),T((H==null?void 0:H.new_ignitions)||0),M(!1)}).catch(O=>{k(O.message),M(!1)})},[]),A?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsx("div",{className:"text-slate-400",children:"Loading environmental data..."})}):P?x.jsx("div",{className:"flex items-center justify-center h-64",children:x.jsxs("div",{className:"text-red-400",children:["Error: ",P]})}):e!=null&&e.enabled?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:"text-xs text-slate-500",children:[r.length," active event",r.length!==1?"s":""]})]}),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(Wy,{size:14}),"Feed Status"]}),x.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:e.feeds.map(O=>x.jsx(_Je,{feed:O},O.source))})]}),x.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[x.jsx(wJe,{swpc:i}),x.jsx(SJe,{ducting:o})]}),x.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 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 flex items-center gap-2",children:[x.jsx(VE,{size:14}),"Active Wildfires (",l.length,")"]}),l.length>0?x.jsx("div",{className:"space-y-3",children:l.map(O=>x.jsxs("div",{className:`p-3 rounded-lg ${O.severity==="warning"?"bg-red-500/10 border-l-2 border-red-500":O.severity==="watch"?"bg-amber-500/10 border-l-2 border-amber-500":"bg-slate-500/10 border-l-2 border-slate-500"}`,children:[x.jsxs("div",{className:"flex items-center justify-between mb-1",children:[x.jsx("span",{className:"text-sm font-medium text-slate-200",children:O.name}),x.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${O.severity==="warning"?"bg-red-500/20 text-red-400":O.severity==="watch"?"bg-amber-500/20 text-amber-400":"bg-slate-500/20 text-slate-400"}`,children:O.severity})]}),x.jsxs("div",{className:"text-xs text-slate-400 space-y-1",children:[x.jsxs("div",{children:[O.acres.toLocaleString()," acres, ",O.pct_contained,"% contained"]}),O.distance_km&&O.nearest_anchor&&x.jsxs("div",{children:[Math.round(O.distance_km)," km from ",O.nearest_anchor]})]})]},O.event_id))}):x.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[x.jsx(Qh,{size:16,className:"text-green-500"}),x.jsx("span",{children:"No active wildfires in the area"})]})]}),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(GE,{size:14}),"Avalanche Advisories"]}),c!=null&&c.off_season?x.jsx("div",{className:"text-slate-500 py-4",children:x.jsx("p",{children:"Off season - check back in December"})}):c&&c.advisories.length>0?x.jsxs("div",{className:"space-y-3",children:[c.advisories.map(O=>x.jsxs("div",{className:`p-3 rounded-lg ${O.danger_level>=4?"bg-red-500/10 border-l-2 border-red-500":O.danger_level>=3?"bg-amber-500/10 border-l-2 border-amber-500":O.danger_level>=2?"bg-yellow-500/10 border-l-2 border-yellow-500":"bg-green-500/10 border-l-2 border-green-500"}`,children:[x.jsxs("div",{className:"flex items-center justify-between mb-1",children:[x.jsx("span",{className:"text-sm font-medium text-slate-200",children:O.zone_name}),x.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${O.danger_level>=4?"bg-red-500/20 text-red-400":O.danger_level>=3?"bg-amber-500/20 text-amber-400":O.danger_level>=2?"bg-yellow-500/20 text-yellow-400":"bg-green-500/20 text-green-400"}`,children:O.danger_name})]}),x.jsx("div",{className:"text-xs text-slate-400",children:O.center}),O.travel_advice&&x.jsx("div",{className:"text-xs text-slate-500 mt-2 line-clamp-2",children:O.travel_advice})]},O.event_id)),((I=c.advisories[0])==null?void 0:I.center_link)&&x.jsx("a",{href:c.advisories[0].center_link,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-400 hover:underline",children:"View full forecast"})]}):x.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[x.jsx(Qh,{size:16,className:"text-green-500"}),x.jsx("span",{children:"No avalanche advisories"})]})]})]}),h.length>0&&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(zE,{size:14}),"Stream Gauges (",h.length,")"]}),x.jsx("div",{className:"space-y-2",children:h.map(O=>{var D,N,B,$,F;return x.jsxs("div",{className:`p-3 rounded-lg ${O.severity==="warning"?"bg-amber-500/10 border-l-2 border-amber-500":"bg-blue-500/10 border-l-2 border-blue-500"}`,children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("span",{className:"text-sm text-slate-200",children:((D=O.properties)==null?void 0:D.site_name)||"Unknown Site"}),x.jsxs("span",{className:"text-sm font-mono text-slate-300",children:[(B=(N=O.properties)==null?void 0:N.value)==null?void 0:B.toLocaleString()," ",($=O.properties)==null?void 0:$.unit]})]}),x.jsx("div",{className:"text-xs text-slate-500 mt-1",children:(F=O.properties)==null?void 0:F.parameter})]},O.event_id)})})]}),(v.length>0||m.length>0)&&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(BE,{size:14}),"Road Conditions"]}),v.length>0&&x.jsxs("div",{className:"mb-4",children:[x.jsx("div",{className:"text-xs text-slate-500 mb-2 uppercase",children:"Traffic Flow"}),x.jsx("div",{className:"space-y-2",children:v.map(O=>{var D,N,B,$,F,G,z,U,H;return x.jsxs("div",{className:`p-3 rounded-lg ${(D=O.properties)!=null&&D.roadClosure?"bg-red-500/10 border-l-2 border-red-500":((N=O.properties)==null?void 0:N.speedRatio)<.5?"bg-amber-500/10 border-l-2 border-amber-500":((B=O.properties)==null?void 0:B.speedRatio)<.8?"bg-yellow-500/10 border-l-2 border-yellow-500":"bg-green-500/10 border-l-2 border-green-500"}`,children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("span",{className:"text-sm text-slate-200",children:(($=O.properties)==null?void 0:$.corridor)||"Unknown"}),x.jsx("span",{className:"text-sm font-mono text-slate-300",children:(F=O.properties)!=null&&F.roadClosure?"CLOSED":`${Math.round(((G=O.properties)==null?void 0:G.currentSpeed)||0)}mph`})]}),!((z=O.properties)!=null&&z.roadClosure)&&x.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[Math.round((((U=O.properties)==null?void 0:U.speedRatio)||1)*100),"% of free flow (",Math.round(((H=O.properties)==null?void 0:H.freeFlowSpeed)||0),"mph)"]})]},O.event_id)})})]}),m.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-xs text-slate-500 mb-2 uppercase",children:"Road Events"}),x.jsx("div",{className:"space-y-2",children:m.map(O=>{var D,N;return x.jsxs("div",{className:`p-3 rounded-lg ${(D=O.properties)!=null&&D.is_closure?"bg-red-500/10 border-l-2 border-red-500":"bg-amber-500/10 border-l-2 border-amber-500"}`,children:[x.jsxs("div",{className:"flex items-center gap-2",children:[((N=O.properties)==null?void 0:N.is_closure)&&x.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-red-500/20 text-red-400",children:"CLOSURE"}),x.jsx("span",{className:"text-sm text-slate-200 line-clamp-1",children:O.headline})]}),x.jsx("div",{className:"text-xs text-slate-500 mt-1 uppercase",children:O.event_type})]},O.event_id)})})]})]}),_.length>0&&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(WE,{size:14}),"Satellite Hotspots (",_.length,")",S>0&&x.jsxs("span",{className:"ml-2 px-2 py-0.5 text-xs rounded-full bg-red-500/20 text-red-400 animate-pulse",children:[S," NEW"]})]}),x.jsx("div",{className:"space-y-2",children:_.map(O=>{var D,N,B,$,F,G;return x.jsxs("div",{className:`p-3 rounded-lg ${(D=O.properties)!=null&&D.new_ignition?"bg-red-500/10 border-l-2 border-red-500":O.severity==="watch"?"bg-amber-500/10 border-l-2 border-amber-500":"bg-orange-500/10 border-l-2 border-orange-500"}`,children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[((N=O.properties)==null?void 0:N.new_ignition)&&x.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-red-500/20 text-red-400",children:"NEW"}),x.jsx("span",{className:"text-sm text-slate-200",children:O.headline})]}),((B=O.properties)==null?void 0:B.frp)&&x.jsxs("span",{className:"text-sm font-mono text-orange-400",children:[Math.round(O.properties.frp)," MW"]})]}),x.jsxs("div",{className:"text-xs text-slate-500 mt-1 flex items-center gap-3",children:[x.jsxs("span",{children:["Conf: ",(($=O.properties)==null?void 0:$.confidence)||"N/A"]}),((F=O.properties)==null?void 0:F.acq_time)&&x.jsxs("span",{children:["@",O.properties.acq_time,"Z"]}),((G=O.properties)==null?void 0:G.near_fire)&&x.jsxs("span",{children:["Near: ",O.properties.near_fire]})]})]},O.event_id)})})]}),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(Ds,{size:14}),"Active Events (",r.length,")"]}),r.length>0?x.jsx("div",{className:"space-y-3",children:r.map(O=>x.jsx(bJe,{event:O},O.event_id))}):x.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[x.jsx(Qh,{size:16,className:"text-green-500"}),x.jsx("span",{children:"No active environmental events"})]})]})]}):x.jsxs("div",{className:"flex flex-col items-center justify-center h-[60vh] text-center",children:[x.jsx("div",{className:"w-16 h-16 rounded-full bg-bg-card border border-border flex items-center justify-center mb-6",children:x.jsx(Yc,{size:32,className:"text-slate-500"})}),x.jsx("h2",{className:"text-xl font-semibold text-slate-300 mb-2",children:"Environmental Feeds Disabled"}),x.jsx("p",{className:"text-slate-500 max-w-md",children:"Enable environmental feeds in config.yaml to see weather alerts, space weather indices, and tropospheric ducting data."})]})}function jR({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(A=>{var M,P,k,I;return((M=A.short_name)==null?void 0:M.toLowerCase().includes(T))||((P=A.long_name)==null?void 0:P.toLowerCase().includes(T))||((k=A.role)==null?void 0:k.toLowerCase().includes(T))||((I=A.node_id_hex)==null?void 0:I.toLowerCase().includes(T))})}return S.sort((T,A)=>(T.short_name||"").localeCompare(A.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(A=>A!==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(A=>m(A)===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(A=>A!==S)),className:"hover:text-white",children:x.jsx(hv,{size:14})})]},S)})}),x.jsxs("div",{className:"relative",children:[x.jsxs("div",{className:"relative",children:[x.jsx(HE,{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(md,{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 RR(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(md,{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 BU=[{key:"bot",label:"Bot",icon:Gue},{key:"connection",label:"Connection",icon:MZ},{key:"response",label:"Response",icon:Jue},{key:"history",label:"History",icon:Kue},{key:"memory",label:"Memory",icon:Wue},{key:"context",label:"Context",icon:$E},{key:"commands",label:"Commands",icon:CZ},{key:"llm",label:"LLM",icon:mZ},{key:"weather",label:"Weather",icon:Yc},{key:"meshmonitor",label:"MeshMonitor",icon:tu},{key:"knowledge",label:"Knowledge",icon:pZ},{key:"mesh_sources",label:"Mesh Sources",icon:xZ},{key:"mesh_intelligence",label:"Intelligence",icon:Wy},{key:"environmental",label:"Environmental",icon:rce},{key:"dashboard",label:"Dashboard",icon:_Z}],Kn={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.",environmental:"Live environmental data feeds for situational awareness. Each feed polls a public or authenticated API for real-time conditions affecting your area.",dashboard:"Web dashboard settings. You're looking at it right now."},AJe=[{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"}],CJe=[{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 Wo({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(hv,{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(xd,{size:10})]})]})]})}function Qn({text:e}){return x.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function At({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(Wo,{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(yZ,{size:16}):x.jsx($E,{size:16})})]}),a&&x.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function qe({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(Wo,{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 Et({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(Wo,{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 Co({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(Wo,{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 MJe({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(Wo,{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 Hh({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(Wo,{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 PJe({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(Wo,{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 LJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.bot}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(At,{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(At,{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(Et,{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(Et,{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 kJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.connection}),x.jsx(Co,{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(At,{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(At,{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(qe,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function IJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.response}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(qe,{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(qe,{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(qe,{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(qe,{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 OJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.history}),x.jsx(At,{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(qe,{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(qe,{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(Et,{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(qe,{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(qe,{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 EJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.memory}),x.jsx(Et,{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(qe,{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(qe,{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 DJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.context}),x.jsx(Et,{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(RR,{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(jR,{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(qe,{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(qe,{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 NJe({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(Qn,{text:Kn.commands}),x.jsx(Et,{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(At,{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(Wo,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),x.jsx("div",{className:"grid gap-1",children:AJe.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 jJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.llm}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(Co,{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(At,{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(At,{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(At,{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(qe,{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(qe,{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(Et,{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(MJe,{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(Et,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),x.jsx(Et,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function RJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.weather}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(Co,{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(Co,{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(At,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function BJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.meshmonitor}),x.jsx(Et,{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(At,{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(Et,{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(qe,{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(Et,{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 zJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.knowledge}),x.jsx(Et,{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(Co,{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(At,{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(qe,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),x.jsx(At,{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(At,{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(qe,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),x.jsx(Et,{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(At,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),x.jsx(qe,{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 $Je({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(Hy,{size:16}):x.jsx(bm,{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(UE,{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(At,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),x.jsx(Co,{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(At,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&x.jsx(At,{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(At,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),x.jsx(qe,{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(At,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),x.jsx(At,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),x.jsx(At,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),x.jsx(Et,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),x.jsx(qe,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),x.jsx(Et,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),x.jsx(Et,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function FJe({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(Qn,{text:Kn.mesh_sources}),e.map((n,i)=>x.jsx($Je,{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(bS,{size:16})," Add Source"]})]})}function VJe({data:e,onChange:t}){const[r,n]=W.useState(null);return x.jsxs("div",{className:"space-y-6",children:[x.jsx(Qn,{text:Kn.mesh_intelligence}),x.jsx(Et,{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(qe,{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(qe,{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(qe,{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(qe,{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(jR,{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(RR,{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(qe,{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(Wo,{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(Hy,{size:16}):x.jsx(bm,{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(UE,{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(At,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),x.jsx(At,{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(qe,{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(qe,{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(At,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),x.jsx(Hh,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),x.jsx(Hh,{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(bS,{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(Wo,{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 GJe({data:e,onChange:t}){var r,n,i,a,o,s,l,u,c,f,h,d,v,g,m,y;return x.jsxs("div",{className:"space-y-6",children:[x.jsx(Qn,{text:Kn.environmental}),x.jsx(Et,{label:"Enable Environmental Feeds",checked:e.enabled,onChange:_=>t({...e,enabled:_}),helper:"Activate live data polling"}),e.enabled&&x.jsxs(x.Fragment,{children:[x.jsx(Hh,{label:"NWS Zones",value:e.nws_zones,onChange:_=>t({...e,nws_zones:_}),helper:"Zone IDs like IDZ016, IDZ030",info:"NWS forecast zones covering your mesh area. Find yours at https://www.weather.gov/pimar/PubZone",infoLink:"https://www.weather.gov/pimar/PubZone"}),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.jsx("span",{className:"text-sm font-medium text-slate-300",children:"NWS Weather Alerts"}),x.jsx(Et,{label:"",checked:e.nws.enabled,onChange:_=>t({...e,nws:{...e.nws,enabled:_}})})]}),e.nws.enabled&&x.jsxs(x.Fragment,{children:[x.jsx(At,{label:"User Agent",value:e.nws.user_agent,onChange:_=>t({...e,nws:{...e.nws,user_agent:_}}),placeholder:"(MeshAI, your@email.com)",helper:"Required format: (app_name, contact_email)",info:"Required by NWS. You make it up - just use the format (app_name, your_email). No signup needed."}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(qe,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:_=>t({...e,nws:{...e.nws,tick_seconds:_}}),min:30,helper:"Polling interval"}),x.jsx(Co,{label:"Min Severity",value:e.nws.severity_min,onChange:_=>t({...e,nws:{...e.nws,severity_min:_}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}],helper:"Filter out lower severity alerts",info:"Minimum severity level to display. 'Moderate' filters out minor advisories. 'Severe' shows only serious warnings."})]})]})]}),x.jsx("div",{className:"border border-[#1e2a3a] rounded-lg p-4",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:"NOAA Space Weather (SWPC)"}),x.jsx("p",{className:"text-xs text-slate-600",children:"Solar indices, geomagnetic storms, HF propagation"})]}),x.jsx(Et,{label:"",checked:e.swpc.enabled,onChange:_=>t({...e,swpc:{...e.swpc,enabled:_}})})]})}),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:"Tropospheric Ducting"}),x.jsx("p",{className:"text-xs text-slate-600",children:"VHF/UHF extended range conditions"})]}),x.jsx(Et,{label:"",checked:e.ducting.enabled,onChange:_=>t({...e,ducting:{...e.ducting,enabled:_}})})]}),e.ducting.enabled&&x.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[x.jsx(qe,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:_=>t({...e,ducting:{...e.ducting,tick_seconds:_}}),min:60}),x.jsx(qe,{label:"Latitude",value:e.ducting.latitude,onChange:_=>t({...e,ducting:{...e.ducting,latitude:_}}),step:.01,info:"Center point of your mesh coverage area. The ducting adapter checks atmospheric conditions at this location."}),x.jsx(qe,{label:"Longitude",value:e.ducting.longitude,onChange:_=>t({...e,ducting:{...e.ducting,longitude:_}}),step:.01})]})]}),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:"NIFC Fire Perimeters"}),x.jsx("p",{className:"text-xs text-slate-600",children:"Active wildfires from National Interagency Fire Center"})]}),x.jsx(Et,{label:"",checked:e.fires.enabled,onChange:_=>t({...e,fires:{...e.fires,enabled:_}})})]}),e.fires.enabled&&x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(qe,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:_=>t({...e,fires:{...e.fires,tick_seconds:_}}),min:60}),x.jsx(Co,{label:"State",value:e.fires.state,onChange:_=>t({...e,fires:{...e.fires,state:_}}),options:CJe,helper:"Filter fires by state",info:"Two-letter state code for NIFC wildfire filtering."})]})]}),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:"Avalanche Advisories"}),x.jsx("p",{className:"text-xs text-slate-600",children:"Backcountry avalanche danger ratings"})]}),x.jsx(Et,{label:"",checked:e.avalanche.enabled,onChange:_=>t({...e,avalanche:{...e.avalanche,enabled:_}})})]}),e.avalanche.enabled&&x.jsxs(x.Fragment,{children:[x.jsx(qe,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:_=>t({...e,avalanche:{...e.avalanche,tick_seconds:_}}),min:60}),x.jsx(Hh,{label:"Center IDs",value:e.avalanche.center_ids,onChange:_=>t({...e,avalanche:{...e.avalanche,center_ids:_}}),helper:"e.g., SNFAC, IPAC, FAC",info:"Find your local center at https://avalanche.org/avalanche-centers/",infoLink:"https://avalanche.org/avalanche-centers/"}),x.jsx(PJe,{label:"Season Months",value:e.avalanche.season_months,onChange:_=>t({...e,avalanche:{...e.avalanche,season_months:_}}),helper:"e.g., 12, 1, 2, 3, 4",info:"Months when avalanche forecasts are active. Default Dec-Apr. Adjust for your region's season."})]})]}),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:"USGS Stream Gauges"}),x.jsx("p",{className:"text-xs text-slate-600",children:"River and stream water levels"})]}),x.jsx(Et,{label:"",checked:((r=e.usgs)==null?void 0:r.enabled)||!1,onChange:_=>{var b,S;return t({...e,usgs:{...e.usgs,enabled:_,tick_seconds:((b=e.usgs)==null?void 0:b.tick_seconds)||900,sites:((S=e.usgs)==null?void 0:S.sites)||[]}})}})]}),((n=e.usgs)==null?void 0:n.enabled)&&x.jsxs(x.Fragment,{children:[x.jsx(qe,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:_=>t({...e,usgs:{...e.usgs,tick_seconds:_}}),min:900,helper:"Minimum 15 min (900s)"}),x.jsx(Hh,{label:"Site IDs",value:e.usgs.sites,onChange:_=>t({...e,usgs:{...e.usgs,sites:_}}),helper:"USGS gauge site numbers",info:"Find site IDs at waterdata.usgs.gov/nwis",infoLink:"https://waterdata.usgs.gov/nwis"})]})]}),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:"TomTom Traffic"}),x.jsx("p",{className:"text-xs text-slate-600",children:"Traffic flow on monitored corridors"})]}),x.jsx(Et,{label:"",checked:((i=e.traffic)==null?void 0:i.enabled)||!1,onChange:_=>{var b,S,T;return t({...e,traffic:{...e.traffic,enabled:_,tick_seconds:((b=e.traffic)==null?void 0:b.tick_seconds)||300,api_key:((S=e.traffic)==null?void 0:S.api_key)||"",corridors:((T=e.traffic)==null?void 0:T.corridors)||[]}})}})]}),((a=e.traffic)==null?void 0:a.enabled)&&x.jsxs(x.Fragment,{children:[x.jsx(At,{label:"API Key",value:e.traffic.api_key,onChange:_=>t({...e,traffic:{...e.traffic,api_key:_}}),type:"password",helper:"Get key at developer.tomtom.com",infoLink:"https://developer.tomtom.com"}),x.jsx(qe,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:_=>t({...e,traffic:{...e.traffic,tick_seconds:_}}),min:60}),x.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Corridors (each with name, lat, lon):"}),(e.traffic.corridors||[]).map((_,b)=>x.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[x.jsx(At,{label:"Name",value:_.name,onChange:S=>{const T=[...e.traffic.corridors];T[b]={..._,name:S},t({...e,traffic:{...e.traffic,corridors:T}})}}),x.jsx(qe,{label:"Lat",value:_.lat,onChange:S=>{const T=[...e.traffic.corridors];T[b]={..._,lat:S},t({...e,traffic:{...e.traffic,corridors:T}})},step:.01}),x.jsx(qe,{label:"Lon",value:_.lon,onChange:S=>{const T=[...e.traffic.corridors];T[b]={..._,lon:S},t({...e,traffic:{...e.traffic,corridors:T}})},step:.01}),x.jsx("button",{onClick:()=>t({...e,traffic:{...e.traffic,corridors:e.traffic.corridors.filter((S,T)=>T!==b)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30 rounded",children:"Remove"})]},b)),x.jsx("button",{onClick:()=>t({...e,traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"})]})]}),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:"511 Road Conditions"}),x.jsx("p",{className:"text-xs text-slate-600",children:"State DOT road events and closures"})]}),x.jsx(Et,{label:"",checked:((o=e.roads511)==null?void 0:o.enabled)||!1,onChange:_=>{var b,S,T,A,M;return t({...e,roads511:{...e.roads511,enabled:_,tick_seconds:((b=e.roads511)==null?void 0:b.tick_seconds)||300,api_key:((S=e.roads511)==null?void 0:S.api_key)||"",base_url:((T=e.roads511)==null?void 0:T.base_url)||"",endpoints:((A=e.roads511)==null?void 0:A.endpoints)||["/get/event"],bbox:((M=e.roads511)==null?void 0:M.bbox)||[]}})}})]}),((s=e.roads511)==null?void 0:s.enabled)&&x.jsxs(x.Fragment,{children:[x.jsx(At,{label:"Base URL",value:e.roads511.base_url,onChange:_=>t({...e,roads511:{...e.roads511,base_url:_}}),placeholder:"https://511.yourstate.gov/api/v2",helper:"State 511 API endpoint"}),x.jsx(At,{label:"API Key",value:e.roads511.api_key,onChange:_=>t({...e,roads511:{...e.roads511,api_key:_}}),type:"password",helper:"Leave empty if not required"}),x.jsx(qe,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:_=>t({...e,roads511:{...e.roads511,tick_seconds:_}}),min:60}),x.jsx(Hh,{label:"Endpoints",value:e.roads511.endpoints,onChange:_=>t({...e,roads511:{...e.roads511,endpoints:_}}),helper:"e.g., /get/event, /get/mountainpasses"}),x.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[x.jsx(qe,{label:"West",value:((l=e.roads511.bbox)==null?void 0:l[0])||0,onChange:_=>{const b=[...e.roads511.bbox||[0,0,0,0]];b[0]=_,t({...e,roads511:{...e.roads511,bbox:b}})},step:.01}),x.jsx(qe,{label:"South",value:((u=e.roads511.bbox)==null?void 0:u[1])||0,onChange:_=>{const b=[...e.roads511.bbox||[0,0,0,0]];b[1]=_,t({...e,roads511:{...e.roads511,bbox:b}})},step:.01}),x.jsx(qe,{label:"East",value:((c=e.roads511.bbox)==null?void 0:c[2])||0,onChange:_=>{const b=[...e.roads511.bbox||[0,0,0,0]];b[2]=_,t({...e,roads511:{...e.roads511,bbox:b}})},step:.01}),x.jsx(qe,{label:"North",value:((f=e.roads511.bbox)==null?void 0:f[3])||0,onChange:_=>{const b=[...e.roads511.bbox||[0,0,0,0]];b[3]=_,t({...e,roads511:{...e.roads511,bbox:b}})},step:.01})]}),x.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box filter (leave all 0 to disable)"})]})]}),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:"NASA FIRMS Satellite Fire Detection"}),x.jsx("p",{className:"text-xs text-slate-600",children:"Near real-time thermal anomalies from satellites"})]}),x.jsx(Et,{label:"",checked:((h=e.firms)==null?void 0:h.enabled)||!1,onChange:_=>{var b,S,T,A,M,P,k;return t({...e,firms:{...e.firms,enabled:_,tick_seconds:((b=e.firms)==null?void 0:b.tick_seconds)||1800,map_key:((S=e.firms)==null?void 0:S.map_key)||"",source:((T=e.firms)==null?void 0:T.source)||"VIIRS_SNPP_NRT",bbox:((A=e.firms)==null?void 0:A.bbox)||[],day_range:((M=e.firms)==null?void 0:M.day_range)||1,confidence_min:((P=e.firms)==null?void 0:P.confidence_min)||"nominal",proximity_km:((k=e.firms)==null?void 0:k.proximity_km)||10}})}})]}),((d=e.firms)==null?void 0:d.enabled)&&x.jsxs(x.Fragment,{children:[x.jsx(At,{label:"MAP Key",value:e.firms.map_key,onChange:_=>t({...e,firms:{...e.firms,map_key:_}}),type:"password",helper:"Get key at firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),x.jsx(qe,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:_=>t({...e,firms:{...e.firms,tick_seconds:_}}),min:300,helper:"Minimum 5 min (300s)"}),x.jsx(Co,{label:"Satellite Source",value:e.firms.source,onChange:_=>t({...e,firms:{...e.firms,source:_}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (Near Real-Time)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (Near Real-Time)"},{value:"MODIS_NRT",label:"MODIS (Near Real-Time)"}]}),x.jsx(qe,{label:"Day Range",value:e.firms.day_range,onChange:_=>t({...e,firms:{...e.firms,day_range:_}}),min:1,max:10,helper:"1-10 days of data"}),x.jsx(Co,{label:"Minimum Confidence",value:e.firms.confidence_min,onChange:_=>t({...e,firms:{...e.firms,confidence_min:_}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),x.jsx(qe,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:_=>t({...e,firms:{...e.firms,proximity_km:_}}),step:.5,helper:"Distance to match known fires"}),x.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[x.jsx(qe,{label:"West",value:((v=e.firms.bbox)==null?void 0:v[0])||0,onChange:_=>{const b=[...e.firms.bbox||[0,0,0,0]];b[0]=_,t({...e,firms:{...e.firms,bbox:b}})},step:.01}),x.jsx(qe,{label:"South",value:((g=e.firms.bbox)==null?void 0:g[1])||0,onChange:_=>{const b=[...e.firms.bbox||[0,0,0,0]];b[1]=_,t({...e,firms:{...e.firms,bbox:b}})},step:.01}),x.jsx(qe,{label:"East",value:((m=e.firms.bbox)==null?void 0:m[2])||0,onChange:_=>{const b=[...e.firms.bbox||[0,0,0,0]];b[2]=_,t({...e,firms:{...e.firms,bbox:b}})},step:.01}),x.jsx(qe,{label:"North",value:((y=e.firms.bbox)==null?void 0:y[3])||0,onChange:_=>{const b=[...e.firms.bbox||[0,0,0,0]];b[3]=_,t({...e,firms:{...e.firms,bbox:b}})},step:.01})]}),x.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box for monitoring area (required)"})]})]})]})]})}function WJe({data:e,onChange:t}){return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Qn,{text:Kn.dashboard}),x.jsx(Et,{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(At,{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(qe,{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 HJe(){var k;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 I=await fetch("/api/config");if(!I.ok)throw new Error("Failed to fetch config");const O=await I.json();t(O),n(JSON.parse(JSON.stringify(O))),y(!1),f(null)}catch(I){f(I instanceof Error?I.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 I=e[i],O=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)}),D=await O.json();if(!O.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(I){f(I instanceof Error?I.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")}},A=(I,O)=>{e&&t({...e,[I]:O})};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 M=()=>{switch(i){case"bot":return x.jsx(LJe,{data:e.bot,onChange:I=>A("bot",I)});case"connection":return x.jsx(kJe,{data:e.connection,onChange:I=>A("connection",I)});case"response":return x.jsx(IJe,{data:e.response,onChange:I=>A("response",I)});case"history":return x.jsx(OJe,{data:e.history,onChange:I=>A("history",I)});case"memory":return x.jsx(EJe,{data:e.memory,onChange:I=>A("memory",I)});case"context":return x.jsx(DJe,{data:e.context,onChange:I=>A("context",I)});case"commands":return x.jsx(NJe,{data:e.commands,onChange:I=>A("commands",I)});case"llm":return x.jsx(jJe,{data:e.llm,onChange:I=>A("llm",I)});case"weather":return x.jsx(RJe,{data:e.weather,onChange:I=>A("weather",I)});case"meshmonitor":return x.jsx(BJe,{data:e.meshmonitor,onChange:I=>A("meshmonitor",I)});case"knowledge":return x.jsx(zJe,{data:e.knowledge,onChange:I=>A("knowledge",I)});case"mesh_sources":return x.jsx(FJe,{data:e.mesh_sources,onChange:I=>A("mesh_sources",I)});case"mesh_intelligence":return x.jsx(VJe,{data:e.mesh_intelligence,onChange:I=>A("mesh_intelligence",I)});case"environmental":return x.jsx(GJe,{data:e.environmental,onChange:I=>A("environmental",I)});case"dashboard":return x.jsx(WJe,{data:e.dashboard,onChange:I=>A("dashboard",I)});default:return null}},P=((k=BU.find(I=>I.key===i))==null?void 0:k.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:BU.map(({key:I,label:O,icon:D})=>x.jsxs("button",{onClick:()=>a(I),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===I?"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:O}),m&&i===I&&x.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},I))}),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(AZ,{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(SZ,{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(wZ,{size:14,className:"animate-spin"}):x.jsx(TZ,{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(Ds,{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(hv,{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(md,{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:M()})})]})]})}const zU={infra_offline:ice,infra_recovery:MZ,battery_warning:tC,battery_critical:tC,battery_emergency:tC,hf_blackout:Sm,uhf_ducting:tu,weather_warning:Yc,weather_watch:Yc,new_router:tu,packet_flood:Ds,sustained_high_util:Ds,region_blackout:Uy,default:_m};function UJe(e){return zU[e]||zU.default}function Vie(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",badge:"bg-red-500/20 text-red-400",iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",badge:"bg-amber-500/20 text-amber-400",iconColor:"text-amber-500"};case"watch":return{bg:"bg-yellow-500/10",border:"border-yellow-500",badge:"bg-yellow-500/20 text-yellow-400",iconColor:"text-yellow-500"};case"advisory":case"info":default:return{bg:"bg-blue-500/10",border:"border-blue-500",badge:"bg-blue-500/20 text-blue-400",iconColor:"text-blue-500"}}}function ZJe(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 YJe(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 XJe(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 qJe({alert:e,onAcknowledge:t}){var i;const r=Vie(e.severity),n=UJe(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(yd,{size:12}),e.timestamp?ZJe(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 KJe({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","critical","warning","watch","info"];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(FE,{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=Vie(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:YJe(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?XJe(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(Uue,{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(bm,{size:16})})]})]})]})}function QJe({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 _m;case"daily":return yd;case"weekly":return yd;default:return _m}})();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 JJe(){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,A]=W.useState(new Set),{lastAlert:M}=ZE();W.useEffect(()=>{document.title="Alerts — MeshAI"},[]),W.useEffect(()=>{Promise.all([PZ().catch(()=>[]),u3(S,0).catch(()=>({items:[],total:0})),uce().catch(()=>[]),fetch("/api/nodes").then(I=>I.json()).catch(()=>[])]).then(([I,O,D,N])=>{t(I),Array.isArray(O)?(n(O),b(1)):(n(O.items||[]),b(Math.ceil((O.total||0)/S))),a(D),s(N),u(!1)}).catch(I=>{f(I.message),u(!1)})},[]),W.useEffect(()=>{M&&t(I=>I.some(D=>D.type===M.type&&D.message===M.message)?I:[M,...I])},[M]),W.useEffect(()=>{const I=(m-1)*S;u3(S,I,h,v).then(O=>{Array.isArray(O)?(n(O),b(1)):(n(O.items||[]),b(Math.ceil((O.total||0)/S)))}).catch(()=>{})},[m,h,v]);const P=W.useCallback(I=>{const O=`${I.type}-${I.message}-${I.timestamp}`;A(D=>new Set([...D,O]))},[]),k=e.filter(I=>{const O=`${I.type}-${I.message}-${I.timestamp}`;return!T.has(O)});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(Ds,{size:14}),"Active Alerts (",k.length,")"]}),k.length>0?x.jsx("div",{className:"space-y-3",children:k.map((I,O)=>x.jsx(qJe,{alert:I,onAcknowledge:P},`${I.type}-${I.timestamp}-${O}`))}):x.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[x.jsx(Qh,{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(yd,{size:14}),"Alert History"]}),x.jsx(KJe,{history:r,typeFilter:h,severityFilter:v,onTypeFilterChange:I=>{d(I),y(1)},onSeverityFilterChange:I=>{g(I),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(nce,{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(I=>x.jsx(QJe,{subscription:I,nodes:o},I.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 gb=[{value:"info",label:"Info",description:"Routine updates (ducting detected, new router appeared)"},{value:"advisory",label:"Advisory",description:"Worth knowing (weather advisory, traffic slow, battery declining)"},{value:"watch",label:"Watch",description:"Pay attention (fire within 50km, weather watch, stream rising)"},{value:"warning",label:"Warning",description:"Act now (fire within 25km, severe weather, critical battery)"},{value:"critical",label:"Critical",description:"Serious issue (critical node down, battery emergency)"},{value:"emergency",label:"Emergency",description:"Life safety (extreme weather, fire at infrastructure, total blackout)"}],$U=[{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:"advisory",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:"warning",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:"info",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:"warning",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:"emergency",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:"info",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 No({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 mh({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(No,{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(yZ,{size:16}):x.jsx($E,{size:16})})]}),a&&x.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function FU({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(No,{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 rS({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(No,{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 nS({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(No,{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 eet({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(No,{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(bS,{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(hv,{size:14})})]},f))}),i&&x.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function tet({value:e,onChange:t}){const[r,n]=W.useState(!1),i=gb.find(a=>a.value===e)||gb[3];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(No,{info:"Only alerts at or above this severity trigger this rule. Lower threshold = more notifications. 'Warning' is recommended for most rules."})]}),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(Hy,{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:gb.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 ret({rule:e,categories:t,quietHoursEnabled:r,onChange:n,onDelete:i,onDuplicate:a,onTest:o}){var S,T,A,M;const[s,l]=W.useState(!e.name),[u,c]=W.useState(!1),f=[{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"}],h=[{value:"daily",label:"Daily"},{value:"twice_daily",label:"Twice Daily"},{value:"weekly",label:"Weekly"}],d=[{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"}],v=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],g=P=>{const k=e.categories||[];k.includes(P)?n({...e,categories:k.filter(I=>I!==P)}):n({...e,categories:[...k,P]})},m=P=>{const k=e.schedule_days||[];k.includes(P)?n({...e,schedule_days:k.filter(I=>I!==P)}):n({...e,schedule_days:[...k,P]})},y=async()=>{c(!0),await o(),c(!1)},_=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const P=e.categories||[];if(P.length===0&&t.length>0)return t[0].example_message||"Alert notification";const k=t.find(I=>P.includes(I.id));return(k==null?void 0:k.example_message)||"Alert notification"},b=()=>{var k,I,O,D,N,B,$,F;const P=[];if(e.trigger_type==="schedule"){const G=((k=h.find(U=>U.value===e.schedule_frequency))==null?void 0:k.label)||e.schedule_frequency,z=((I=d.find(U=>U.value===e.message_type))==null?void 0:I.label)||e.message_type;P.push(`${G} at ${e.schedule_time||"??:??"}`),P.push(z)}else{const G=((O=e.categories)==null?void 0:O.length)||0,z=G===0?"All":t.filter(H=>{var Y;return(Y=e.categories)==null?void 0:Y.includes(H.id)}).map(H=>H.name).slice(0,2).join(", ")+(G>2?` +${G-2}`:""),U=((D=gb.find(H=>H.value===e.min_severity))==null?void 0:D.label)||e.min_severity;P.push(`${z} at ${U}+`)}if(!e.delivery_type)P.push("⚠️ No delivery");else{const G=((N=f.find(U=>U.value===e.delivery_type))==null?void 0:N.label)||e.delivery_type;let z="";if(e.delivery_type==="mesh_broadcast")z=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")z=`${((B=e.node_ids)==null?void 0:B.length)||0} nodes`;else if(e.delivery_type==="email")z=($=e.recipients)!=null&&$.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{z=new URL(e.webhook_url).hostname}catch{z=((F=e.webhook_url)==null?void 0:F.slice(0,20))||"no URL"}P.push(`${G}${z?` (${z})`:""}`)}return P.join(" → ")};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:()=>l(!s),children:[x.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[s?x.jsx(Hy,{size:16,className:"text-slate-500 flex-shrink-0"}):x.jsx(bm,{size:16,className:"text-slate-500 flex-shrink-0"}),x.jsx("button",{onClick:P=>{P.stopPropagation(),n({...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(yd,{size:14,className:"text-blue-400 flex-shrink-0"}):x.jsx(Sm,{size:14,className:"text-yellow-400 flex-shrink-0"}),x.jsx("span",{className:"font-medium text-slate-200 truncate",children:e.name||"New Rule"}),!s&&x.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:b()})]}),x.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[x.jsx("button",{onClick:P=>{P.stopPropagation(),y()},disabled:u||!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(o3,{size:14})}),x.jsx("button",{onClick:P=>{P.stopPropagation(),a()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:x.jsx(que,{size:14})}),x.jsx("button",{onClick:P=>{P.stopPropagation(),i()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:x.jsx(UE,{size:14})})]})]}),s&&x.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[x.jsx(mh,{label:"Rule Name",value:e.name,onChange:P=>n({...e,name:P}),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:()=>n({...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(Sm,{size:16}),x.jsx("span",{children:"Condition"})]}),x.jsxs("button",{type:"button",onClick:()=>n({...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(yd,{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(Ds,{size:14}),"WHEN (Condition)"]}),x.jsx(tet,{value:e.min_severity,onChange:P=>n({...e,min_severity:P})}),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(No,{info:"Select which types of alerts trigger this rule. Leave all unchecked to match ALL categories."})]}),x.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((S=e.categories)==null?void 0:S.length)||0)===0?"All categories (none selected)":`${(T=e.categories)==null?void 0:T.length} selected`}),x.jsx("div",{className:"max-h-48 overflow-y-auto border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:t.map(P=>{var k,I;return x.jsxs("label",{onClick:()=>g(P.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 ${(k=e.categories)!=null&&k.includes(P.id)?"bg-accent border-accent":"border-slate-600"}`,children:((I=e.categories)==null?void 0:I.includes(P.id))&&x.jsx(md,{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:P.name}),x.jsx("div",{className:"text-xs text-slate-500",children:P.description})]})]},P.id)})})]})]}),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(Hue,{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:P=>n({...e,schedule_frequency:P.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:h.map(P=>x.jsx("option",{value:P.value,children:P.label},P.value))})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(nS,{label:"Time",value:e.schedule_time||"07:00",onChange:P=>n({...e,schedule_time:P})}),e.schedule_frequency==="twice_daily"&&x.jsx(nS,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:P=>n({...e,schedule_time_2:P})})]}),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:v.map(P=>{var k;return x.jsx("button",{type:"button",onClick:()=>m(P),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(k=e.schedule_days)!=null&&k.includes(P)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:P.slice(0,3)},P)})})]}),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:P=>n({...e,message_type:P.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:d.map(P=>x.jsx("option",{value:P.value,children:P.label},P.value))}),x.jsx("p",{className:"text-xs text-slate-600",children:(A=d.find(P=>P.value===e.message_type))==null?void 0:A.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(No,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),x.jsx("textarea",{value:e.custom_message||"",onChange:P=>n({...e,custom_message:P.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-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(o3,{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(No,{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:P=>n({...e,delivery_type:P.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:f.map(P=>x.jsx("option",{value:P.value,children:P.label},P.value))}),x.jsx("p",{className:"text-xs text-slate-600",children:(M=f.find(P=>P.value===(e.delivery_type||"")))==null?void 0:M.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(Uy,{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.jsx(RR,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:P=>n({...e,broadcast_channel:P}),helper:"Select the mesh radio channel",mode:"single"}),e.delivery_type==="mesh_dm"&&x.jsx(jR,{label:"Recipient Nodes",value:e.node_ids||[],onChange:P=>n({...e,node_ids:P}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),e.delivery_type==="email"&&x.jsxs("div",{className:"space-y-4",children:[x.jsx(eet,{label:"Recipients",value:e.recipients||[],onChange:P=>n({...e,recipients:P}),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(bm,{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(mh,{label:"SMTP Host",value:e.smtp_host||"",onChange:P=>n({...e,smtp_host:P}),placeholder:"smtp.gmail.com"}),x.jsx(FU,{label:"SMTP Port",value:e.smtp_port??587,onChange:P=>n({...e,smtp_port:P}),min:1,max:65535})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(mh,{label:"Username",value:e.smtp_user||"",onChange:P=>n({...e,smtp_user:P})}),x.jsx(mh,{label:"Password",value:e.smtp_password||"",onChange:P=>n({...e,smtp_password:P}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),x.jsx(rS,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:P=>n({...e,smtp_tls:P})}),x.jsx(mh,{label:"From Address",value:e.from_address||"",onChange:P=>n({...e,from_address:P}),placeholder:"alerts@yourdomain.com"})]})]})]}),e.delivery_type==="webhook"&&x.jsx(mh,{label:"Webhook URL",value:e.webhook_url||"",onChange:P=>n({...e,webhook_url:P}),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.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(FU,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:P=>n({...e,cooldown_minutes:P}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."}),r&&x.jsx("div",{className:"flex items-end pb-1",children:x.jsx(rS,{label:"Override Quiet Hours",checked:e.override_quiet??!1,onChange:P=>n({...e,override_quiet:P}),helper:"Deliver during quiet hours"})})]}),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:_()})}),x.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}function net(){var D,N;const[e,t]=W.useState(null),[r,n]=W.useState(null),[i,a]=W.useState([]),[o,s]=W.useState(!0),[l,u]=W.useState(!1),[c,f]=W.useState(null),[h,d]=W.useState(null),[v,g]=W.useState(null),[m,y]=W.useState(!1),[_,b]=W.useState(!1),S=W.useCallback(async()=>{try{const[B,$]=await Promise.all([fetch("/api/config/notifications"),fetch("/api/notifications/categories")]);if(!B.ok)throw new Error("Failed to fetch notifications config");const F=await B.json(),G=await $.json();t(F),n(JSON.parse(JSON.stringify(F))),a(G),b(!1),f(null)}catch(B){f(B instanceof Error?B.message:"Unknown error")}finally{s(!1)}},[]);W.useEffect(()=>{document.title="Notifications — MeshAI",S()},[S]),W.useEffect(()=>{e&&r&&b(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const T=async()=>{if(e){u(!0),f(null),d(null);try{const B=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),$=await B.json();if(!B.ok)throw new Error($.detail||"Save failed");d("Notifications config saved successfully"),n(JSON.parse(JSON.stringify(e))),b(!1),setTimeout(()=>d(null),3e3)}catch(B){f(B instanceof Error?B.message:"Save failed")}finally{u(!1)}}},A=()=>{r&&(t(JSON.parse(JSON.stringify(r))),b(!1))},M=()=>({name:"",enabled:!0,trigger_type:"condition",categories:[],min_severity:"warning",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}),P=()=>{e&&t({...e,rules:[...e.rules||[],M()]})},k=B=>{if(!e)return;const $=$U.find(F=>F.id===B);$&&(t({...e,rules:[...e.rules||[],{...$.rule}]}),y(!1))},I=B=>{if(!e)return;const $=e.rules[B],F={...JSON.parse(JSON.stringify($)),name:`${$.name} (copy)`},G=[...e.rules];G.splice(B+1,0,F),t({...e,rules:G})},O=async B=>{try{const F=await(await fetch(`/api/notifications/rules/${B}/test`,{method:"POST"})).json();g(F),setTimeout(()=>g(null),5e3)}catch{g({success:!1,message:"Test failed"}),setTimeout(()=>g(null),5e3)}};return o?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:[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:S,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:x.jsx(wZ,{size:18})}),x.jsxs("button",{onClick:A,disabled:!_,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(SZ,{size:16}),"Discard"]}),x.jsxs("button",{onClick:T,disabled:l||!_,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(TZ,{size:16}),l?"Saving...":"Save"]})]})]}),c&&x.jsx("div",{className:"p-3 rounded-lg text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:c}),h&&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(md,{size:14,className:"inline mr-2"}),h]}),v&&x.jsxs("div",{className:`p-3 rounded-lg text-sm ${v.success?"bg-green-500/10 text-green-400 border border-green-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[v.success?x.jsx(md,{size:14,className:"inline mr-2"}):x.jsx(hv,{size:14,className:"inline mr-2"}),v.message]}),x.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6 space-y-6",children:[x.jsx(rS,{label:"Enable Notifications",checked:e.enabled,onChange:B=>t({...e,enabled:B}),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(ece,{size:14,className:"text-slate-400"}),x.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Quiet Hours"})]}),x.jsx(rS,{label:"Enable Quiet Hours",checked:e.quiet_hours_enabled??!0,onChange:B=>t({...e,quiet_hours_enabled:B}),helper:"Suppress non-emergency alerts during sleeping hours",info:"When enabled, alerts below emergency severity are held during quiet hours. When disabled, all alerts deliver anytime."}),e.quiet_hours_enabled&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[x.jsx(nS,{label:"Start Time",value:e.quiet_hours_start||"22:00",onChange:B=>t({...e,quiet_hours_start:B}),helper:"When quiet hours begin"}),x.jsx(nS,{label:"End Time",value:e.quiet_hours_end||"06:00",onChange:B=>t({...e,quiet_hours_end:B}),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",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(No,{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:[((D=e.rules)==null?void 0:D.length)||0," rule",(((N=e.rules)==null?void 0:N.length)||0)!==1?"s":""]})]}),(e.rules||[]).map((B,$)=>x.jsx(ret,{rule:B,categories:i,quietHoursEnabled:e.quiet_hours_enabled??!0,onChange:F=>{const G=[...e.rules||[]];G[$]=F,t({...e,rules:G})},onDelete:()=>{confirm(`Delete rule "${B.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((F,G)=>G!==$)})},onDuplicate:()=>I($),onTest:()=>O($)},$)),x.jsxs("div",{className:"flex gap-2",children:[x.jsxs("button",{onClick:P,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(bS,{size:16})," Add Rule"]}),x.jsxs("div",{className:"relative",children:[x.jsxs("button",{onClick:()=>y(!m),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(xZ,{size:16})," Add from Template"]}),m&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>y(!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"}),$U.map(B=>x.jsxs("button",{onClick:()=>k(B.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[x.jsx("div",{className:"font-medium text-slate-200",children:B.name}),x.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:B.description})]},B.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 VU=[{id:"stream-gauges",label:"Stream Gauges",icon:zE},{id:"wildfire",label:"Wildfire",icon:VE},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:WE},{id:"weather-alerts",label:"Weather Alerts",icon:Yue},{id:"solar",label:"Solar & Geomagnetic",icon:Vb},{id:"ducting",label:"Tropospheric Ducting",icon:tu},{id:"avalanche",label:"Avalanche Danger",icon:GE},{id:"traffic",label:"Traffic Flow",icon:BE},{id:"roads-511",label:"Road Conditions (511)",icon:gZ},{id:"mesh-health",label:"Mesh Health",icon:Wy},{id:"notifications",label:"Notifications",icon:_m},{id:"commands",label:"Commands",icon:CZ},{id:"api",label:"API Reference",icon:Xue}];function ar({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 Rt({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 Bt({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(xd,{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 cl({children:e}){return x.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function Ve({children:e}){return x.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function pi({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 iet(){const e=fv(),[t,r]=W.useState(""),[n,i]=W.useState("stream-gauges"),a=W.useRef(null);W.useEffect(()=>{const l=e.hash.replace("#","");if(l&&VU.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=VU.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(HE,{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(pi,{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(Bt,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),x.jsxs("li",{children:["Copy the site number (like ",x.jsx(Ve,{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(Bt,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," — find gauges near you"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," — flood forecasts and thresholds"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," — USGS explainer"]})]})]}),x.jsxs(pi,{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(Rt,{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(Rt,{headers:["Distance","What To Do"],rows:[[x.jsxs(x.Fragment,{children:[x.jsx(ar,{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(ar,{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(ar,{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(ar,{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(Ve,{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(Bt,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," — detailed incident information"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," — raw perimeter data"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," — preparedness guide"]})]})]}),x.jsxs(pi,{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(Rt,{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(Rt,{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(Bt,{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(Bt,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," — see hotspots on a map"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," — how it works"]})]})]}),x.jsxs(pi,{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(Rt,{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(Rt,{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(Rt,{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(Rt,{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(Bt,{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(Bt,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),x.jsxs("li",{children:["Zone codes look like: ",x.jsx(Ve,{children:"IDZ016"}),", ",x.jsx(Ve,{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(Ve,{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(Bt,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," — see current alerts"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," — technical details"]})]})]}),x.jsxs(pi,{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(Rt,{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(Rt,{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(cl,{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(cl,{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(cl,{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(Rt,{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(Bt,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," — live data"]}),x.jsxs("li",{children:[x.jsx(Bt,{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(Bt,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," — ham-friendly display"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," — live Kp"]})]})]}),x.jsxs(pi,{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(Rt,{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(Bt,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," — 6-day tropo prediction"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://dxmaps.com",children:"DX Maps"})," — real-time VHF/UHF propagation reports"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," — background"]})]})]}),x.jsxs(pi,{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(Rt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",x.jsx(ar,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",x.jsx(ar,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",x.jsx(ar,{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(ar,{color:"red"}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",x.jsx(ar,{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(Bt,{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(Ve,{children:"SNFAC"})," — Sawtooth (central Idaho)"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"UAC"})," — Utah"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"NWAC"})," — Cascades/Olympics (WA/OR)"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"CAIC"})," — Colorado"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"SAC"})," — Sierra Nevada (CA)"]}),x.jsxs("li",{children:[x.jsx(Ve,{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(Bt,{href:"https://avalanche.org",children:"Avalanche.org"})," — US forecasts"]}),x.jsxs("li",{children:[x.jsx(Bt,{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(Bt,{href:"https://kbyg.org",children:"Know Before You Go"})," — avalanche awareness"]})]})]}),x.jsxs(pi,{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(Rt,{headers:["Ratio","What It Means"],rows:[[x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[x.jsxs(x.Fragment,{children:[x.jsx(ar,{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(Rt,{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(Bt,{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(Bt,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," — API docs and key signup"]}),x.jsxs("li",{children:[x.jsx(Bt,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," — city congestion rankings"]})]})]}),x.jsxs(pi,{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(pi,{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(Rt,{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(cl,{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(Ve,{children:"ROUTER"}),", ",x.jsx(Ve,{children:"ROUTER_LATE"}),", or ",x.jsx(Ve,{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(cl,{children:"Utilization (25%)"}),x.jsx("p",{children:"Estimates how much of the radio channel's airtime is being used. MeshAI can't measure airtime directly, so it estimates based on packet counts over the last 24 hours."}),x.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["packets_per_hour = non_text_packets ÷ 24",x.jsx("br",{}),"airtime_estimate = (packets_per_hour × 200ms) ÷ 3,600,000ms × 100%"]}),x.jsx("p",{children:"The 200ms is an approximation for the MediumFast radio preset — each LoRa packet takes roughly 200ms of airtime. Text messages don't count toward utilization (chatting is the point of a mesh)."}),x.jsx(Rt,{headers:["Estimated Airtime","Score","What It Means"],rows:[["Under 15%","100","Channel is clear — this is the goal"],["15-20%","75-100","Getting busy, but fine"],["20-25%","50-75","Congested — firmware starts throttling GPS"],["25-35%","25-50","Seriously congested — collisions happening"],["Over 35%","0-25","Channel is overwhelmed"]]}),x.jsxs("p",{children:[x.jsx("strong",{children:"Special case:"})," If MeshAI doesn't have packet data (no sources reporting packet counts), this pillar scores 100. You're not penalized for missing data."]}),x.jsx(cl,{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(Rt,{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(cl,{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(Rt,{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(cl,{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(Rt,{headers:["Score","Tier","What It Means"],rows:[["90-100",x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",x.jsxs(x.Fragment,{children:[x.jsx(ar,{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(Rt,{headers:["Utilization","What's Happening"],rows:[[x.jsxs(x.Fragment,{children:[x.jsx(ar,{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(ar,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[x.jsxs(x.Fragment,{children:[x.jsx(ar,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[x.jsxs(x.Fragment,{children:[x.jsx(ar,{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(Rt,{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(Rt,{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(Rt,{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(pi,{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(Rt,{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(Ve,{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(pi,{id:"commands",title:"Commands",children:[x.jsxs("p",{children:["All commands use the ",x.jsx(Ve,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),x.jsx(Te,{children:"Basic Commands"}),x.jsx(Rt,{headers:["Command","What It Does"],rows:[[x.jsx(Ve,{children:"!help"}),"Shows all available commands"],[x.jsx(Ve,{children:"!ping"}),"Tests if the bot is alive"],[x.jsx(Ve,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[x.jsx(Ve,{children:"!health"}),"Detailed health report with pillar scores"],[x.jsx(Ve,{children:"!weather"}),"Current weather for your area"]]}),x.jsx(Te,{children:"Environmental Commands"}),x.jsx(Rt,{headers:["Command","What It Does"],rows:[[x.jsx(Ve,{children:"!alerts"}),"Active NWS weather alerts for your area"],[x.jsxs(x.Fragment,{children:[x.jsx(Ve,{children:"!solar"})," (or ",x.jsx(Ve,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[x.jsx(Ve,{children:"!fire"}),"Active wildfires near your mesh"],[x.jsx(Ve,{children:"!avy"}),'Avalanche advisory (seasonal — shows "off season" in summer)'],[x.jsxs(x.Fragment,{children:[x.jsx(Ve,{children:"!streams"})," (or ",x.jsx(Ve,{children:"!gauges"}),")"]}),"Stream gauge readings"],[x.jsxs(x.Fragment,{children:[x.jsx(Ve,{children:"!roads"})," (or ",x.jsx(Ve,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[x.jsx(Ve,{children:"!hotspots"}),"Satellite fire detections"]]}),x.jsx(Te,{children:"Subscription Commands"}),x.jsx(Rt,{headers:["Command","What It Does"],rows:[[x.jsx(Ve,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[x.jsx(Ve,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[x.jsx(Ve,{children:"!subscribe all"}),"Subscribe to everything"],[x.jsx(Ve,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[x.jsx(Ve,{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(pi,{id:"api",title:"API Reference",children:[x.jsxs("p",{children:["MeshAI's REST API is available at ",x.jsx(Ve,{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(Ve,{children:"GET /api/status"})," — version, uptime, node count"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/channels"})," — radio channel list"]}),x.jsxs("li",{children:[x.jsx(Ve,{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(Ve,{children:"GET /api/health"})," — health score and pillars"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/nodes"})," — all nodes with positions and telemetry"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/edges"})," — neighbor links with signal quality"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/regions"})," — region summaries"]}),x.jsxs("li",{children:[x.jsx(Ve,{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(Ve,{children:"GET /api/config"})," — full config"]}),x.jsxs("li",{children:[x.jsxs(Ve,{children:["GET /api/config/","{section}"]})," — one section"]}),x.jsxs("li",{children:[x.jsxs(Ve,{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(Ve,{children:"GET /api/env/status"})," — per-feed health"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/env/active"})," — all active events"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/env/swpc"})," — solar/geomagnetic data"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/env/ducting"})," — atmospheric profile"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/env/fires"})," — wildfire perimeters"]}),x.jsxs("li",{children:[x.jsx(Ve,{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(Ve,{children:"GET /api/alerts/active"})," — current alerts"]}),x.jsxs("li",{children:[x.jsx(Ve,{children:"GET /api/alerts/history"})," — past alerts"]}),x.jsxs("li",{children:[x.jsx(Ve,{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(Ve,{children:"ws://your-host:8080/ws/live"})," — WebSocket for live updates"]})})]})]})})]})}function aet(){return x.jsx(_ce,{children:x.jsx(Sce,{children:x.jsxs(Mue,{children:[x.jsx(fl,{path:"/",element:x.jsx(rNe,{})}),x.jsx(fl,{path:"/mesh",element:x.jsx(xJe,{})}),x.jsx(fl,{path:"/environment",element:x.jsx(TJe,{})}),x.jsx(fl,{path:"/config",element:x.jsx(HJe,{})}),x.jsx(fl,{path:"/alerts",element:x.jsx(JJe,{})}),x.jsx(fl,{path:"/notifications",element:x.jsx(net,{})}),x.jsx(fl,{path:"/reference",element:x.jsx(iet,{})})]})})})}aP.createRoot(document.getElementById("root")).render(x.jsx(Q.StrictMode,{children:x.jsx(Due,{children:x.jsx(aet,{})})})); diff --git a/meshai/dashboard/static/index.html b/meshai/dashboard/static/index.html index acb05a9..96e6925 100644 --- a/meshai/dashboard/static/index.html +++ b/meshai/dashboard/static/index.html @@ -8,7 +8,7 @@ - +